πŸ”©Taraxa RPC Specs

Detailed RPC specifications for the Taraxa Network

Taraxa RPC's Ethereum Compatibility

Taraxa is nearly 100% ETH-compatible, with a few quirks, exceptions, and Taraxa-specific specs.

Quirks of ETH-RPC on Taraxa

  • "pending" block identifier means "latest"

  • eth_syncing return values are to be better defined

ETH-RPC not implemented on Taraxa

Taraxa protocol supports all Ethereum methods described on this pagearrow-up-right except:

  • web3_clientVersion

  • web3_sha3

  • eth_mining

  • eth_hashrate

  • eth_getWork

  • eth_submitWork

  • eth_submitHashrate

  • eth_getCompilers

  • eth_compileSolidity

  • eth_compileLLL

  • eth_compileSerpent

  • db_putString

  • db_getString

  • db_putHex

  • db_getHex

  • shh_version

  • shh_post

  • shh_newIdentity

  • shh_hasIdentity

  • shh_newGroup

  • shh_addToGroup

  • shh_newFilter

  • shh_uninstallFilter

  • shh_getFilterChanges

  • shh_getMessages

All unimplemented methods will return a standard json-rpc error that the method is not present

Taraxa-Specific RPC Methods

taraxa_protocolVersion

Returns current taraxa network protocol version

Parameters

none

Returns

QUANTITY - The current network protocol version

Example

taraxa_getVersion

Returns extended description of Taraxa node version.

Parameters

none

Returns

OBJECT, An object with info about current version

  • version: STRING - Triplet describing full version of node in format MAJOR.MINOR.PATCH

  • git_branch: STRING - Name of the branch node was built from

  • git_commit_hash: DATA, 20 Bytes - Hash of the commit node was built from

  • git_commit_date: STRING - Date of the commit node was built from

  • git_description: STRING - Git description of commit node was built from

Example

taraxa_getDagBlockByHash

Returns information about DAG block by hash

Parameters

  1. DATA, 32 Bytes - Hash of a block.

  2. Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions.

Returns

OBJECT - A DAG block object, or null when no block was found:

  • pivot: DATA, 32 Bytes -

  • level: QUANTITY - Level at which block was produced

  • period: QUANTITY - Finalization period of this block

  • tips: ARRAY - List of tips

  • transactions: ARRAY - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.

  • trx_estimations: ARRAY - Array of QUANTITIES that means transaction gas estimation for corresponding transaction. For example trx_estimations[0] is for transactions[0]

  • sig: DATA, 65 Bytes - Signature of block creator

  • hash: DATA, 32 Bytes - Hash of this block

  • sender: DATA, 20 Bytes - Address of block creator

  • timestamp: QUANTITY - Time of block creation

  • vdf: OBJECT - vdf proof for this block

    • pk: DATA, 32 Bytes - Public key

    • proof: DATA, 80 Bytes - Bytes of proof

    • sol1: DATA - First part of solution

    • sol1: DATA - Second part of solution

    • difficulty: QUANTITY - Difficulty with which block was produced

Example

taraxa_getDagBlockByLevel

Returns information about DAG blocks for specified level

Parameters

  1. QUANTITY - Level to get blocks from

  2. Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions.

Returns

ARRAY of OBJECT - A DAG block object, or null when no block was found:

  • pivot: DATA, 32 Bytes -

  • level: QUANTITY - Level at which block was produced

  • period: QUANTITY - Finalization period of this block

  • tips: ARRAY - List of tips

  • transactions: ARRAY - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.

  • trx_estimations: ARRAY - Array of QUANTITIES that means transaction gas estimation for corresponding transaction. For example trx_estimations[0] is for transactions[0]

  • sig: DATA, 65 Bytes - Signature of block creator

  • hash: DATA, 32 Bytes - Hash of this block

  • sender: DATA, 20 Bytes - Address of block creator

  • timestamp: QUANTITY - Time of block creation

  • vdf: OBJECT - vdf proof for this block

    • pk: DATA, 32 Bytes - Public key

    • proof: DATA, 80 Bytes - Bytes of proof

    • sol1: DATA - First part of solution

    • sol1: DATA - Second part of solution

    • difficulty: QUANTITY - Difficulty with which block was produced

Example

taraxa_dagBlockLevel

Returns current maximum level of DAG

Parameters

none

Returns

QUANTITY - The current maximum DAG level

Example

taraxa_dagBlockPeriod

Returns last period

Parameters

none

Returns

String - The current protocol version

Example

taraxa_getScheduleBlockByPeriod

Returns PBFT block info with DAG block schedule for period

Parameters

QUANTITY - period

Returns

OBJECT - PBFT block info

  • beneficiary: DATA, 20 Bytes - Address of beneficiary(block creator)

  • block_hash: DATA, 32 Bytes - Hash of the block

  • dag_block_hash_as_pivot: DATA, 32 Bytes - Hash of the pivot block

  • order_hash: DATA, 32 Bytes - Hash of DAG blocks order

  • period: QUANTITY - Period number

  • prev_block_hash: DATA, 32 Bytes - Hash of previous PBFT block

  • schedule: OBJECT

    • dag_blocks_order: ARRAY - DAG blocks order for current PBFT block

  • signature: DATA, 65 Bytes - Beneficiary signature of the block

  • timestamp: QUANTITY - Time of block generation

Example

taraxa_getConfig

Returns current node configuration

Parameters

none

Returns

OBJECT - config object

  • chain_id: QUANTITY - chain id. Different between networks

  • dag_genesis_block: OBJECT - DAG genesis block

  • final_chain: OBJECT - FinalChain config object

  • pbft: OBJECT - PBFT configuration object

  • sortition: OBJECT - Sortition configuration object

Example

taraxa_getChainStats

Returns current chain stats with count of transactions, PBFT blocks and DAG blocks

Parameters

none

Returns

OBJECT - current chain stats object

  • pbft_period: QUANTITY - current PBFT period

  • dag_blocks_executed: QUANTITY - count of executed(finalized) DAG blocks

  • transactions_executed: QUANTITY - count of executed transactions

Example

taraxa_yield

Returns calculated total network yield for specified period

Parameters

QUANTITY - period

Returns

String - yield

To transform returned yield to percents -> decimal(yield) / 1e4 To transform returned yield to fraction -> decimal(yield) / 1e6

Example

taraxa_totalSupply

Returns total supply for specified period

Parameters

QUANTITY - period

Returns

String - total supply

Example

Test API

get_sortition_change

Get sortition params changes for closest smaller period to specified

Parameters

OBJECT - param is wrapped into object

  • period: QUANTITY` - period number to get sortition parameters for

Returns

OBJECT - sortition parameters

  • interval_efficiency: QUANTITY - efficiency of interval

  • period: QUANTITY - number of period when closest smaller change happened

  • threshold_range: QUANTITY - range of normal selection

  • threshold_upper: QUANTITY - upper bound of normal selection

  • kThresholdUpperMinValue: QUANTITY - const that represents minimum value of threshold_upper

Example

send_coin_transaction

Method to create and send transfer transaction. Used in some tests and CI

Parameters

OBJECT - block json to insert

  • secret: DATA, 32 Bytes - Secret key for account to send transaction from

  • nonce: QUANTITY - Nonce to send transaction with

  • value: QUANTITY - Value to specify in created transaction

  • gas_price: QUANTITY - Gas price to specify in created transaction

  • gas: QUANTITY - Amount of gas transaction can use

  • receiver: DATA, 20 Bytes - Address of receiver account

Returns

none

Example

get_account_address

Returns address of account on current node

Parameters

none

Returns

DATA, 20 Bytes - address of account on current node

Example

get_peer_count

Returns count of peers that node is connected to

Parameters

none

Returns

QUANTITY - count of peers that node is connected to

Example

get_node_status

Returns current taraxa network protocol version

Parameters

none

Returns

OBJECT - with a lot of info about node status including networking. See Example

Example

get_packets_stats

Returns current taraxa network protocol version

Parameters

none

Returns

OBJECT - with info about packets statistic

  • received_packets: ARRAY of PACKET_STATS_OBJECT

  • received_packets_period_max_stats: OBJECT

    • period_max_counts_stats: ARRAY of PACKET_STATS_OBJECT

    • period_max_sizes_stats: ARRAY of PACKET_STATS_OBJECT

  • sent_packets: ARRAY of PACKET_STATS_OBJECT

  • sent_packets_period_max_stats: OBJECT

    • period_max_counts_stats: ARRAY of PACKET_STATS_OBJECT

    • period_max_sizes_stats: ARRAY of PACKET_STATS_OBJECT

PACKET_STATS_OBJECT:

  • avg_processing_duration: QUANTITY - average processing time of one packet

  • avg_size: QUANTITY - average packet size

  • avg_tp_wait_duration: QUANTITY - Average ThreadPool waiting time for 1 packet

  • total_count: QUANTITY - total count of processed packets

  • total_processing_duration: QUANTITY - total processing time for all packets

  • total_size: QUANTITY - sum of size of all processed packets

  • total_tp_wait_duration: QUANTITY - Total ThreadPool waiting time

  • type: STRING - Type of packet data related to. List of packet types:

Example

get_all_nodes

Returns info of current connected nodes including its id, ip_address and port

Parameters

none

Returns

STRING - string that contains info about peer if format id ip_address:port separated with .

Example

Last updated