π©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_syncingreturn values are to be better defined
ETH-RPC not implemented on Taraxa
Taraxa protocol supports all Ethereum methods described on this page 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 formatMAJOR.MINOR.PATCHgit_branch:STRING- Name of the branch node was built fromgit_commit_hash:DATA, 20 Bytes - Hash of the commit node was built fromgit_commit_date:STRING- Date of the commit node was built fromgit_description:STRING- Git description of commit node was built from
Example
taraxa_getDagBlockByHash
Returns information about DAG block by hash
Parameters
DATA, 32 Bytes - Hash of a block.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 producedperiod:QUANTITY- Finalization period of this blocktips:ARRAY- List of tipstransactions:ARRAY- Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.trx_estimations:ARRAY- Array ofQUANTITIESthat means transaction gas estimation for corresponding transaction. For exampletrx_estimations[0]is fortransactions[0]sig:DATA, 65 Bytes - Signature of block creatorhash:DATA, 32 Bytes - Hash of this blocksender:DATA, 20 Bytes - Address of block creatortimestamp:QUANTITY- Time of block creationvdf:OBJECT- vdf proof for this blockpk:DATA, 32 Bytes - Public keyproof:DATA, 80 Bytes - Bytes of proofsol1:DATA- First part of solutionsol1:DATA- Second part of solutiondifficulty:QUANTITY- Difficulty with which block was produced
Example
taraxa_getDagBlockByLevel
Returns information about DAG blocks for specified level
Parameters
QUANTITY- Level to get blocks fromBoolean- 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 producedperiod:QUANTITY- Finalization period of this blocktips:ARRAY- List of tipstransactions:ARRAY- Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.trx_estimations:ARRAY- Array ofQUANTITIESthat means transaction gas estimation for corresponding transaction. For exampletrx_estimations[0]is fortransactions[0]sig:DATA, 65 Bytes - Signature of block creatorhash:DATA, 32 Bytes - Hash of this blocksender:DATA, 20 Bytes - Address of block creatortimestamp:QUANTITY- Time of block creationvdf:OBJECT- vdf proof for this blockpk:DATA, 32 Bytes - Public keyproof:DATA, 80 Bytes - Bytes of proofsol1:DATA- First part of solutionsol1:DATA- Second part of solutiondifficulty: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 blockdag_block_hash_as_pivot:DATA, 32 Bytes - Hash of the pivot blockorder_hash:DATA, 32 Bytes - Hash of DAG blocks orderperiod:QUANTITY- Period numberprev_block_hash:DATA, 32 Bytes - Hash of previous PBFT blockschedule:OBJECTdag_blocks_order:ARRAY- DAG blocks order for current PBFT block
signature:DATA, 65 Bytes - Beneficiary signature of the blocktimestamp: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 networksdag_genesis_block:OBJECT- DAG genesis blockfinal_chain:OBJECT- FinalChain config objectpbft:OBJECT- PBFT configuration objectsortition: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 perioddag_blocks_executed:QUANTITY- count of executed(finalized) DAG blockstransactions_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 intervalperiod:QUANTITY- number of period when closest smaller change happenedthreshold_range:QUANTITY- range of normal selectionthreshold_upper:QUANTITY- upper bound of normal selectionkThresholdUpperMinValue:QUANTITY- const that represents minimum value ofthreshold_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 fromnonce:QUANTITY- Nonce to send transaction withvalue:QUANTITY- Value to specify in created transactiongas_price:QUANTITY- Gas price to specify in created transactiongas:QUANTITY- Amount of gas transaction can usereceiver: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:ARRAYofPACKET_STATS_OBJECTreceived_packets_period_max_stats:OBJECTperiod_max_counts_stats:ARRAYofPACKET_STATS_OBJECTperiod_max_sizes_stats:ARRAYofPACKET_STATS_OBJECT
sent_packets:ARRAYofPACKET_STATS_OBJECTsent_packets_period_max_stats:OBJECTperiod_max_counts_stats:ARRAYofPACKET_STATS_OBJECTperiod_max_sizes_stats:ARRAYofPACKET_STATS_OBJECT
PACKET_STATS_OBJECT:
avg_processing_duration:QUANTITY- average processing time of one packetavg_size:QUANTITY- average packet sizeavg_tp_wait_duration:QUANTITY- Average ThreadPool waiting time for 1 packettotal_count:QUANTITY- total count of processed packetstotal_processing_duration:QUANTITY- total processing time for all packetstotal_size:QUANTITY- sum of size of all processed packetstotal_tp_wait_duration:QUANTITY- Total ThreadPool waiting timetype: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