Search…
Daemon RPC Guide

Introducton

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.

RPC Methods

COMMAND_RPC_GET_HEIGHT

Get the node's current height.
Endpoints: /get_height, /getheight
Example Request:
1
curl -X POST http://127.0.0.1:22023/get_height -d '{ }' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"height": 234767,
3
"status": "OK",
4
"untrusted": false
5
}
Copied!
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 trusted true, or otherwise false.

COMMAND_RPC_GET_BLOCKS_FAST

Get all blocks info. Binary request.
Endpoints: /get_blocks.bin, /getblocks.bin
Example Request:
1
curl -X POST http://127.0.0.1:22023/get_blocks.bin -d '
2
{
3
"block_ids": ["bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70", ...],
4
"start_height": 123,
5
"prune": true,
6
"no_miner_tx": true
7
}' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"blocks": [{
3
"block": "sd2b5f838e8cc7774d92f5a6ce0d72cb9bd8db2ef28948087f8a50ff46d188dd9",
4
"txs": ["sd2b5f838e8cc7774d92f5a6ce0d72cb9bd8db2ef28948087f8a50ff46d188dd9", ...]
5
}, ...],
6
"start_height": 123,
7
"current_height": 123,
8
"status": "OK",
9
"output_indices": [{
10
"indices": [{
11
"indices": [123, ...]
12
}, ...]
13
}, ...],
14
"untrusted": false
15
}
Copied!
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.
  • 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 entries
    • block - 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).

COMMAND_RPC_GET_BLOCKS_BY_HEIGHT

Get blocks by height. Binary request.
Endpoints: /get_blocks_by_height.bin, /getblocks_by_height.bin
Example Request:
1
curl -X POST http://127.0.0.1:22023/get_blocks_by_height.bin -d '
2
{
3
"heights": [123, ...]
4
}' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"blocks": [{
3
"block": "sd2b5f838e8cc7774d92f5a6ce0d72cb9bd8db2ef28948087f8a50ff46d188dd9",
4
"txs": ["sd2b5f838e8cc7774d92f5a6ce0d72cb9bd8db2ef28948087f8a50ff46d188dd9", ...]
5
}, ...],
6
"status": "OK",
7
"untrusted": false
8
}
Copied!
Inputs:
  • heights - uint64[]: List of block heights
Outputs:
  • blocks - block_complete_entry[]: Array of block complete entries
    • block - 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).

COMMAND_RPC_GET_ALT_BLOCKS_HASHES

Get the known blocks hashes which are not on the main chain.
Endpoints: /get_alt_blocks_hashes
Example Request:
1
curl -X POST http://127.0.0.1:22023/get_alt_blocks_hashes -d '{ }' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"blks_hashes": ["bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70", ...],
3
"status": "OK",
4
"untrusted": false
5
}
Copied!
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).

COMMAND_RPC_GET_HASHES_FAST

Get hashes. Binary request.
Endpoints: /get_hashes.bin, /gethashes.bin
Example Request:
1
curl -X POST http://127.0.0.1:22023/get_hashes.bin -d '
2
{
3
"block_ids": ["bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70", ...],
4
"start_height": 123
5
}' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"m_block_ids": ["bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70", ...],
3
"start_height": 123,
4
"current_height": 123,
5
"status": "OK",
6
"untrusted": false
7
}
Copied!
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).

COMMAND_RPC_GET_ADDRESS_TXS

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 only
  • scanned_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

COMMAND_RPC_GET_ADDRESS_INFO

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

COMMAND_RPC_GET_UNSPENT_OUTS

TODO: Undocumented light wallet RPC call
Inputs:
  • amount - string
  • address - string
  • view_key - string: OpenMonero specific
  • mixin - 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

COMMAND_RPC_GET_RANDOM_OUTS

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

COMMAND_RPC_SUBMIT_RAW_TX

TODO: Undocumented light wallet RPC call
Inputs:
  • address - string
  • view_key - string
  • tx - string
Outputs:
  • status - string
  • error - string

COMMAND_RPC_LOGIN

TODO: Undocumented light wallet RPC call
Inputs:
  • address - string
  • view_key - string
  • create_account - bool
Outputs:
  • status - string
  • reason - string
  • new_address - bool

COMMAND_RPC_IMPORT_WALLET_REQUEST

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

COMMAND_RPC_GET_TRANSACTIONS

Look up one or more transactions by hash.
Endpoints: /get_transactions, /gettransactions
Example Request:
1
curl -X POST http://127.0.0.1:22023/get_transactions -d '
2
{
3
"txs_hashes": ["b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123", ...],
4
"decode_as_json": true,
5
"prune": true,
6
"split": true
7
}' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"txs_as_hex": ["TODO(beldex): Write example string", ...],
3
"txs_as_json": ["TODO(beldex): Write example string", ...],
4
"missed_tx": ["b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123", ...],
5
"txs": [{
6
"tx_hash": "b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123",
7
"as_hex": "TODO(beldex): Write example string",
8
"pruned_as_hex": "TODO(beldex): Write example string",
9
"prunable_as_hex": "TODO(beldex): Write example string",
10
"prunable_hash": "b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123",
11
"as_json": "TODO(beldex): Write example string",
12
"in_pool": true,
13
"double_spend_seen": true,
14
"block_height": 123,
15
"block_timestamp": 123,
16
"output_indices": [123, ...]
17
}, ...],
18
"status": "OK",
19
"untrusted": false
20
}
Copied!
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).

COMMAND_RPC_IS_KEY_IMAGE_SPENT

Check if outputs have been spent using the key image associated with the output.
Endpoints: /is_key_image_spent
Example Request:
1
curl -X POST http://127.0.0.1:22023/is_key_image_spent -d '
2
{
3
"key_images": ["TODO(beldex): Write example string", ...]
4
}' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"spent_status": [0, 1, ...],
3
"status": "OK",
4
"untrusted": false
5
}
Copied!
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 pool
  • 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).

COMMAND_RPC_GET_TX_GLOBAL_OUTPUTS_INDEXES

Get global outputs of transactions. Binary request.
Endpoints: /get_o_indexes.bin
Example Request:
1
curl -X POST http://127.0.0.1:22023/get_o_indexes.bin -d '
2
{
3
"txid": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70"
4
}' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"o_indexes": [123, ...],
3
"status": "OK",
4
"untrusted": false
5
}
Copied!
Inputs:
  • txid - string[64]: Binary txid.
Outputs:
  • o_indexes - uint64[]: List of output 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).

COMMAND_RPC_GET_OUTPUTS_BIN

Get outputs. Binary request.
Endpoints: /get_outs.bin
Example Request:
1
curl -X POST http://127.0.0.1:22023/get_outs.bin -d '
2
{
3
"outputs": [{
4
"amount": 123,
5
"index": 123
6
}, ...],
7
"get_txid": true
8
}' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"outs": [{
3
"key": ,
4
"mask": ,
5
"unlocked": true,
6
"height": 234767,
7
"txid": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70"
8
}, ...],
9
"status": "OK",
10
"untrusted": false
11
}
Copied!
Inputs:
  • outputs - get_outputs_out[]: Array of structure get_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).

COMMAND_RPC_GET_OUTPUTS

Endpoints: /get_outs
Example Request:
1
curl -X POST http://127.0.0.1:22023/get_outs -d '
2
{
3
"outputs": [{
4
"amount": 123,
5
"index": 123
6
}, ...]
7
}' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"outs": [{
3
"key": "TODO(beldex): Write example string",
4
"mask": "TODO(beldex): Write example string",
5
"unlocked": true,
6
"height": 234767,
7
"txid": "b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123"
8
}, ...],
9
"status": "OK",
10
"untrusted": false
11
}
Copied!
Inputs:
  • outputs - get_outputs_out[]: Array of structure get_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).

COMMAND_RPC_SEND_RAW_TX

Broadcast a raw transaction to the network.
Endpoints: /send_raw_transaction, /sendrawtransaction
Example Request:
1
curl -X POST http://127.0.0.1:22023/send_raw_transaction -d '
2
{
3
"tx_as_hex": "TODO(beldex): Write example string",
4
"do_not_relay": true
5
}' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"status": "OK",
3
"reason": "TODO(beldex): Write example string",
4
"not_relayed": true,
5
"untrusted": false,
6
"tvc":
7
}
Copied!
Inputs:
  • tx_as_hex - string: Full transaction information as hexidecimal string.
  • do_not_relay - bool: Stop relaying transaction to other nodes (default is false).
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

COMMAND_RPC_START_MINING

Start mining on the daemon.
Endpoints: /start_mining
Example Request:
1
curl -X POST http://127.0.0.1:22023/start_mining -d '
2
{
3
"miner_address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk",
4
"threads_count": 123,
5
"do_background_mining": true,
6
"ignore_battery": true
7
}' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"status": "OK"
3
}
Copied!
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.

COMMAND_RPC_GET_INFO

Retrieve general information about the state of your node and the network.
Endpoints: /get_info, /getinfo, get_info
Example Request:
1
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'
Copied!
Example Response:
1
{
2
"status": "OK",
3
"height": 234767,
4
"target_height": 123,
5
"difficulty": 123,
6
"target": 123,
7
"tx_count": 123,
8
"tx_pool_size": 123,
9
"alt_blocks_count": 123,
10
"outgoing_connections_count": 123,
11
"incoming_connections_count": 123,
12
"rpc_connections_count": 123,
13
"white_peerlist_size": 123,
14
"grey_peerlist_size": 123,
15
"mainnet": true,
16
"testnet": true,
17
"stagenet": true,
18
"nettype": "MAINNET",
19
"top_block_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
20
"cumulative_difficulty": 123,
21
"block_size_limit": 123,
22
"block_weight_limit": 123,
23
"block_size_median": 123,
24
"block_weight_median": 123,
25
"start_time": 123,
26
"free_space": 123,
27
"offline": true,
28
"untrusted": false,
29
"bootstrap_daemon_address": "127.0.0.1:22023",
30
"height_without_bootstrap": 123,
31
"was_bootstrap_ever_used": true,
32
"database_size": 123,
33
"update_available": true,
34
"version": "TODO(beldex): Write example string"
35
}
Copied!
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 Size
  • grey_peerlist_size - uint64: Grey Peerlist Size
  • mainnet - 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.

COMMAND_RPC_GET_ALL_MASTER_NODES_KEYS

Retrieve all Master Node Keys.
Endpoints: get_all_master_nodes_keys
Example Request:
1
curl -X POST http://127.0.0.1:22023/json_rpc -d '
2
{
3
"jsonrpc":"2.0", "id":"0", "method":"get_all_master_nodes_keys",
4
"params": {
5
"fully_funded_nodes_only": true
6
}
7
}' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"keys": ["TODO(beldex): Write example string", ...]
3
}
Copied!
Inputs:
  • fully_funded_nodes_only - bool: Return keys for master nodes if they are funded and working on the network
Outputs:
  • keys - string[]: Returns as base32z of the hex key, for Beldex network internal usage

COMMAND_RPC_STOP_MINING

Stop mining on the daemon.
Endpoints: /stop_mining
Example Request:
1
curl -X POST http://127.0.0.1:22023/stop_mining -d '{ }' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"status": "OK"
3
}
Copied!
Inputs:
Outputs:
  • status - string: General RPC error code. "OK" means everything looks good. Any other value means that something went wrong.

COMMAND_RPC_MINING_STATUS

Get the mining status of the daemon.
Endpoints: /mining_status
Example Request:
1
curl -X POST http://127.0.0.1:22023/mining_status -d '{ }' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"status": "OK",
3
"active": true,
4
"speed": 123,
5
"threads_count": 8,
6
"address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk",
7
"is_background_mining_enabled": true
8
}
Copied!
Inputs:
Outputs:
  • status - string: General RPC error code. "OK" means everything looks good. Any other value means that something went wrong.
  • active - bool: States if mining is enabled (true) or disabled (false).
  • speed - uint64: Mining power in hashes per seconds.
  • threads_count - uint32: Number of running mining threads.
  • address - string: Account address daemon is mining to. Empty if not mining.
  • is_background_mining_enabled - bool: States if the mining is running in background (true) or foreground (false).

COMMAND_RPC_SAVE_BC

Save the blockchain. The blockchain does not need saving and is always saved when modified,
however it does a sync to flush the filesystem cache onto the disk for safety purposes against Operating System or Hardware crashes.
Endpoints: /save_bc
Example Request:
1
curl -X POST http://127.0.0.1:22023/save_bc -d '{ }' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"status": "OK"
3
}
Copied!
Inputs:
Outputs:
  • status - string: General RPC error code. "OK" means everything looks good. Any other value means that something went wrong.

COMMAND_RPC_GETBLOCKCOUNT

Look up how many blocks are in the longest chain known to the node.
Endpoints: get_block_count, getblockcount
Example Request:
1
curl -X POST http://127.0.0.1:22023/json_rpc -d '
2
{
3
"jsonrpc":"2.0", "id":"0", "method":"getblockcount",
4
"params": {
5
"request": ["TODO(beldex): Write example string", ...]
6
}
7
}' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"count": 123,
3
"status": "OK"
4
}
Copied!
Inputs:
  • request - string[]
Outputs:
  • count - uint64: Number of blocks in longest chain seen by the node.
  • status - string: General RPC error code. "OK" means everything looks good.

COMMAND_RPC_GETBLOCKHASH

Look up a block's hash by its height.
Endpoints: on_get_block_hash, on_getblockhash
Example Request:
1
curl -X POST http://127.0.0.1:22023/json_rpc -d '
2
{
3
"jsonrpc":"2.0", "id":"0", "method":"on_getblockhash",
4
"params": {
5
"request": [123, ...]
6
}
7
}' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"response": "TODO(beldex): Write example string"
3
}
Copied!
Inputs:
  • request - uint64[]: Block height (int array of length 1).
Outputs:
  • response - string: Block hash (string).

COMMAND_RPC_GETBLOCKTEMPLATE

Get a block template on which mining a new block.
Endpoints: get_block_template, getblocktemplate
Example Request:
1
curl -X POST http://127.0.0.1:22023/json_rpc -d '
2
{
3
"jsonrpc":"2.0", "id":"0", "method":"getblocktemplate",
4
"params": {
5
"reserve_size": 123,
6
"wallet_address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk"
7
}
8
}' -H 'Content-Type: application/json'
Copied!
Example Response:
1
{
2
"difficulty": 123,
3
"height": 234767,
4
"reserved_offset": 123,
5
"expected_reward": 123,
6
"prev_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
7
"blocktemplate_blob": "sd2b5f838e8cc7774d92f5a6ce0d72cb9bd8db2ef28948087f8a50ff46d188dd9",
8
"blockhashing_blob": "sd2b5f838e8cc7774d92f5a6ce0d72cb9bd8db2ef28948087f8a50ff46d188dd9",
9
"status": "OK",
10
"untrusted": false
11
}
Copied!
Inputs:
  • reserve_size - uint64: Max 255 bytes
  • wallet_address - string: Address of wallet to receive coinbase transactions if block is successfully mined.
Outputs:
  • difficulty - uint64: Difficulty of next block.
  • height - uint64: Height on which to mine.
  • reserved_offset - uint64: Reserved offset.
  • expected_reward - uint64: Coinbase reward expected to be received if block is successfully mined.
  • prev_hash - string: Hash of the most recent block on which to mine the next block.
  • blocktemplate_blob - string: Blob on which to try to mine a new block.
  • blockhashing_blob - string: Blob on which to try to find a valid nonce.
  • 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).

COMMAND_RPC_SUBMITBLOCK

Submit a mined block to the network.
Endpoints: submit_block, submitblock
Example Request:
1
curl -X POST http://127.0.0.1:22023/json_rpc -d '
2
{