Daemon RPC Guide
This is a list of the RPC calls, their inputs and outputs, and examples of each.
Many RPC calls use the JSON RPC interface while others use their own interfaces, as demonstrated below.
Note: "atomic units" refer to the smallest fraction of 1 BELDEX which is 1e9 atomic units.
Get the node's current height.
Endpoints: /get_height, /getheight
Example Request:
curl -X POST http://127.0.0.1:22023/get_height -d '{ }' -H 'Content-Type: application/json'
Example Response:
{
"height": 234767,
"status": "OK",
"untrusted": false
}
Inputs:
Outputs:
height - uint64
: The current blockchain height according to the queried daemon.status - string
: Generic RPC error code. "OK" is the success value.untrusted - bool
: If the result is obtained using bootstrap mode, and therefore not trustedtrue
, or otherwisefalse
.
Get all blocks info. Binary request.
Endpoints: /get_blocks.bin, /getblocks.bin
Example Request:
curl -X POST http://127.0.0.1:22023/get_blocks.bin -d '
{
"block_ids": ["bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70", ...],
"start_height": 123,
"prune": true,
"no_miner_tx": true
}' -H 'Content-Type: application/json'
Example Response:
{
"blocks": [{
"block": "sd2b5f838e8cc7774d92f5a6ce0d72cb9bd8db2ef28948087f8a50ff46d188dd9",
"txs": ["sd2b5f838e8cc7774d92f5a6ce0d72cb9bd8db2ef28948087f8a50ff46d188dd9", ...]
}, ...],
"start_height": 123,
"current_height": 123,
"status": "OK",
"output_indices": [{
"indices": [{
"indices": [123, ...]
}, ...]
}, ...],
"untrusted": false
}
Inputs:
block_ids - string[64][]
: First 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis blockstart_height - uint64
: The starting block's height.prune - bool
: Prunes the blockchain, drops off 7/8 off the block iirc.no_miner_tx - bool
: Optional (false by default).
Outputs:
blocks - block_complete_entry[]
: Array of block complete entriesblock - string
txs - string[]
start_height - uint64
: The starting block's height.current_height - uint64
: The current block height.status - string
: General RPC error code. "OK" means everything looks good.output_indices - block_output_indices[]
: Array of indices.indices - tx_output_indices[]
: Array of TX output indices:indices - uint64[]
: Array of unsigned int.
untrusted - bool
: States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Get blocks by height. Binary request.
Endpoints: /get_blocks_by_height.bin, /getblocks_by_height.bin
Example Request:
curl -X POST http://127.0.0.1:22023/get_blocks_by_height.bin -d '
{
"heights": [123, ...]
}' -H 'Content-Type: application/json'
Example Response:
{
"blocks": [{
"block": "sd2b5f838e8cc7774d92f5a6ce0d72cb9bd8db2ef28948087f8a50ff46d188dd9",
"txs": ["sd2b5f838e8cc7774d92f5a6ce0d72cb9bd8db2ef28948087f8a50ff46d188dd9", ...]
}, ...],
"status": "OK",
"untrusted": false
}
Inputs:
heights - uint64[]
: List of block heights
Outputs:
blocks - block_complete_entry[]
: Array of block complete entriesblock - string
txs - string[]
status - string
: General RPC error code. "OK" means everything looks good.untrusted - bool
: States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Get the known blocks hashes which are not on the main chain.
Endpoints: /get_alt_blocks_hashes
Example Request:
curl -X POST http://127.0.0.1:22023/get_alt_blocks_hashes -d '{ }' -H 'Content-Type: application/json'
Example Response:
{
"blks_hashes": ["bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70", ...],
"status": "OK",
"untrusted": false
}
Inputs:
Outputs:
blks_hashes - string[]
: List of alternative blocks hashes to main chain.status - string
: General RPC error code. "OK" means everything looks good.untrusted - bool
: States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Get hashes. Binary request.
Endpoints: /get_hashes.bin, /gethashes.bin
Example Request:
curl -X POST http://127.0.0.1:22023/get_hashes.bin -d '
{
"block_ids": ["bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70", ...],
"start_height": 123
}' -H 'Content-Type: application/json'
Example Response:
{
"m_block_ids": ["bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70", ...],
"start_height": 123,
"current_height": 123,
"status": "OK",
"untrusted": false
}
Inputs:
block_ids - string[64][]
: First 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block */start_height - uint64
: The starting block's height.
Outputs:
m_block_ids - string[64][]
: Binary array of hashes, See block_ids above.start_height - uint64
: The starting block's height.current_height - uint64
: The current block height.status - string
: General RPC error code. "OK" means everything looks good.untrusted - bool
: States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
TODO: Undocumented light wallet RPC call
Inputs:
address - string
: Address of wallet to receive tx information.view_key - string
: View key of Address.
Outputs:
total_received - uint64
: Total Beldex received in atomic units.total_received_unlocked - uint64
: OpenMonero onlyscanned_height - uint64
transactions - transaction[]
id - uint64
: The transaction identifier.hash - string
: The hash of this transaction.timestamp - uint64
: The unix time at which the block was recorded into the blockchain.total_received - uint64
: Total Beldex received in atomic units.total_sent - uint64
: Total beldex sent in atomic units.unlock_time - uint64
: Unlock time in blocks.height - uint64
: Block height transaction was made.spent_outputs - spent_output[]
: List of spent outputs.amount - uint64
: Amount transferred.key_image - string
: Unique cryptographic key associated with output.tx_pub_key - string
: Pubkey associated with transaction.out_index - uint64
: Index for transaction.mixin - uint32
: The number of other signatures (aside from yours) in the ring signature that authorises the transaction.
payment_id - string
: The payment ID of the transaction.coinbase - bool
: States if the transaction is a coinbase transaction.true
if the transaction is coinbase,false
if not.mempool - bool
: States if the transaction is sitting in the mempool.true if the transaction is,
false` if not.mixin - uint32
: The number of other signatures (aside from yours) in the ring signature that authorises the transaction.
blockchain_height - uint64
scanned_block_height - uint64
status - string
TODO: Undocumented light wallet RPC call
Inputs:
address - string
view_key - string
Outputs:
locked_funds - uint64
total_received - uint64
total_sent - uint64
scanned_height - uint64
scanned_block_height - uint64
start_height - uint64
transaction_height - uint64
blockchain_height - uint64
spent_outputs - spent_output[]
amount - uint64
key_image - string
tx_pub_key - string
out_index - uint64
mixin - uint32
TODO: Undocumented light wallet RPC call
Inputs:
amount - string
address - string
view_key - string
: OpenMonero specificmixin - uint64
use_dust - bool
dust_threshold - string
Outputs:
amount - uint64
outputs - output[]
amount - uint64
public_key - string
index - uint64
global_index - uint64
rct - string
tx_hash - string
tx_pub_key - string
tx_prefix_hash - string
spend_key_images - string[]
timestamp - uint64
height - uint64
per_kb_fee - uint64
status - string
reason - string
TODO: Undocumented light wallet RPC call
Inputs:
amounts - string[]
count - uint32
Outputs:
amount_outs - amount_out[]
amount - uint64
outputs - output[]
public_key - string
global_index - uint64
rct - string
: 64+64+64 characters long ( + + )
Error - string
TODO: Undocumented light wallet RPC call
Inputs:
address - string
view_key - string
tx - string
Outputs:
status - string
error - string
TODO: Undocumented light wallet RPC call
Inputs:
address - string
view_key - string
create_account - bool
Outputs:
status - string
reason - string
new_address - bool
TODO: Undocumented light wallet RPC call
Inputs:
address - string
view_key - string
Outputs:
payment_id - string
import_fee - uint64
new_request - bool
request_fulfilled - bool
payment_address - string
status - string
Look up one or more transactions by hash.
Endpoints: /get_transactions, /gettransactions
Example Request:
curl -X POST http://127.0.0.1:22023/get_transactions -d '
{
"txs_hashes": ["b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123", ...],
"decode_as_json": true,
"prune": true,
"split": true
}' -H 'Content-Type: application/json'
Example Response:
{
"txs_as_hex": ["TODO(beldex): Write example string", ...],
"txs_as_json": ["TODO(beldex): Write example string", ...],
"missed_tx": ["b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123", ...],
"txs": [{
"tx_hash": "b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123",
"as_hex": "TODO(beldex): Write example string",
"pruned_as_hex": "TODO(beldex): Write example string",
"prunable_as_hex": "TODO(beldex): Write example string",
"prunable_hash": "b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123",
"as_json": "TODO(beldex): Write example string",
"in_pool": true,
"double_spend_seen": true,
"block_height": 123,
"block_timestamp": 123,
"output_indices": [123, ...]
}, ...],
"status": "OK",
"untrusted": false
}
Inputs:
txs_hashes - string[]
: List of transaction hashes to look up.decode_as_json - bool
: Optional (false
by default). If set true, the returned transaction information will be decoded rather than binary.prune - bool
: Prunes the blockchain, drops off 7/8 off the block iirc. Optional (False
by default).split - bool
: Optional (false
by default).
Outputs:
txs_as_hex - string[]
: Full transaction information as a hex string (old compatibility parameter)txs_as_json - string[]
: Transactions decoded as json (old compat)missed_tx - string[]
: (Optional - returned if not empty) Transaction hashes that could not be found.txs - entry[]
: Array of structure entry as follows:tx_hash - string
: Transaction hash.as_hex - string
: Full transaction information as a hex string.pruned_as_hex - string
prunable_as_hex - string
prunable_hash - string
as_json - string
: List of transaction info.in_pool - bool
: States if the transaction is in pool (true
) or included in a block (false
).double_spend_seen - bool
: States if the transaction is a double-spend (true
) or not (false
).block_height - uint64
: Block height including the transaction.block_timestamp - uint64
: Unix time at chich the block has been added to the blockchain.output_indices - uint64[]
: List of transaction indexes.
status - string
: General RPC error code. "OK" means everything looks good.untrusted - bool
: States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Check if outputs have been spent using the key image associated with the output.
Endpoints: /is_key_image_spent
Example Request:
curl -X POST http://127.0.0.1:22023/is_key_image_spent -d '
{
"key_images": ["TODO(beldex): Write example string", ...]
}' -H 'Content-Type: application/json'
Example Response:
{
"spent_status": [0, 1, ...],
"status": "OK",
"untrusted": false
}
Inputs:
key_images - string[]
: List of key image hex strings to check.
Outputs:
spent_status - int[]
: List of statuses for each image checked. Statuses are follows: 0 = unspent, 1 = spent in blockchain, 2 = spent in transaction poolstatus - string
: General RPC error code. "OK" means everything looks good.untrusted - bool
: States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Get global outputs of transactions. Binary request.
Endpoints: /get_o_indexes.bin
Example Request:
curl -X POST http://127.0.0.1:22023/get_o_indexes.bin -d '
{
"txid": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70"
}' -H 'Content-Type: application/json'
Example Response:
{
"o_indexes": [123, ...],
"status": "OK",
"untrusted": false
}
Inputs:
txid - string[64]
: Binary txid.
Outputs:
o_indexes - uint64[]
: List of output indexesstatus - string
: General RPC error code. "OK" means everything looks good.untrusted - bool
: States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Get outputs. Binary request.
Endpoints: /get_outs.bin
Example Request:
curl -X POST http://127.0.0.1:22023/get_outs.bin -d '
{
"outputs": [{
"amount": 123,
"index": 123
}, ...],
"get_txid": true
}' -H 'Content-Type: application/json'
Example Response:
{
"outs": [{
"key": ,
"mask": ,
"unlocked": true,
"height": 234767,
"txid": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70"
}, ...],
"status": "OK",
"untrusted": false
}
Inputs:
outputs - get_outputs_out[]
: Array of structureget_outputs_out
.amount - uint64
: Amount of Beldex in TXID.index - uint64
get_txid - bool
: TXID
Outputs:
outs - outkey[]
: List of outkey information.key - crypto::public_key
: The public key of the output.mask - rct::key
unlocked - bool
: States if output is locked (false
) or not (true
).height - uint64
: Block height of the output.txid - string[64]
: Transaction id.
status - string
: General RPC error code. "OK" means everything looks good.untrusted - bool
: States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Endpoints: /get_outs
Example Request:
curl -X POST http://127.0.0.1:22023/get_outs -d '
{
"outputs": [{
"amount": 123,
"index": 123
}, ...]
}' -H 'Content-Type: application/json'
Example Response:
{
"outs": [{
"key": "TODO(beldex): Write example string",
"mask": "TODO(beldex): Write example string",
"unlocked": true,
"height": 234767,
"txid": "b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123"
}, ...],
"status": "OK",
"untrusted": false
}
Inputs:
outputs - get_outputs_out[]
: Array of structureget_outputs_out
.amount - uint64
: Amount of Beldex in TXID.index - uint64
Outputs:
outs - outkey[]
: List of outkey information.key - string
: The public key of the output.mask - string
unlocked - bool
: States if output is locked (false
) or not (true
).height - uint64
: Block height of the output.txid - string
: Transaction id.
status - string
: General RPC error code. "OK" means everything looks good.untrusted - bool
: States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).
Broadcast a raw transaction to the network.
Endpoints: /send_raw_transaction, /sendrawtransaction
Example Request:
curl -X POST http://127.0.0.1:22023/send_raw_transaction -d '
{
"tx_as_hex": "TODO(beldex): Write example string",
"do_not_relay": true
}' -H 'Content-Type: application/json'
Example Response:
{
"status": "OK",
"reason": "TODO(beldex): Write example string",
"not_relayed": true,
"untrusted": false,
"tvc":
}
Inputs:
tx_as_hex - string
: Full transaction information as hexidecimal string.do_not_relay - bool
: Stop relaying transaction to other nodes (default isfalse
).
Outputs:
status - string
: General RPC error code. "OK" means everything looks good. Any other value means that something went wrong.reason - string
: Additional information. Currently empty or "Not relayed" if transaction was accepted but not relayed.not_relayed - bool
: Transaction was not relayed (true) or relayed (false).untrusted - bool
: States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).tvc - tx_verification_context
Start mining on the daemon.
Endpoints: /start_mining
Example Request:
curl -X POST http://127.0.0.1:22023/start_mining -d '
{
"miner_address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk",
"threads_count": 123,
"do_background_mining": true,
"ignore_battery": true
}' -H 'Content-Type: application/json'
Example Response:
{
"status": "OK"
}
Inputs:
miner_address - string
: Account address to mine to.threads_count - uint64
: Number of mining thread to run.do_background_mining - bool
: States if the mining should run in background (true
) or foreground (false
).ignore_battery - bool
: States if battery state (on laptop) should be ignored (true
) or not (false
).
Outputs:
status - string
: General RPC error code. "OK" means everything looks good. Any other value means that something went wrong.
Retrieve general information about the state of your node and the network.
Endpoints: /get_info, /getinfo, get_info
Example Request:
curl -X POST http://127.0.0.1:22023/json_rpc -d '{ "jsonrpc":"2.0", "id":"0", "method":"get_info"}' -H 'Content-Type: application/json'
Example Response:
{
"status": "OK",
"height": 234767,
"target_height": 123,
"difficulty": 123,
"target": 123,
"tx_count": 123,
"tx_pool_size": 123,
"alt_blocks_count": 123,
"outgoing_connections_count": 123,
"incoming_connections_count": 123,
"rpc_connections_count": 123,
"white_peerlist_size": 123,
"grey_peerlist_size": 123,
"mainnet": true,
"testnet": true,
"stagenet": true,
"nettype": "MAINNET",
"top_block_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
"cumulative_difficulty": 123,
"block_size_limit": 123,
"block_weight_limit": 123,
"block_size_median": 123,
"block_weight_median": 123,
"start_time": 123,
"free_space": 123,
"offline": true,
"untrusted": false,
"bootstrap_daemon_address": "127.0.0.1:22023",
"height_without_bootstrap": 123,
"was_bootstrap_ever_used": true,
"database_size": 123,
"update_available": true,
"version": "TODO(beldex): Write example string"
}
Inputs:
Outputs:
status - string
: General RPC error code. "OK" means everything looks good.height - uint64
: Current length of longest chain known to daemon.target_height - uint64
: The height of the next block in the chain.difficulty - uint64
: Network difficulty (analogous to the strength of the network).target - uint64
: Current target for next proof of work.tx_count - uint64
: Total number of non-coinbase transaction in the chain.tx_pool_size - uint64
: Number of transactions that have been broadcast but not included in a block.alt_blocks_count - uint64
: Number of alternative blocks to main chain.outgoing_connections_count - uint64
: Number of peers that you are connected to and getting information from.incoming_connections_count - uint64
: Number of peers connected to and pulling from your node.rpc_connections_count - uint64
: Number of RPC client connected to the daemon (Including this RPC request).white_peerlist_size - uint64
: White Peerlist Sizegrey_peerlist_size - uint64
: Grey Peerlist Sizemainnet - bool
: States if the node is on the mainnet (true
) or not (false
).testnet - bool
: States if the node is on the testnet (true
) or not (false
).stagenet - bool
: States if the node is on the stagenet (true
) or not (false
).nettype - string
: Nettype value used.top_block_hash - string
: Hash of the highest block in the chain.cumulative_difficulty - uint64
: Cumulative difficulty of all blocks in the blockchain.block_size_limit - uint64
: Maximum allowed block size.block_weight_limit - uint64
: Maximum allowed block weight.block_size_median - uint64
: Median block size of latest 100 blocks.block_weight_median - uint64
: Median block weight of latest 100 blocks.start_time - uint64
: Start time of the daemon, as UNIX time.free_space - uint64
: Available disk space on the node.offline - bool
: States if the node is offline (true
) or online (false
).untrusted - bool
: States if the result is obtained using the bootstrap mode, and is therefore not trusted (true
), or when the daemon is fully synced (false
).bootstrap_daemon_address - string
: Bootstrap node to give immediate usability to wallets while syncing by proxying RPC to it. (Note: the replies may be untrustworthy).height_without_bootstrap - uint64
: Current length of the local chain of the daemon.was_bootstrap_ever_used - bool
: States if a bootstrap node has ever been used since the daemon started.database_size - uint64
: Current size of Blockchain data.update_available - bool
: States if a update is available ('true') and if one is not available ('false').version - string
: Current version of software running.
Retrieve all Master Node Keys.
Endpoints: get_all_master_nodes_keys
Example Request:
curl -X POST http://127.0.0.1:22023/json_rpc -d '
{
"jsonrpc":"2.0", "id":"0", "method":"get_all_master_nodes_keys",
"params": {
"fully_funded_nodes_only": true
}
}' -H 'Content-Type: application/json'
Example Response:
{
"keys": ["TODO(beldex): Write example string", ...]