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:

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 trusted true, or otherwise false.

COMMAND_RPC_GET_BLOCKS_FAST

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 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:

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 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:

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).

COMMAND_RPC_GET_HASHES_FAST

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).

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:

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).

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:

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 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:

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 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:

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 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:

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 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:

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 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:

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.

COMMAND_RPC_GET_INFO

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 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:

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", ...]
}

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:

curl -X POST http://127.0.0.1:22023/stop_mining -d '{ }' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK"
}

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:

curl -X POST http://127.0.0.1:22023/mining_status -d '{ }' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK",
  "active": true,
  "speed": 123,
  "threads_count": 8,
  "address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk",
  "is_background_mining_enabled": true
}

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:

curl -X POST http://127.0.0.1:22023/save_bc -d '{ }' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK"
}

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:

curl -X POST http://127.0.0.1:22023/json_rpc -d '
{
  "jsonrpc":"2.0", "id":"0", "method":"getblockcount",
  "params": {
    "request": ["TODO(beldex): Write example string", ...]
  }
}' -H 'Content-Type: application/json'

Example Response:

{
  "count": 123,
  "status": "OK"
}

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:

curl -X POST http://127.0.0.1:22023/json_rpc -d '
{
  "jsonrpc":"2.0", "id":"0", "method":"on_getblockhash",
  "params": {
    "request": [123, ...]
  }
}' -H 'Content-Type: application/json'

Example Response:

{
  "response": "TODO(beldex): Write example string"
}

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:

curl -X POST http://127.0.0.1:22023/json_rpc -d '
{
  "jsonrpc":"2.0", "id":"0", "method":"getblocktemplate",
  "params": {
    "reserve_size": 123,
    "wallet_address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk"
  }
}' -H 'Content-Type: application/json'

Example Response:

{
  "difficulty": 123,
  "height": 234767,
  "reserved_offset": 123,
  "expected_reward": 123,
  "prev_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
  "blocktemplate_blob": "sd2b5f838e8cc7774d92f5a6ce0d72cb9bd8db2ef28948087f8a50ff46d188dd9",
  "blockhashing_blob": "sd2b5f838e8cc7774d92f5a6ce0d72cb9bd8db2ef28948087f8a50ff46d188dd9",
  "status": "OK",
  "untrusted": false
}

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:

curl -X POST http://127.0.0.1:22023/json_rpc -d '
{
  "jsonrpc":"2.0", "id":"0", "method":"submitblock",
  "params": {
    "request": ["TODO(beldex): Write example string", ...]
  }
}' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK"
}

Inputs:

  • request - string[]: Block blob data - array of strings; list of block blobs which have been mined. See get_block_template to get a blob on which to mine.

Outputs:

  • status - string: Block submit status.

COMMAND_RPC_GENERATEBLOCKS

Developer only.

Endpoints: generateblocks

Example Request:

curl -X POST http://127.0.0.1:22023/json_rpc -d '
{
  "jsonrpc":"2.0", "id":"0", "method":"generateblocks",
  "params": {
    "amount_of_blocks": 123,
    "wallet_address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk"
  }
}' -H 'Content-Type: application/json'

Example Response:

{
  "height": 234767,
  "status": "OK"
}

Inputs:

  • amount_of_blocks - uint64

  • wallet_address - string

Outputs:

  • height - uint64

  • status - string: General RPC error code. "OK" means everything looks good.

COMMAND_RPC_GET_LAST_BLOCK_HEADER

Block header information for the most recent block is easily retrieved with this method. No inputs are needed.

Endpoints: get_last_block_header, getlastblockheader

Example Request:

curl -X POST http://127.0.0.1:22023/json_rpc -d '
{
  "jsonrpc":"2.0", "id":"0", "method":"getlastblockheader",
  "params": {
    "fill_pow_hash": true
  }
}' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK",
  "block_header": {
    "major_version": 11,
    "minor_version": 11,
    "timestamp": 123,
    "prev_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "nonce": 2130706433,
    "orphan_status": true,
    "height": 234767,
    "depth": 123,
    "hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "difficulty": 25179406071,
    "cumulative_difficulty": 25179406071,
    "reward": 123,
    "miner_reward": 123,
    "block_size": 123,
    "block_weight": 123,
    "num_txes": 123,
    "pow_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "long_term_weight": 123
  },
  "untrusted": false
}

Inputs:

  • fill_pow_hash - bool: Tell the daemon if it should fill out pow_hash field.

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.

  • block_header - block_header_response: A structure containing block header information.

    • major_version - uint8: The major version of the beldex protocol at this block height.

    • minor_version - uint8: The minor version of the beldex protocol at this block height.

    • timestamp - uint64: The unix time at which the block was recorded into the blockchain.

    • prev_hash - string: The hash of the block immediately preceding this block in the chain.

    • nonce - uint32: A cryptographic random one-time number used in mining a Beldex block.

    • orphan_status - bool: Usually false. If true, this block is not part of the longest chain.

    • height - uint64: The number of blocks preceding this block on the blockchain.

    • depth - uint64: The number of blocks succeeding this block on the blockchain. A larger number means an older block.

    • hash - string: The hash of this block.

    • difficulty - uint64: The strength of the Beldex network based on mining power.

    • cumulative_difficulty - uint64: The cumulative strength of the Beldex network based on mining power.

    • reward - uint64: The amount of new generated in this block and rewarded to the miner, foundation and master Nodes. Note: 1 BELDEX = 1e12 atomic units.

    • miner_reward - uint64: The amount of new generated in this block and rewarded to the miner. Note: 1 BELDEX = 1e12 atomic units.

    • block_size - uint64: The block size in bytes.

    • block_weight - uint64: The block weight in bytes.

    • num_txes - uint64: Number of transactions in the block, not counting the coinbase tx.

    • pow_hash - string: The hash of the block's proof of work.

    • long_term_weight - uint64: Long term weight of the block.

  • 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_BLOCK_HEADER_BY_HASH

Block header information can be retrieved using either a block's hash or height. This method includes a block's hash as an input parameter to retrieve basic information about the block.

Endpoints: get_block_header_by_hash, getblockheaderbyhash

Example Request:

curl -X POST http://127.0.0.1:22023/json_rpc -d '
{
  "jsonrpc":"2.0", "id":"0", "method":"getblockheaderbyhash",
  "params": {
    "hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "fill_pow_hash": true
  }
}' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK",
  "block_header": {
    "major_version": 11,
    "minor_version": 11,
    "timestamp": 123,
    "prev_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "nonce": 2130706433,
    "orphan_status": true,
    "height": 234767,
    "depth": 123,
    "hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "difficulty": 25179406071,
    "cumulative_difficulty": 25179406071,
    "reward": 123,
    "miner_reward": 123,
    "block_size": 123,
    "block_weight": 123,
    "num_txes": 123,
    "pow_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "long_term_weight": 123
  },
  "untrusted": false
}

Inputs:

  • hash - string: The block's SHA256 hash.

  • fill_pow_hash - bool: Tell the daemon if it should fill out pow_hash field.

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.

  • block_header - block_header_response: A structure containing block header information.

    • major_version - uint8: The major version of the beldex protocol at this block height.

    • minor_version - uint8: The minor version of the beldex protocol at this block height.

    • timestamp - uint64: The unix time at which the block was recorded into the blockchain.

    • prev_hash - string: The hash of the block immediately preceding this block in the chain.

    • nonce - uint32: A cryptographic random one-time number used in mining a Beldex block.

    • orphan_status - bool: Usually false. If true, this block is not part of the longest chain.

    • height - uint64: The number of blocks preceding this block on the blockchain.

    • depth - uint64: The number of blocks succeeding this block on the blockchain. A larger number means an older block.

    • hash - string: The hash of this block.

    • difficulty - uint64: The strength of the Beldex network based on mining power.

    • cumulative_difficulty - uint64: The cumulative strength of the Beldex network based on mining power.

    • reward - uint64: The amount of new generated in this block and rewarded to the miner, foundation and master Nodes. Note: 1 BELDEX = 1e12 atomic units.

    • miner_reward - uint64: The amount of new generated in this block and rewarded to the miner. Note: 1 BELDEX = 1e12 atomic units.

    • block_size - uint64: The block size in bytes.

    • block_weight - uint64: The block weight in bytes.

    • num_txes - uint64: Number of transactions in the block, not counting the coinbase tx.

    • pow_hash - string: The hash of the block's proof of work.

    • long_term_weight - uint64: Long term weight of the block.

  • 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_BLOCK_HEADER_BY_HEIGHT

Similar to get_block_header_by_hash above, this method includes a block's height as an input parameter to retrieve basic information about the block.

Endpoints: get_block_header_by_height, getblockheaderbyheight

Example Request:

curl -X POST http://127.0.0.1:22023/json_rpc -d '
{
  "jsonrpc":"2.0", "id":"0", "method":"getblockheaderbyheight",
  "params": {
    "height": 234767,
    "fill_pow_hash": true
  }
}' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK",
  "block_header": {
    "major_version": 11,
    "minor_version": 11,
    "timestamp": 123,
    "prev_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "nonce": 2130706433,
    "orphan_status": true,
    "height": 234767,
    "depth": 123,
    "hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "difficulty": 25179406071,
    "cumulative_difficulty": 25179406071,
    "reward": 123,
    "miner_reward": 123,
    "block_size": 123,
    "block_weight": 123,
    "num_txes": 123,
    "pow_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "long_term_weight": 123
  },
  "untrusted": false
}

Inputs:

  • height - uint64: The block's height.

  • fill_pow_hash - bool: Tell the daemon if it should fill out pow_hash field.

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.

  • block_header - block_header_response: A structure containing block header information.

    • major_version - uint8: The major version of the beldex protocol at this block height.

    • minor_version - uint8: The minor version of the beldex protocol at this block height.

    • timestamp - uint64: The unix time at which the block was recorded into the blockchain.

    • prev_hash - string: The hash of the block immediately preceding this block in the chain.

    • nonce - uint32: A cryptographic random one-time number used in mining a Beldex block.

    • orphan_status - bool: Usually false. If true, this block is not part of the longest chain.

    • height - uint64: The number of blocks preceding this block on the blockchain.

    • depth - uint64: The number of blocks succeeding this block on the blockchain. A larger number means an older block.

    • hash - string: The hash of this block.

    • difficulty - uint64: The strength of the Beldex network based on mining power.

    • cumulative_difficulty - uint64: The cumulative strength of the Beldex network based on mining power.

    • reward - uint64: The amount of new generated in this block and rewarded to the miner, foundation and master Nodes. Note: 1 BELDEX = 1e12 atomic units.

    • miner_reward - uint64: The amount of new generated in this block and rewarded to the miner. Note: 1 BELDEX = 1e12 atomic units.

    • block_size - uint64: The block size in bytes.

    • block_weight - uint64: The block weight in bytes.

    • num_txes - uint64: Number of transactions in the block, not counting the coinbase tx.

    • pow_hash - string: The hash of the block's proof of work.

    • long_term_weight - uint64: Long term weight of the block.

  • 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_BLOCK

Full block information can be retrieved by either block height or hash, like with the above block header calls.

For full block information, both lookups use the same method, but with different input parameters.

Endpoints: get_block, getblock

Example Request:

curl -X POST http://127.0.0.1:22023/json_rpc -d '
{
  "jsonrpc":"2.0", "id":"0", "method":"getblock",
  "params": {
    "hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "height": 234767,
    "fill_pow_hash": true
  }
}' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK",
  "block_header": {
    "major_version": 11,
    "minor_version": 11,
    "timestamp": 123,
    "prev_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "nonce": 2130706433,
    "orphan_status": true,
    "height": 234767,
    "depth": 123,
    "hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "difficulty": 25179406071,
    "cumulative_difficulty": 25179406071,
    "reward": 123,
    "miner_reward": 123,
    "block_size": 123,
    "block_weight": 123,
    "num_txes": 123,
    "pow_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "long_term_weight": 123
  },
  "miner_tx_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
  "tx_hashes": ["b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123", ...],
  "blob": "TODO(beldex): Write example string",
  "json": "TODO(beldex): Write example string",
  "untrusted": false
}

Inputs:

  • hash - string: The block's hash.

  • height - uint64: The block's height.

  • fill_pow_hash - bool: Tell the daemon if it should fill out pow_hash field.

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.

  • block_header - block_header_response: A structure containing block header information. See get_last_block_header.

    • major_version - uint8: The major version of the beldex protocol at this block height.

    • minor_version - uint8: The minor version of the beldex protocol at this block height.

    • timestamp - uint64: The unix time at which the block was recorded into the blockchain.

    • prev_hash - string: The hash of the block immediately preceding this block in the chain.

    • nonce - uint32: A cryptographic random one-time number used in mining a Beldex block.

    • orphan_status - bool: Usually false. If true, this block is not part of the longest chain.

    • height - uint64: The number of blocks preceding this block on the blockchain.

    • depth - uint64: The number of blocks succeeding this block on the blockchain. A larger number means an older block.

    • hash - string: The hash of this block.

    • difficulty - uint64: The strength of the Beldex network based on mining power.

    • cumulative_difficulty - uint64: The cumulative strength of the Beldex network based on mining power.

    • reward - uint64: The amount of new generated in this block and rewarded to the miner, foundation and master Nodes. Note: 1 BELDEX = 1e12 atomic units.

    • miner_reward - uint64: The amount of new generated in this block and rewarded to the miner. Note: 1 BELDEX = 1e12 atomic units.

    • block_size - uint64: The block size in bytes.

    • block_weight - uint64: The block weight in bytes.

    • num_txes - uint64: Number of transactions in the block, not counting the coinbase tx.

    • pow_hash - string: The hash of the block's proof of work.

    • long_term_weight - uint64: Long term weight of the block.

  • miner_tx_hash - string: Miner transaction information

  • tx_hashes - string[]: List of hashes of non-coinbase transactions in the block. If there are no other transactions, this will be an empty list.

  • blob - string: Hexadecimal blob of block information.

  • json - string: JSON formatted block details.

  • 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_SET_LOG_HASH_RATE

Set the log hash rate display mode.

Endpoints: /set_log_hash_rate

Example Request:

curl -X POST http://127.0.0.1:22023/set_log_hash_rate -d '
{
  "visible": true
}' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK"
}

Inputs:

  • visible - bool: States if hash rate logs should be visible (true) or hidden (false)

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good. Any other value means that something went wrong.

COMMAND_RPC_SET_LOG_LEVEL

Set the daemon log level. By default, log level is set to 0.

Endpoints: /set_log_level

Example Request:

curl -X POST http://127.0.0.1:22023/set_log_level -d '
{
  "level": 8
}' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK"
}

Inputs:

  • level - int8: Daemon log level to set from 0 (less verbose) to 4 (most verbose)

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good. Any other value means that something went wrong.

COMMAND_RPC_SET_LOG_CATEGORIES

Set the daemon log categories. Categories are represented as a comma separated list of <Category>:<level> (similarly to syslog standard <Facility>:<Severity-level>), where:

Category is one of the following: * (all facilities), default, net, net.http, net.p2p, logging, net.trottle, blockchain.db, blockchain.db.lmdb, bcutil, checkpoints, net.dns, net.dl,

i18n, perf,stacktrace, updates, account, cn ,difficulty, hardfork, miner, blockchain, txpool, cn.block_queue, net.cn, daemon, debugtools.deserialize, debugtools.objectsizes, device.ledger,

wallet.gen_multisig, multisig, bulletproofs, ringct, daemon.rpc, wallet.simplewallet, WalletAPI, wallet.ringdb, wallet.wallet2, wallet.rpc, tests.core.

Level is one of the following: FATAL - higher level, ERROR, WARNING, INFO, DEBUG, TRACE.

Lower level A level automatically includes higher level. By default, categories are set to:

*:WARNING,net:FATAL,net.p2p:FATAL,net.cn:FATAL,global:INFO,verify:FATAL,stacktrace:INFO,logging:INFO,msgwriter:INFO

Setting the categories to "" prevent any logs to be outputed.

Endpoints: /set_log_categories

Example Request:

curl -X POST http://127.0.0.1:22023/set_log_categories -d '
{
  "categories": "TODO(beldex): Write example string"
}' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK",
  "categories": "TODO(beldex): Write example string"
}

Inputs:

  • categories - string: Optional, daemon log categories to enable

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good. Any other value means that something went wrong.

  • categories - string: Daemon log enabled categories

COMMAND_RPC_GET_TRANSACTION_POOL

Show information about valid transactions seen by the node but not yet mined into a block,

as well as spent key image information for the txpool in the node's memory.

Endpoints: /get_transaction_pool

Example Request:

curl -X POST http://127.0.0.1:22023/get_transaction_pool -d '{ }' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK",
  "transactions": [{
      "id_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
      "tx_json": "TODO(beldex): Write example string",
      "blob_size": 123,
      "weight": 123,
      "fee": 123,
      "max_used_block_id_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
      "max_used_block_height": 123,
      "kept_by_block": true,
      "last_failed_height": 123,
      "last_failed_id_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
      "receive_time": 123,
      "relayed": true,
      "last_relayed_time": 123,
      "do_not_relay": true,
      "double_spend_seen": true,
      "tx_blob": "TODO(beldex): Write example string"
    }, ...],
  "spent_key_images": [{
      "id_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
      "txs_hashes": ["b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123", ...]
    }, ...],
  "untrusted": false
}

Inputs:

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.

  • transactions - tx_info[]: List of transactions in the mempool are not in a block on the main chain at the moment:

    • id_hash - string: The transaction ID hash.

    • tx_json - string: JSON structure of all information in the transaction

    • blob_size - uint64: The size of the full transaction blob.

    • weight - uint64: The weight of the transaction.

    • fee - uint64: The amount of the mining fee included in the transaction, in atomic units.

    • max_used_block_id_hash - string: Tells the hash of the most recent block with an output used in this transaction.

    • max_used_block_height - uint64: Tells the height of the most recent block with an output used in this transaction.

    • kept_by_block - bool: States if the tx was included in a block at least once (true) or not (false).

    • last_failed_height - uint64: If the transaction validation has previously failed, this tells at what height that occured.

    • last_failed_id_hash - string: Like the previous, this tells the previous transaction ID hash.

    • receive_time - uint64: The Unix time that the transaction was first seen on the network by the node.

    • relayed - bool: States if this transaction has been relayed

    • last_relayed_time - uint64: Last unix time at which the transaction has been relayed.

    • do_not_relay - bool: States if this transaction should not be relayed.

    • double_spend_seen - bool: States if this transaction has been seen as double spend.

    • tx_blob - string: Hexadecimal blob represnting the transaction.

  • spent_key_images - spent_key_image_info[]: List of spent output key images:

    • id_hash - string: Key image.

    • txs_hashes - string[]: List of tx hashes of the txes (usually one) spending that key image.

  • 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_TRANSACTION_POOL_HASHES_BIN

Get hashes from transaction pool. Binary request.

Endpoints: /get_transaction_pool_hashes.bin

Example Request:

curl -X POST http://127.0.0.1:22023/get_transaction_pool_hashes.bin -d '{ }' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK",
  "tx_hashes": ["bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70", ...],
  "untrusted": false
}

Inputs:

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.

  • tx_hashes - string[64][]: List of transaction hashes,

  • 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_TRANSACTION_POOL_HASHES

Get hashes from transaction pool.

Endpoints: /get_transaction_pool_hashes

Example Request:

curl -X POST http://127.0.0.1:22023/get_transaction_pool_hashes -d '{ }' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK",
  "tx_hashes": ["b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123", ...],
  "untrusted": false
}

Inputs:

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.

  • tx_hashes - string[]: List of transaction hashes,

  • 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_TRANSACTION_POOL_BACKLOG

Get all transaction pool backlog.

Endpoints: get_txpool_backlog

Example Request:

curl -X POST http://127.0.0.1:22023/json_rpc -d '{ "jsonrpc":"2.0", "id":"0", "method":"get_txpool_backlog"}' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK",
  "backlog": [{
      "weight": 123,
      "fee": 123,
      "time_in_pool": 123
    }, ...],
  "untrusted": false
}

Inputs:

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.

  • backlog - tx_backlog_entry[]: Array of structures tx_backlog_entry (in binary form):

    • weight - uint64

    • fee - uint64: Fee in Beldex measured in atomic units.

    • time_in_pool - uint64

  • 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_CONNECTIONS

Retrieve information about incoming and outgoing connections to your node.

Endpoints: get_connections

Example Request:

curl -X POST http://127.0.0.1:22023/json_rpc -d '{ "jsonrpc":"2.0", "id":"0", "method":"get_connections"}' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK",
  "connections": [, ...]
}

Inputs:

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.

  • connections - connection_info[]: List of all connections and their info:

COMMAND_RPC_GET_BLOCK_HEADERS_RANGE

Similar to get_block_header_by_height above, but for a range of blocks.

This method includes a starting block height and an ending block height as

parameters to retrieve basic information about the range of blocks.

Endpoints: get_block_headers_range, getblockheadersrange

Example Request:

curl -X POST http://127.0.0.1:22023/json_rpc -d '
{
  "jsonrpc":"2.0", "id":"0", "method":"getblockheadersrange",
  "params": {
    "start_height": 123,
    "end_height": 123,
    "fill_pow_hash": true
  }
}' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK",
  "headers": [{
      "major_version": 11,
      "minor_version": 11,
      "timestamp": 123,
      "prev_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
      "nonce": 2130706433,
      "orphan_status": true,
      "height": 234767,
      "depth": 123,
      "hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
      "difficulty": 25179406071,
      "cumulative_difficulty": 25179406071,
      "reward": 123,
      "miner_reward": 123,
      "block_size": 123,
      "block_weight": 123,
      "num_txes": 123,
      "pow_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
      "long_term_weight": 123
    }, ...],
  "untrusted": false
}

Inputs:

  • start_height - uint64: The starting block's height.

  • end_height - uint64: The ending block's height.

  • fill_pow_hash - bool: Tell the daemon if it should fill out pow_hash field.

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.

  • headers - block_header_response[]: Array of block_header (a structure containing block header information. See get_last_block_header).

    • major_version - uint8: The major version of the beldex protocol at this block height.

    • minor_version - uint8: The minor version of the beldex protocol at this block height.

    • timestamp - uint64: The unix time at which the block was recorded into the blockchain.

    • prev_hash - string: The hash of the block immediately preceding this block in the chain.

    • nonce - uint32: A cryptographic random one-time number used in mining a Beldex block.

    • orphan_status - bool: Usually false. If true, this block is not part of the longest chain.

    • height - uint64: The number of blocks preceding this block on the blockchain.

    • depth - uint64: The number of blocks succeeding this block on the blockchain. A larger number means an older block.

    • hash - string: The hash of this block.

    • difficulty - uint64: The strength of the Beldex network based on mining power.

    • cumulative_difficulty - uint64: The cumulative strength of the Beldex network based on mining power.

    • reward - uint64: The amount of new generated in this block and rewarded to the miner, foundation and master Nodes. Note: 1 BELDEX = 1e12 atomic units.

    • miner_reward - uint64: The amount of new generated in this block and rewarded to the miner. Note: 1 BELDEX = 1e12 atomic units.

    • block_size - uint64: The block size in bytes.

    • block_weight - uint64: The block weight in bytes.

    • num_txes - uint64: Number of transactions in the block, not counting the coinbase tx.

    • pow_hash - string: The hash of the block's proof of work.

    • long_term_weight - uint64: Long term weight of the block.

  • 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_STOP_DAEMON

Send a command to the daemon to safely disconnect and shut down.

Endpoints: /stop_daemon

Example Request:

curl -X POST http://127.0.0.1:22023/stop_daemon -d '{ }' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK"
}

Inputs:

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.

COMMAND_RPC_GET_LIMIT

Get daemon bandwidth limits.

Endpoints: /get_limit

Example Request:

curl -X POST http://127.0.0.1:22023/get_limit -d '{ }' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK",
  "limit_up": 123,
  "limit_down": 123,
  "untrusted": false
}

Inputs:

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.

  • limit_up - uint64: Upload limit in kBytes per second.

  • limit_down - uint64: Download limit in kBytes per second.

  • 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_SET_LIMIT

Set daemon bandwidth limits.

Endpoints: /set_limit

Example Request:

curl -X POST http://127.0.0.1:22023/set_limit -d '
{
  "limit_down": 8192,
  "limit_up": 8192
}' -H 'Content-Type: application/json'

Example Response:

{
  "status": "OK",
  "limit_up": 8192,
  "limit_down": 8192
}

Inputs:

  • limit_down - int64: Download limit in kBytes per second (-1 reset to default, 0 don't change the current limit)

  • limit_up - int64: Upload limit in kBytes per second (-1 reset to default, 0 don't change the current limit)

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.

  • limit_up - int64: Upload limit in kBytes per second.

  • limit_down - int64: Download limit in kBytes per second.

COMMAND_RPC_OUT_PEERS

Limit number of Outgoing peers.

Endpoints: /out_peers

Example Request:

curl -X POST http://127.0.0.1:22023/out_peers -d '
{
  "out_peers": 123
}' -H 'Content-Type: application/json'

Example Response: