json-rpc NV >= 1.3.0
( node version >= v1.3.0 )
JSON is a lightweight data exchange format. It can represent numbers, strings, ordered value sequences and key-value pairs.
JSON-RPC is a stateless, lightweight Remote Procedure Call (RPC) protocol. It defines several data structures and the relevant rules to handle them. JSON-RPC is transmission-agnostic, because it can be used in situations like process, socket, HTTP, or different message transmission environments. It uses JSON(RFC 4627) as the data format.
Curl Examples Explained
The curl options below might return a response where the node complains about the content type, this is because the --data option sets the content type to application/x-www-form-urlencoded .
JSON-RPC Support
Type
Supported?
JSON-RPC 1.0
✓
JSON-RPC 2.0
✓
Batch Requests
✓
HTTP
✓
WS
✓
JSON-RPC Port
Default port:
Client
Type
Address
Go
jsonrpc-2.0
Go
http
Go
websocket
JSON-RPC List
Currently, there are several RPCs with different namespaces:
seele
:node data manipulation and procurement / acquisitiontxpool
:transaction pool managementdownload
:RPC collection provided for internal inquiry of blockchain node synchronization state.network
:connection managementminer
:miner manipulationdebug
:node debuggingmonitor
:node monitor
JSON-RPC Contents
Command
Full
Light
public
private
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
Command
Full
Light
public
private
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
Command
Full
Light
public
private
✓
✓
✓
✓
Command
Full
Light
public
private
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
Command
Full
Light
public
private
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
Command
Full
Light
public
private
✓
✓
✓
✓
✓
✓
Command
Full
Light
public
private
✓
✓
✓
✓
seele
RPC collection provided for public for blockchain node and transaction manipulation.
GetInfo
This method returns the node information.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getInfo","params":[],"id":2}
Parameters
none
Returns
Coinbase
:string
- node addressCurrentBlockHeight
:uint64
- current block heightHeaderHash
:string
- block hashMinerStatus
:string
- miner statusShard
:int
- shard numberVersion
:string
- version number of the nodeBlockAge
:big.Int
- the age of the latest block of the nodePeerCnt
:string
- total peer count and the peer count of each shard
Example
Request
Result
GetBalance
This method returns the account balance given the account address.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getBalance","params":[string,string ,uint64],"id":1}
Parameters
Account
:string
- accounthexHash
:string
- hex form of a block hash, set to "" for the latest balanceheight
:uint64
- height of a block, set to -1 for the latest balance
Returns
Account
:string
- accountBalance
:big.Int
- account balance
Example
Request
Result
AddTx
This method submits a transaction to the node.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_addTx","params":[types.Transaction],"id":1}
Parameters
tx
:types.Transaction
- transaction struct (client commandsign
could be used to get transaction hash and signature)Hash
:string
- transaction hashData
:json
- transaction dataFrom
:string
- transaction senderTo
:string
- transaction receiverAmount
:uint64
- amount value, unit is fanFee
:uint64
- transaction feePayload
:string
- transaction payloadAccountNonce
:uint64
- transaction nonce
Signature
:crypto.Signature
- transaction signature struct
Returns
result
:bool
- transaction send result
Example
Request
Result
GetAccountNonce
This method is used to obtain the account nonce.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getAccountNonce","params":[string,string ,uint64],"id":1}
Parameters
account
:string
- accounthexHash
:string
- hex form of a block hash, set to "" for the latest nonceheight
:uint64
- height of a block, set to -1 for the latest nonce
Returns
result
:uint64
- account nonce
Example
Request
Result
GetBlockHeight
This method is used to obtain the height of the blockchain.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getBlockHeight","params":[],"id":1}
Parameters
none
Returns
result
:uint64
- block height
Example
Request
Result
GetBlock
This method is used to obtain the block content based on block height or block hash.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getBlock","params":[string,string,bool],"id":1}
Parameters
hash
:string
- block hashheight
:string
- block heightfulltx, f
:bool
- whether to include detailed transaction information
Returns
debts
:array
- debts in blockHash
:string
- debts hashData
:json
- debts dataTxHash
:string
- txhash in debtShard
:int
- shard number of seele node where debts onAccount
:array
- debt accountAmount
:int64
- debt amountFee
:int64
- debt feeCode
:string
- debt code
hash
:string
- block hashheader
:json
- block headerPreviousBlockHash
:string
- previous block hashCreator
:string
- creator addressTxHash
:string
- tx hashReceiptHash
:string
- Receipts hashstateHash
:string
- state tree hashTxDebtHash
:string
- debts hashDebtHash
:string
- debts hashDifficulty
:big.Int
- block difficultyHeight
:unit64
- block heightCreateTimestamp
:uint64
- create timestampWitness
:string
- block nonceConsensus
:int
- consensus algorithmExtraData
:string
- extra data
totalDifficulty
:big.Int
- total difficultytransactions
:array
- transaction arrayaccountNonce
:unit64
- account nonceamount
:Int
- transaction amountfrom
:string
- transaction providergasLimit
:Int
- transaction gas limitgasPrice
:Int
- transaction gas pricehash
:string
- transaction hashpayload
:array
- transaction payloadto
:string
- transaction receiver
txDebts
:array
- transaction debtsHash
:string
- txDebts hashData
:json
- txDebts dataTxHash
:string
- transaction hashFrom
:string
- transaction senderNonce
:unit64
- sender nonceAccount
:string
- transaction accountAmount
:int
- transaction amountPrice
:int
- transaction gas priceCode
:string
- transaction code
Example
Request
Result
GetBlockByHash
This method is used to obtain the block content based on block hash.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getBlockByHash","params":[string,bool],"id":1}
Parameters
hash
:string
- block hashfulltx, f
:bool
- whether to include detailed transaction information
Returns
debts
:array
- debts in blockHash
:string
- debts hashData
:json
- debts dataTxHash
:string
- txhash in debtShard
:int
- shard number of seele node where debts onAccount
:array
- debt accountAmount
:int64
- debt amountFee
:int64
- debt feeCode
:string
- debt code
hash
:string
- block hashheader
:json
- block headerPreviousBlockHash
:string
- previous block hashCreator
:string
- creator addressTxHash
:string
- tx hashReceiptHash
:string
- Receipts hashstateHash
:string
- state tree hashTxDebtHash
:string
- debts hashDebtHash
:string
- debts hashDifficulty
:big.Int
- block difficultyHeight
:unit64
- block heightCreateTimestamp
:uint64
- create timestampWitness
:string
- block nonceConsensus
:int
- consensus algorithmExtraData
:string
- extra data
totalDifficulty
:big.Int
- total difficultytransactions
:array
- transaction arrayaccountNonce
:unit64
- account nonceamount
:Int
- transaction amountfrom
:string
- transaction providergasLimit
:Int
- transaction gas limitgasPrice
:Int
- transaction gas pricehash
:string
- transaction hashpayload
:array
- transaction payloadto
:string
- transaction receiver
txDebts
:array
- transaction debtsHash
:string
- txDebts hashData
:json
- txDebts dataTxHash
:string
- transaction hashFrom
:string
- transaction senderNonce
:unit64
- sender nonceAccount
:string
- transaction accountAmount
:int
- transaction amountPrice
:int
- transaction gas priceCode
:string
- transaction code
Example
Request
Result
GetBlockByHeight
This method is used to obtain the block content based on block height.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getBlockByHeight","params":[string,bool],"id":1}
Parameters
height
:string
- block heightfulltx, f
:bool
- whether to include detailed transaction information
Returns
debts
:array
- debts in blockHash
:string
- debts hashData
:json
- debts dataTxHash
:string
- txhash in debtShard
:int
- shard number of seele node where debts onAccount
:array
- debt accountAmount
:int64
- debt amountFee
:int64
- debt feeCode
:string
- debt code
hash
:string
- block hashheader
:json
- block headerPreviousBlockHash
:string
- previous block hashCreator
:string
- creator addressTxHash
:string
- tx hashReceiptHash
:string
- Receipts hashstateHash
:string
- state tree hashTxDebtHash
:string
- debts hashDebtHash
:string
- debts hashDifficulty
:big.Int
- block difficultyHeight
:unit64
- block heightCreateTimestamp
:uint64
- create timestampWitness
:string
- block nonceSecondWitness
:string
- second block nonce (degenerated)Consensus
:int
- consensus algorithmExtraData
:string
- extra data
totalDifficulty
:big.Int
- total difficultytransactions
:array
- transaction arrayaccountNonce
:unit64
- account nonceamount
:Int
- transaction amountfrom
:string
- transaction providergasLimit
:Int
- transaction gas limitgasPrice
:Int
- transaction gas pricehash
:string
- transaction hashpayload
:array
- transaction payloadto
:string
- transaction receiver
txDebts
:array
- transaction debtsHash
:string
- txDebts hashData
:json
- txDebts dataTxHash
:string
- transaction hashFrom
:string
- transaction senderNonce
:unit64
- sender nonceAccount
:string
- transaction accountAmount
:int
- transaction amountPrice
:int
- transaction gas priceCode
:string
- transaction code
Example
Request
Result
Call
This method is used to execute a given transaction on a statedb of a given block height. It does not affect the statedb or blockchain and is useful for executing and retrieving values. However, the height currently does not support optional and will remove the from parameter in the next version or more.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_call ","params":[CallRequest],"id":1}
Parameters
to
:string
- to addresspayload
:string
- transaction payload infoHeight
:int64
- block height (default: -1)
Returns
contract
:string
- contract addressfailed
:bool
- contract executes successfully or notpoststate
:string
- state trie root hash after transaction executionresult
:string
- transaction resulttotalFee
:int64
- transaction feetxhash
:string
- transaction hashusedGas
:int64
- transaction gas
Example
When using the example below, the contract must be deployed first. The solidity code file:
As you can see, the example is testing the get function.
Request
Result
GetLogs
This method gets the event logs by block height, the contract address, and the event name.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getLogs ","params":[GetLogsRequest],"id":1}
Parameters
height
:int64
- block height (default: -1)contract
:string
- contract addressabi
:string
- contract abievent
:string
- event name
Returns
address
:string
- contract addresstopics
:array
- topic arraydata
:string
- datablocknumber
:uint64
- block heighttransactionNumber
:uint
- the index of the transaction in the block
Example
When using the example below, the contract must be deployed first. The solidity code file:
As you can see, this example is testing the get function. In this situation, the height is the block height of the block containing the get transaction.
Request
Result
GetCode
This method gets the contract code by block height and contract address.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getCode ","params":[string, int64],"id":1}
Parameters
contract
:string
- contract addressheight
:int64
- block height (default: -1)
Returns
payload
:string
- contract code
Example
Request
Result
GeneratePayload
This method generates the contract method payload.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_generatePayload","params":[string, string, []string],"id":1}
Parameters
abiJSON
:string
- contract json stringmethodName
:string
- contract method nameargs
:string
- args of contract method
Returns
result
:string
payload of contract method with args
Example
Request
Result
EstimateGas
This method estimates the gas of a transaction.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_estimateGas","params":[types.Transaction],"id":1}
Parameters
Hash
:string
- transaction hashData
:json
- transaction dataFrom
:string
- transaction senderTo
:string
- transaction receiverAmount
:uint64
- amount value, unit is fanGasPrice
:uint64
- transaction gas price in FanGasLimit
:uint64
- maximum gas for transactionPayload
:string
- transaction payloadAccountNonce
:uint64
- transaction nonce
Returns
result
:uint64 - gas amount
Example
Request
Result
GetBlockTransactionCount
This method is used to obtain the number of transactions in the block based on block height or hash.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getBlockTransactionCount","params":[string,int64],"id":1}
Parameters
hash
:string
- hash value in hexheight
:int64
- block height (default: -1)
Returns
result
:int
- transactions count
Example
Request
Result
GetBlockTransactionCountByHeight
This method is used to obtain the number of transactions in the block based on block height.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getBlockTransactionCountByHeight","params":[int64],"id":1}
Parameters
height
:int64
- block height (default: -1)
Returns
result
:int
- transactions count
Example
Request
Result
GetBlockTransactionCountByHash
This method is used to obtain the number of transactions in the block based on block hash.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getBlockTransactionCountByHash","params":[string],"id":1}
Parameters
hash
:string
- hash value in hex
Returns
result
:int
- transactions count
Example
Request
Result
GetTransactionByBlockIndex
This method is used to obtain the transaction content based on block height or hash and transaction index.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getTransactionByBlockIndex","params":[string,int,int],"id":1}
Parameters
hash
:string
- block hashheight
:int
- block height (default: -1)index
:int
- transaction index, start with 0 (default: 0)
Returns
accountNonce
:unit64
- account nonceamount
:Int
- transaction amountgasLimit
:Int
- transaction gas limitgasPrice
:Int
- transaction gas pricefrom
:string
- transaction providerto
:string
- transaction receiverhash
:string
- transaction hashpayload
:array
- transaction payload
Example
Request
Result
GetTransactionByBlockHeightAndIndex
This method is used to obtain the transaction content based on block height and transaction index.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getTransactionByBlockHeightAndIndex","params":[int,int],"id":1}
Parameters
height
:int
- block height (default: -1)index
:int
- transaction index, start with 0 (default: 0)
Returns
accountNonce
:unit64
- account nonceamount
:Int
- transaction amountgasLimit
:Int
- transaction gas limitgasPrice
:Int
- transaction gas pricefrom
:string
- transaction providerto
:string
- transaction receiverhash
:string
- transaction hashpayload
:array
- transaction payload
Example
Request
Result
GetTransactionByBlockHashAndIndex
This method is used to obtain the transaction content based on block hash and transaction index.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getTransactionByBlockHashAndIndex","params":[string,int],"id":1}
Parameters
hash
:string
- block hashindex
:int
- transaction index, start with 0 (default: 0)
Returns
accountNonce
:unit64
- account nonceamount
:Int
- transaction amountgasLimit
:Int
- transaction gas limitgasPrice
:Int
- transaction gas pricefrom
:string
- transaction providerto
:string
- transaction receiverhash
:string
- transaction hashpayload
:array
- transaction payload
Example
Request
Result
GetReceiptByTxHash
This method is used to obtain the receipt contents based on transaction hash.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getReceiptByTxHash","params":[string,string],"id":1}
Parameters
hash
:string
- hash value in hexabi
:string
- the abi file of contract
Returns
contract
:string
- contract addressfailed
:bool
- transaction executes successfully or notpoststate
:string
- state trie root hash after transaction executionresult
:string
- transaction resulttotalFee
:int
- transaction feetxhash
:string
- transaction hashusedGas
:int
- transaction gas
Example
Request
Result
GetTransactionsFrom
This method returns transactions from one account at specific height or block hash.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getTransactionsFrom","params":[string,string ,uint64],"id":1}
Parameters
account
:string
- from accounthexHash
:string
- hex form of a block hashheight
:uint64
- height of a block
Returns
transaction index
:string
- transaction indexfrom
:string
- transaction provideramount
:Int
- transaction amountpayload
:array
- transaction payloadto
:string
- transaction receiveraccountNonce
:unit64
- account noncegasLimit
:Int
- transaction gas limithash
:string
- transaction hash
Example
Request
Result
GetTransactionsTo
This method returns transactions from one account at specific height or block hash.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getTransactionsTo","params":[string,string ,uint64],"id":1}
Parameters
account
:string
- from accounthexHash
:string
- hex form of a block hashheight
:uint64
- height of a block
Returns
transaction index
:string
- transaction indexfrom
:string
- transaction provideramount
:Int
- transaction amountpayload
:array
- transaction payloadto
:string
- transaction receiveraccountNonce
:unit64
- account noncegasLimit
:Int
- transaction gas limithash
:string
- transaction hash
Example
Request
Result
GetAccountTransactions
This method returns transactions from one account at specific height or block hash.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getAccountTransactions","params":[string,string ,uint64],"id":1}
Parameters
account
:string
- from accounthexHash
:string
- hex form of a block hashheight
:uint64
- height of a block
Returns
transaction index
:string
- transaction indexfrom
:string
- transaction provideramount
:Int
- transaction amountpayload
:array
- transaction payloadto
:string
- transaction receiveraccountNonce
:unit64
- account noncegasLimit
:Int
- transaction gas limithash
:string
- transaction hash
Example
Request
Result
GetBlockTransactions
This method returns transactions at specific height or block hash.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getBlockTransactions","params":[string ,uint64],"id":1}
Parameters
hexHash
:string
- hex form of a block hashheight
:uint64
- height of a block
Returns
transaction index
:string
- transaction indexfrom
:string
- transaction provideramount
:Int
- transaction amountpayload
:array
- transaction payloadto
:string
- transaction receiveraccountNonce
:unit64
- account noncegasLimit
:Int
- transaction gas limithash
:string
- transaction hash
Example
Request
Result
GetBlockTransactionsByHeight
This method returns transactions from one account at specific height or block hash.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getBlockTransactionsByHeight","params":[uint64],"id":1}
Parameters
height
:uint64
- height of a block
Returns
transaction index
:string
- transaction indexfrom
:string
- transaction provideramount
:Int
- transaction amountpayload
:array
- transaction payloadto
:string
- transaction receiveraccountNonce
:unit64
- account noncegasLimit
:Int
- transaction gas limithash
:string
- transaction hash
Example
Request
Result
GetBlockTransactionsByHash
This method returns transactions from one account at specific height or block hash.
Type
Template
RPC
{"jsonrpc":"2.0","method":"seele_getBlockTransactionsByHash","params":[string],"id":1}
Parameters
height
:uint64
- height of a block
Returns
transaction index
:string
- transaction indexfrom
:string
- transaction provideramount
:Int
- transaction amountpayload
:array
- transaction payloadto
:string
- transaction receiveraccountNonce
:unit64
- account noncegasLimit
:Int
- transaction gas limithash
:string
- transaction hash
Example
Request
Result
txpool
RPC collection provided for internal use for transaction pool inquiry manipulation.
GetTransactionByHash
This method returns transaction information by hash.
Type
Template
RPC
{"jsonrpc":"2.0","method":"txpool_getTransactionByHash","params":[string],"id":1}
Parameters
hash
:string
- hash value in hex
Returns
blockHash
:string
- block hashblockHeight
:int
- block heightstatus
:string
- transaction statusaccountNonce
:unit64
- account nonceamount
:Int
- transaction amountgasLimit
:Int
- transaction gas limitgasPrice
:Int
- transaction gas pricefrom
:string
- transaction providerto
:string
- transaction receiverhash
:string
- transaction hashpayload
:array
- transaction payloadsignature
:string
- transaction signaturetxIndex
:int
- transaction index in block
Example
Request
Result
GetDebtByHash
This method is used to obtain the debt contents based on debt hash.
Type
Template
RPC
{"jsonrpc":"2.0","method":"txpool_getDebtByHash","params":[string],"id":1}
Parameters
hash
:string
- debt hash value in hex
Returns
blockHash
:string
- block hash of the debt onblockHeight
:int64
- block height of the debt ondebt
:json
- debt jsonHash
:string
- debt hashData
:json
- debt dataTxHash
:string
- txhash in debtFrom
:string
- address of the senderNonce
:uint64
- nonce of From addressAccount
:string
- debt accountAmount
:int64
- debt amountPrice
:int64
- debt priceCode
:string
- debt contract code
debtIndex
:int
- debt index of the block debtsstatus
:string
- debt status
Example
Request
Result
GetGasPrice
This method returns the tx gas price.
Type
Template
RPC
{"jsonrpc":"2.0","method":"txpool_getGasPrice","params":[string],"id":1}
Parameters
hash
:string
- hash value in hex
Returns
gasPrice
:Int
- transaction gas price
Example
Request
Result
Or (if transaction is not found)
GetTxPoolContent
This method is used to obtain the transaction pool content.
Type
Template
RPC
{"jsonrpc":"2.0","method":"txpool_getTxPoolContent","params":[],"id":2}
Parameters
none
Returns
accountNonce
:unit64
- account nonceamount
:Int
- transaction amountfrom
:string
- transaction providerto
:string
- transaction receiverhash
:string
- transaction hashpayload
:array
- transaction payloadtimestamp
:string
- transaction timestampGasPrice
:int64
- transaction gas priceGasLimit
:int64
- transaction gas limit
Example
Request
Result
GetTxPoolTxCount
This method is used to obtain the number of transactions in the transaction pool.
Type
Template
RPC
{"jsonrpc":"2.0","method":"txpool_getTxPoolTxCount","params":[],"id":2}
Parameters
none
Returns
result
:uint64
- number of transactions
Example
Request
Result
GetPendingTransactions
This method is used to obtain pending transactions in the transaction pool.
Type
Template
RPC
{"jsonrpc":"2.0","method":"txpool_getPendingTransactions","params":[],"id":2}
Parameters
none
Returns
accountNonce
:unit64
- account nonceamount
:Int
- transaction amountfrom
:string
- transaction providerto
:string
- transaction receiverhash
:string
- transaction hashpayload
:array
- transaction payloadtimestamp
:string
- transaction timestampfee
:int
- transaction fee
Example
Request
Result
GetPendingDebts
This method is used to obtain pending transactions in the transaction pool.
Type
Template
RPC
{"jsonrpc":"2.0","method":"txpool_getPendingDebts","params":[],"id":2}
Parameters
none
Returns
Data
:json
- debt dataAccount
:array
- debt accountAmount
:int64
- debt amountCode
:string
- debt codeFee
:int64
- debt feeShard
:int
- shard number of seele node where debts onTxHash
:string
- txhash in debt
Hash
:string
- debts hash
Example
Request
Result
download
RPC collection provided for internal inquiry of blockchain node synchronization state.
GetStatus
This method returns synchronization information.
Type
Template
RPC
{"jsonrpc":"2.0","method":"download_getStatus","params":[],"id":2}
Parameters
none
Returns
Status
:string
- synchronization stateDuration
:string
- synchronization duration (seconds)StartNum
:uint64
- synchronization initial block heightAmount
:uint64
- synchronization valueDownloaded
:uint64
- Synchronization number of times
Example
Request
Result
IsSyncing
This method returns the synchronization status.
Type
Template
RPC
{"jsonrpc":"2.0","method":"download_isSyncing","params":[],"id":2}
Parameters
none
Returns
result
:bool
- synchronization state
Example
Request
Result
network
RPC collection provided for internal inquiry of network node information.
GetPeersInfo
This method returns the information of peer nodes.
Type
Template
RPC
{"jsonrpc":"2.0","method":"network_getPeersInfo","params":[],"id":2}
Parameters
none
Returns
id
:string
- node IDcaps
:array
- peer node protocol and version arraynetwork
:struct
- network access address collectionlocalAddress
:string
- local addressremoteAddress
:string
- remote address
protocols
:map
- node collection, key is the node nameversion
:int
- node protocaldifficulty
:big.Int
- node difficultyhead
:string
- current block hash of the node
shard
:uint
- shard id of the nodeExample
Request
Result
GetPeerCount
This method returns the number of peer nodes.
Type
Template
RPC
{"jsonrpc":"2.0","method":"network_getPeerCount","params":[],"id":2}
Parameters
none
Returns
result
:int
- peer number of node
Example
Request
Result
GetNetVersion
This method returns the network version.
Type
Template
RPC
{"jsonrpc":"2.0","method":"network_getNetVersion","params":[],"id":2}
Parameters
none
Returns
result
:string
- version number
Example
Request
Result
GetProtocolVersion
This method returns the protocol version.
Type
Template
RPC
{"jsonrpc":"2.0","method":"network_getProtocolVersion","params":[],"id":2}
Parameters
none
Returns
result
:int
- version number
Example
Request
Result
GetNetworkID
This method returns the network id.
Type
Template
RPC
{"jsonrpc":"2.0","method":"network_getNetworkID","params":[],"id":2}
Parameters
none
Returns
result
:string
- network id
Example
Request
Result
IsListening
This method returns whether the node network is listening or not.
Type
Template
RPC
{"jsonrpc":"2.0","method":"network_isListening","params":[],"id":2}
Parameters
none
Returns
result
:bool
- listening status
Example
Request
Result
miner
RPC collection provided for internal inquiry of miner information.
Start
This method starts the miner with an input number of threads.
Type
Template
RPC
{"jsonrpc":"2.0","method":"miner_start","params":[int],"id":2}
Parameters
threads
:int
- number of threads
Returns
result
:bool
- start result
Example
Request
Result
Stop
This method stops the miner.
Type
Template
RPC
{"jsonrpc":"2.0","method":"miner_stop","params":[],"id":2}
Parameters
none
Returns
result
:bool
- stop result
Example
Request
Result
Status
This method returns the miner status.
Type
Template
RPC
{"jsonrpc":"2.0","method":"miner_status","params":[],"id":2}
Parameters
none
Returns
result
:string
- miner status
Example
Request
Result
GetCoinbase
This method is used to obtain the node coinbase.
Type
Template
RPC
{"jsonrpc":"2.0","method":"miner_getCoinbase","params":[],"id":2}
Parameters
none
Returns
result
:string
- coinbase
Example
Request
Result
GetTarget
This method is used to obtain current SPOW mining difficulty.
Type
Template
RPC
{"jsonrpc":"2.0","method":"miner_getTarget","params":[],"id":2}
Parameters
none
Returns
result
:string
- current SPOW mining difficulty
Example
Request
Result
GetWork
This method return miner current mining task.
Type
Template
RPC
{"jsonrpc":"2.0","method":"miner_getWork","params":[],"id":2}
Parameters
threads
:int
- miner threads
Returns
result
:bool
- SetThreads result
Example
Request
Result
SetThreads
This method is used to set the threads of miner consensus.
Type
Template
RPC
{"jsonrpc":"2.0","method":"miner_setThreads","params":[],"id":2}
Parameters
threads
:int
- miner threads
Returns
result
:bool
- SetThreads result
Example
Request
Result
SetCoinbase
This method is used to set the coinbase
Type
Template
RPC
{"jsonrpc":"2.0","method":"miner_setCoinbase","params":["string"],"id":2}
Parameters
coinbase
:string
coinbase of the miner
Returns
result
:bool
- SetCoinbase result
Example
Request
Result
GetThreads
This method is used to get the threads of miner consensus.
Type
Template
RPC
{"jsonrpc":"2.0","method":"miner_getThreads","params":[],"id":2}
Parameters
none
Returns
result
:int
- miner threads
Example
Request
Result
debug
RPC collection provided for internal debugging.
PrintBlock
This method is used to print block information in dump format based on block height.
Type
Template
RPC
{"jsonrpc":"2.0","method":"debug_printBlock","params":[int64],"id":2}
Parameters
height
:int64
- block height
Returns
HeaderHash
:string
- block header hashHeader
:json
- block headerPreviousBlockHash
:string
- previous block hashCreator
:string
- block creatorStateHash
:string
- state hashTxHash
:string
- transactions hashReceiptHash
:string
- receipts hashTxDebtHash
:string
- transaction debts hashDebtHash
:string
- debts hashDifficulty
:big.Int
- block tdHeight
:uint64
- block heightCreateTimestamp
:big.Int
- create timestampWitness
:string
- block nonceConsensus
:int
- 0 for POW consensusExtraData
:string
- extra data
Transactions
:array
- transactions on blockHash
:string
- transaction hashData
:string
- transaction dataType
:int
- transaction type, 0 for regular type, 1 for reward typeFrom
:string
- amount senderTo
:string
- amount receiverAmount
:int64
- transaction amountAccountNonce
:int64
- account nonceGasPrice
:int64
- transaction gas priceGasLimit
:int64
- maximum gas for contract creation/executionTimestamp
:int64
- transaction timestampPayload
:string
- payloadSignature
:json
- transaction signature jsonSig
:string
- transaction sig
Debts
:array
- dump format of block informationHash
:string
- debts hashData
:json
- debts dataTxHash
:string
- txhash in debtFrom
:string
- sender addressNonce
:int64
- sender nonceAccount
:string
- debt accountAmount
:int64
- debt amountPrice
:int64
- debt gas priceCode
:string
- debt code
Example
Request
Result
DumpHeap
This method dump heap for profiling and returns the file path.
Type
Template
RPC
{"jsonrpc":"2.0","method":"debug_dumpHeap","params":[],"id":2}
Parameters
none
Returns
result
:string
file path
Example
Request
Result
GetTPS
This method returns TPS of seele node.
Type
Template
RPC
{"jsonrpc":"2.0","method":"debug_getTPS","params":[],"id":2}
Parameters
none
Returns
StartHeight
:int64
start heightEndHeight
:int64
end heightCount
:int
tpsDuration
:int
elapsed time from start height to end height
Example
Request
Result
monitor
node monitor.
NodeInfo
This method returns the node information of the node
Type
Template
RPC
{"jsonrpc":"2.0","method":"monitor_nodeInfo","params":[],"id":1}
Parameters
none
Returns
name
:string
monitor namenode
:string
node nameport
:int
portnetVersion
:string
node network versionprotocol
:string
node network protocolapi
:string
monitor apios
:string
system osos_v
:string
system os architectureclient
:string
client versioncanUpdateHistory
:bool
can update history?shard
:int
shard number
Example
Request
Result
NodeStats
This method returns the information of the node
Type
Template
RPC
{"jsonrpc":"2.0","method":"monitor_nodeStats","params":[],"id":1}
Parameters
none
Returns
active
:string
is node active?syncing
:string
is node syncing?mining
:int
is node mining?peers
:string
node peers number
Example
Request
Result
Last updated