Introduction

This is a list of the RPC calls, their inputs and outputs, and examples of each. This list is autogenerated and was last generated on: 2020-05-13

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 LOKI which is 1e9 atomic units.

JSON

Binary

JSON

BANNED

Back to top

Determine whether a given IP address is banned

Endpoints: banned

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "banned",
  "params": {
    "address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk"
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "banned": true,
    "seconds": 2130706433
  }
}

Inputs:

  • address - string: The IP address to check

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.
  • banned - bool: True if the given address is banned, false otherwise.
  • seconds - uint32: The number of seconds remaining in the ban.

FLUSH_TRANSACTION_POOL

Back to top

Flush tx ids from transaction pool..

Endpoints: flush_txpool

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "flush_txpool",
  "params": {
    "txids": ["b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123"]
  }
}
EOF

Inputs:

  • txids - string[]: Optional, list of transactions IDs to flush from pool (all tx ids flushed if empty).

GENERATEBLOCKS

Back to top

Developer only.

Endpoints: generateblocks

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "generateblocks",
  "params": {
    "amount_of_blocks": 123,
    "wallet_address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk",
    "prev_block": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "starting_nonce": 2130706433
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "height": 234767,
    "blocks": ["bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70"],
    "status": "OK"
  }
}

Inputs:

  • amount_of_blocks - uint64
  • wallet_address - string
  • prev_block - string
  • starting_nonce - uint32

Outputs:

  • height - uint64
  • blocks - string[]
  • status - string: General RPC error code. "OK" means everything looks good.

GETBANS

Back to top

Get list of banned IPs.

Endpoints: get_bans

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_bans"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "bans": [{
      "host": "127.0.0.1",
      "ip": 2130706433,
      "seconds": 2130706433
    }]
  }
}

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.
  • bans - ban[]: List of banned nodes:
  • host - string: Banned host (IP in A.B.C.D form).
  • ip - uint32: Banned IP address, in Int format.
  • seconds - uint32: Local Unix time that IP is banned until.

GETBLOCKCOUNT

Back to top

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 \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_block_count"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "count": 123,
    "status": "OK"
  }
}

Outputs:

  • count - uint64: Number of blocks in longest chain seen by the node.
  • status - string: General RPC error code. "OK" means everything looks good.

GETBLOCKHASH

Back to top

Look up a block's hash by its height.

Endpoints: get_block_hash, on_get_block_hash, on_getblockhash

Constants: 
 * `response - string`: Block hash (string).

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_block_hash",
  "params": {
    "height": [234767]
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": "061e5b4734c5e338c1d2a25acb007d806725e51cdb2aa8aac17101afd60cd002"
}

Inputs:

  • height - uint64[]: Block height (int array of length 1).

Outputs:

  • result - string: Block hash (string).

GETBLOCKTEMPLATE

Back to top

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 \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_block_template",
  "params": {
    "reserve_size": 123,
    "wallet_address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk",
    "prev_block": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70"
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "difficulty": 123,
    "height": 234767,
    "reserved_offset": 123,
    "expected_reward": 123,
    "prev_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "seed_hash": "b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123",
    "next_seed_hash": "b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123",
    "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.
  • prev_block - string

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.
  • seed_hash - string: RandomX current seed hash
  • next_seed_hash - string: RandomX upcoming seed hash
  • 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).

GET_ALTERNATE_CHAINS

Back to top

Display alternative chains seen by the node.

Endpoints: get_alternative_chains

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_alternative_chains"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "chains": [{
      "block_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
      "height": 234767,
      "length": 123,
      "difficulty": 123,
      "block_hashes": ["bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70"],
      "main_chain_parent_block": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70"
    }]
  }
}

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.
  • chains - chain_info[]: Array of Chains.
  • block_hash - string: The block hash of the first diverging block of this alternative chain.
  • height - uint64: The block height of the first diverging block of this alternative chain.
  • length - uint64: The length in blocks of this alternative chain, after divergence.
  • difficulty - uint64: The cumulative difficulty of all blocks in the alternative chain.
  • block_hashes - string[]
  • main_chain_parent_block - string

GET_BASE_FEE_ESTIMATE

Back to top

Gives an estimation of per-output + per-byte fees

Endpoints: get_fee_estimate

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_fee_estimate",
  "params": {
    "grace_blocks": 123
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "fee_per_byte": 123,
    "fee_per_output": 123,
    "quantization_mask": 123,
    "untrusted": false
  }
}

Inputs:

  • grace_blocks - uint64: Optional

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.
  • fee_per_byte - uint64: Amount of fees estimated per byte in atomic units
  • fee_per_output - uint64: Amount of fees per output generated by the tx (adds to the fee_per_byte per-byte value)
  • quantization_mask - 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).

GET_BLOCK

Back to top

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 \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_block",
  "params": {
    "hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "height": 234767,
    "fill_pow_hash": true
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "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",
      "service_node_winner": "4a8c30cea9e729b06c91132295cce32d2a8e6e5bcf7b74a998e2ee1b3ed590b3"
    },
    "miner_tx_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "tx_hashes": ["b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123"],
    "blob": "0b0b85819be50599a27f959e4bf53d6ed1d862958ae9734bb53e2a3c9085c74dc9a64f1ffe7ecbac5c003b02bae50e01ff9ce50e02c6e5b7be3b02599dd5dd36f71ea8baaf0cdf06487954cdeefc08c4a015deabccfd322c539f6a85ffbd8c4202d568949320e96569773b68bf4a081bed23b7c18c8e0fcd12007e922f2b361deea301019d4c141e08ec3a567a179d544ee6c0fe5b301482c052e7f1b8fda08253dc8f19032100de2de1e442cbe12171e1e4a02acb1fb2f19d1edf1b34ea46beab4aa84a3b8c1e021b00000000000000000000000008b742a096fc00000000000000000001cff3b81be28f27c7967ace59ad6d4117bb59beb45b42b6e6628550de36e41e4372639c05971665ab70273c8a0827397f82face8f18c0380901e425554606a4a90a0000",
    "json": "{\n  \"major_version\": 11, \n  \"minor_version\": 11, \n  \"timestamp\": 1554432133, \n  \"prev_id\": \"99a27f959e4bf53d6ed1d862958ae9734bb53e2a3c9085c74dc9a64f1ffe7ecb\", \n  \"nonce\": 989879468, \n  \"miner_tx\": {\n    \"version\": 2, \n    \"unlock_time\": 242362, \n    \"vin\": [ {\n        \"gen\": {\n          \"height\": 242332\n        }\n      }\n    ], \n    \"vout\": [ {\n        \"amount\": 15968629446, \n        \"target\": {\n          \"key\": \"599dd5dd36f71ea8baaf0cdf06487954cdeefc08c4a015deabccfd322c539f6a\"\n        }\n      }, {\n        \"amount\": 17742921605, \n        \"target\": {\n          \"key\": \"d568949320e96569773b68bf4a081bed23b7c18c8e0fcd12007e922f2b361dee\"\n        }\n      }\n    ], \n    \"extra\": [ 1, 157, 76, 20, 30, 8, 236, 58, 86, 122, 23, 157, 84, 78, 230, 192, 254, 91, 48, 20, 130, 192, 82, 231, 241, 184, 253, 160, 130, 83, 220, 143, 25, 3, 33, 0, 222, 45, 225, 228, 66, 203, 225, 33, 113, 225, 228, 160, 42, 203, 31, 178, 241, 157, 30, 223, 27, 52, 234, 70, 190, 171, 74, 168, 74, 59, 140, 30, 2, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 183, 66, 160, 150, 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 207, 243, 184, 27, 226, 143, 39, 199, 150, 122, 206, 89, 173, 109, 65, 23, 187, 89, 190, 180, 91, 66, 182, 230, 98, 133,80, 222, 54, 228, 30, 67, 114, 99, 156, 5, 151, 22, 101, 171, 112, 39, 60, 138, 8, 39, 57, 127, 130, 250, 206, 143, 24, 192, 56, 9, 1, 228, 37, 85, 70, 6, 164, 169, 10\n], \n    \"rct_signatures\": {\n      \"type\": 0\n    }\n  }, \n  \"tx_hashes\": [ ]\n}",
    "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 loki protocol at this block height.
  • minor_version - uint8: The minor version of the loki 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 Loki 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 Loki network based on mining power.
  • cumulative_difficulty - uint64: The cumulative strength of the Loki network based on mining power.
  • reward - uint64: The amount of new generated in this block and rewarded to the miner, foundation and service Nodes. Note: 1 LOKI = 1e9 atomic units.
  • miner_reward - uint64: The amount of new generated in this block and rewarded to the miner. Note: 1 LOKI = 1e9 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: The TX hash of the miner transaction
  • service_node_winner - string: Service node that received a reward for this 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).

GET_BLOCK_HEADERS_RANGE

Back to top

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 \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_block_headers_range",
  "params": {
    "start_height": 123,
    "end_height": 123,
    "fill_pow_hash": true
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "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,
      "miner_tx_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
      "service_node_winner": "4a8c30cea9e729b06c91132295cce32d2a8e6e5bcf7b74a998e2ee1b3ed590b3"
    }],
    "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 loki protocol at this block height.
  • minor_version - uint8: The minor version of the loki 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 Loki 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 Loki network based on mining power.
  • cumulative_difficulty - uint64: The cumulative strength of the Loki network based on mining power.
  • reward - uint64: The amount of new generated in this block and rewarded to the miner, foundation and service Nodes. Note: 1 LOKI = 1e9 atomic units.
  • miner_reward - uint64: The amount of new generated in this block and rewarded to the miner. Note: 1 LOKI = 1e9 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: The TX hash of the miner transaction
  • service_node_winner - string: Service node that received a reward for this 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).

GET_BLOCK_HEADER_BY_HASH

Back to top

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 \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_block_header_by_hash",
  "params": {
    "hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "fill_pow_hash": true
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "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",
      "service_node_winner": "4a8c30cea9e729b06c91132295cce32d2a8e6e5bcf7b74a998e2ee1b3ed590b3"
    },
    "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 loki protocol at this block height.
  • minor_version - uint8: The minor version of the loki 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 Loki 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 Loki network based on mining power.
  • cumulative_difficulty - uint64: The cumulative strength of the Loki network based on mining power.
  • reward - uint64: The amount of new generated in this block and rewarded to the miner, foundation and service Nodes. Note: 1 LOKI = 1e9 atomic units.
  • miner_reward - uint64: The amount of new generated in this block and rewarded to the miner. Note: 1 LOKI = 1e9 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: The TX hash of the miner transaction
  • service_node_winner - string: Service node that received a reward for this 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).

GET_BLOCK_HEADER_BY_HEIGHT

Back to top

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 \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_block_header_by_height",
  "params": {
    "height": 234767,
    "fill_pow_hash": true
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "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",
      "service_node_winner": "4a8c30cea9e729b06c91132295cce32d2a8e6e5bcf7b74a998e2ee1b3ed590b3"
    },
    "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 loki protocol at this block height.
  • minor_version - uint8: The minor version of the loki 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 Loki 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 Loki network based on mining power.
  • cumulative_difficulty - uint64: The cumulative strength of the Loki network based on mining power.
  • reward - uint64: The amount of new generated in this block and rewarded to the miner, foundation and service Nodes. Note: 1 LOKI = 1e9 atomic units.
  • miner_reward - uint64: The amount of new generated in this block and rewarded to the miner. Note: 1 LOKI = 1e9 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: The TX hash of the miner transaction
  • service_node_winner - string: Service node that received a reward for this 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).

GET_CHECKPOINTS

Back to top

Query hardcoded/service node checkpoints stored for the blockchain. Omit all arguments to retrieve the latest "count" checkpoints.

Endpoints: get_checkpoints

Constants: 
 * `MAX_COUNT - uint64 = 256`
 * `NUM_CHECKPOINTS_TO_QUERY_BY_DEFAULT - uint32 = 60`
 * `HEIGHT_SENTINEL_VALUE - uint64 = std::numeric_limits<uint64_t>::max() - 1`

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_checkpoints",
  "params": {
    "start_height": 123,
    "end_height": 123,
    "count": 2130706433
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "checkpoints": [{
      "version": 11,
      "type": "ServiceNode",
      "height": 234767,
      "block_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
      "signatures": [{
        "voter_index": 12345,
        "signature": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70"
      }],
      "prev_height": 123
    }],
    "status": "OK",
    "untrusted": false
  }
}

Inputs:

  • start_height - uint64: Optional: Get the first count checkpoints starting from this height. Specify both start and end to get the checkpoints inbetween.
  • end_height - uint64: Optional: Get the first count checkpoints before end height. Specify both start and end to get the checkpoints inbetween.
  • count - uint32: Optional: Number of checkpoints to query.

Outputs:

  • checkpoints - checkpoint_serialized[]: Array of requested checkpoints
  • version - uint8
  • type - string: Either "Hardcoded" or "ServiceNode" for checkpoints generated by Service Nodes or declared in the code
  • height - uint64: The height the checkpoint is relevant for
  • block_hash - string: The block hash the checkpoint is specifying
  • signatures - voter_to_signature_serialized[]: Signatures from Service Nodes who agree on the block hash
    • voter_index - uint16: Index of the voter in the relevant quorum
    • signature - string: The signature generated by the voter in the quorum
  • prev_height - uint64: The previous height the checkpoint is based off
  • 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.

GET_COINBASE_TX_SUM

Back to top

Get the coinbase amount and the fees amount for n last blocks starting at particular height.

Endpoints: get_coinbase_tx_sum

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_coinbase_tx_sum",
  "params": {
    "height": 234767,
    "count": 123
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "emission_amount": 123,
    "fee_amount": 123,
    "burn_amount": 123
  }
}

Inputs:

  • height - uint64: Block height from which getting the amounts.
  • count - uint64: Number of blocks to include in the sum.

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.
  • emission_amount - uint64: Amount of coinbase reward in atomic units.
  • fee_amount - uint64: Amount of fees in atomic units.
  • burn_amount - uint64: Amount of burnt loki.

GET_CONNECTIONS

Back to top

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 \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_connections"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "connections": [{
      "incoming": true,
      "localhost": true,
      "local_ip": true,
      "ssl": true,
      "address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk",
      "host": "127.0.0.1",
      "ip": "TODO(loki): Write example string",
      "port": "62950",
      "rpc_port": 12345,
      "peer_id": "c959fbfbed9e44fb",
      "recv_count": 123,
      "recv_idle_time": 123,
      "send_count": 123,
      "send_idle_time": 123,
      "state": "TODO(loki): Write example string",
      "live_time": 123,
      "avg_download": 123,
      "current_download": 123,
      "avg_upload": 123,
      "current_upload": 123,
      "support_flags": 2130706433,
      "connection_id": "083c301a3030329a487adb12ad981d2c",
      "height": 234767,
      "pruning_seed": 2130706433,
      "address_type": 11
    }]
  }
}

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.
  • connections - connection_info[]: List of all connections and their info:
  • incoming - bool
  • localhost - bool
  • local_ip - bool
  • ssl - bool
  • address - string
  • host - string
  • ip - string
  • port - string
  • rpc_port - uint16
  • peer_id - string
  • recv_count - uint64
  • recv_idle_time - uint64
  • send_count - uint64
  • send_idle_time - uint64
  • state - string
  • live_time - uint64
  • avg_download - uint64
  • current_download - uint64
  • avg_upload - uint64
  • current_upload - uint64
  • support_flags - uint32
  • connection_id - string
  • height - uint64
  • pruning_seed - uint32
  • address_type - uint8

GET_HEIGHT

Back to top

Get the node's current height.

Endpoints: get_height, getheight

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_height"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "height": 234767,
    "status": "OK",
    "untrusted": false,
    "hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "immutable_height": 123,
    "immutable_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70"
  }
}

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.
  • hash - string: Hash of the block at the current height
  • immutable_height - uint64: The latest height in the blockchain that can not be reorganized from (backed by atleast 2 Service Node, or 1 hardcoded checkpoint, 0 if N/A).
  • immutable_hash - string: Hash of the highest block in the chain that can not be reorganized.

GET_INFO

Back to top

Retrieve general information about the state of your node and the network.

Endpoints: get_info, getinfo

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_info"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "height": 234767,
    "target_height": 123,
    "immutable_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",
    "immutable_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,
    "service_node": true,
    "last_storage_server_ping": 123,
    "last_lokinet_ping": 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": "7",
    "status_line": "v15; Height: 531686"
  }
}

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.
  • immutable_height - uint64: The latest height in the blockchain that can not be reorganized from (backed by atleast 2 Service Node, or 1 hardcoded checkpoint, 0 if N/A).
  • 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.
  • immutable_block_hash - string: Hash of the highest block in the chain that can not be reorganized.
  • 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.
  • service_node - bool: Will be true if the node is running in --service-node mode.
  • last_storage_server_ping - uint64: Last ping time of the storage server (0 if never or not running as a service node)
  • last_lokinet_ping - uint64: Last ping time of lokinet (0 if never or not running as a service node)
  • 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.
  • status_line - string: A short one-line summary status of the node (requires an admin/unrestricted connection for most details)

GET_LAST_BLOCK_HEADER

Back to top

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 \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_last_block_header",
  "params": {
    "fill_pow_hash": true
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "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",
      "service_node_winner": "4a8c30cea9e729b06c91132295cce32d2a8e6e5bcf7b74a998e2ee1b3ed590b3"
    },
    "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 loki protocol at this block height.
  • minor_version - uint8: The minor version of the loki 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 Loki 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 Loki network based on mining power.
  • cumulative_difficulty - uint64: The cumulative strength of the Loki network based on mining power.
  • reward - uint64: The amount of new generated in this block and rewarded to the miner, foundation and service Nodes. Note: 1 LOKI = 1e9 atomic units.
  • miner_reward - uint64: The amount of new generated in this block and rewarded to the miner. Note: 1 LOKI = 1e9 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: The TX hash of the miner transaction
  • service_node_winner - string: Service node that received a reward for this 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).

GET_LIMIT

Back to top

Get daemon bandwidth limits.

Endpoints: get_limit

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_limit"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "limit_up": 123,
    "limit_down": 123,
    "untrusted": false
  }
}

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

GET_NET_STATS

Back to top

Endpoints: get_net_stats
Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_net_stats"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "start_time": 123,
    "total_packets_in": 123,
    "total_bytes_in": 123,
    "total_packets_out": 123,
    "total_bytes_out": 123
  }
}

Outputs:

  • status - string
  • start_time - uint64
  • total_packets_in - uint64
  • total_bytes_in - uint64
  • total_packets_out - uint64
  • total_bytes_out - uint64

GET_OUTPUTS

Back to top

Endpoints: get_outs
Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_outs",
  "params": {
    "outputs": [{
      "amount": 26734261552878,
      "index": 123
    }],
    "get_txid": true
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "outs": [{
      "key": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
      "mask": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
      "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 Loki in TXID.
  • index - uint64
  • get_txid - bool: Request the TXID/hash of the transaction as well.

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

GET_OUTPUT_DISTRIBUTION

Back to top

Endpoints: get_output_distribution
Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_output_distribution",
  "params": {
    "amounts": [123],
    "from_height": 123,
    "to_height": 123,
    "cumulative": true,
    "binary": true,
    "compress": true
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "distributions": [{
      "data": {
        "distribution": ["TODO(loki): Write example string"],
        "start_height": "TODO(loki): Write example string",
        "base": "TODO(loki): Write example string"
      },
      "amount": 26734261552878,
      "compressed_data": "TODO(loki): Write example string",
      "binary": true,
      "compress": true
    }],
    "untrusted": false
  }
}

Inputs:

  • amounts - uint64[]: Amounts to look for in atomic units.
  • from_height - uint64: (optional, default is 0) starting height to check from.
  • to_height - uint64: (optional, default is 0) ending height to check up to.
  • cumulative - bool: (optional, default is false) States if the result should be cumulative (true) or not (false).
  • binary - bool
  • compress - bool

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.
  • distributions - distribution[]
  • data - rpc::output_distribution_data
    • distribution - uint64[]
    • start_height - uint64
    • base - uint64
  • amount - uint64
  • compressed_data - string
  • binary - bool
  • compress - bool
  • 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_OUTPUT_HISTOGRAM

Back to top

Get a histogram of output amounts. For all amounts (possibly filtered by parameters),
gives the number of outputs on the chain for that amount. RingCT outputs counts as 0 amount.

Endpoints: get_output_histogram

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_output_histogram",
  "params": {
    "amounts": [123],
    "min_count": 123,
    "max_count": 123,
    "unlocked": true,
    "recent_cutoff": 123
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "histogram": [{
      "amount": 26734261552878,
      "total_instances": 123,
      "unlocked_instances": 123,
      "recent_instances": 123
    }],
    "untrusted": false
  }
}

Inputs:

  • amounts - uint64[]: list of amounts in Atomic Units.
  • min_count - uint64: The minimum amounts you are requesting.
  • max_count - uint64: The maximum amounts you are requesting.
  • unlocked - bool: Look for locked only.
  • recent_cutoff - uint64

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.
  • histogram - entry[]: List of histogram entries:
  • amount - uint64: Output amount in atomic units.
  • total_instances - uint64
  • unlocked_instances - uint64
  • recent_instances - 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).

GET_PEER_LIST

Back to top

Get the known peers list.

Endpoints: get_peer_list

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_peer_list"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "white_list": [{
      "id": 123,
      "host": "127.0.0.1",
      "ip": 2130706433,
      "port": 12345,
      "rpc_port": 12345,
      "last_seen": 1554685440,
      "pruning_seed": 2130706433
    }],
    "gray_list": [{
      "id": 123,
      "host": "127.0.0.1",
      "ip": 2130706433,
      "port": 12345,
      "rpc_port": 12345,
      "last_seen": 1554685440,
      "pruning_seed": 2130706433
    }]
  }
}

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good. Any other value means that something went wrong.
  • white_list - peer[]: Array of online peer structure.
  • id - uint64: Peer id.
  • host - string: IP address in string format.
  • ip - uint32: IP address in integer format.
  • port - uint16: TCP port the peer is using to connect to loki network.
  • rpc_port - uint16: RPC port the peer is using
  • last_seen - uint64: Unix time at which the peer has been seen for the last time
  • pruning_seed - uint32
  • gray_list - peer[]: Array of offline peer structure.
  • id - uint64: Peer id.
  • host - string: IP address in string format.
  • ip - uint32: IP address in integer format.
  • port - uint16: TCP port the peer is using to connect to loki network.
  • rpc_port - uint16: RPC port the peer is using
  • last_seen - uint64: Unix time at which the peer has been seen for the last time
  • pruning_seed - uint32

GET_QUORUM_STATE

Back to top

Get the quorum state which is the list of public keys of the nodes who are voting, and the list of public keys of the nodes who are being tested.

Endpoints: get_quorum_state

Constants: 
 * `MAX_COUNT - uint64 = 256`
 * `HEIGHT_SENTINEL_VALUE - uint64 = UINT64_MAX`
 * `ALL_QUORUMS_SENTINEL_VALUE - uint8 = 255`

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_quorum_state",
  "params": {
    "start_height": 123,
    "end_height": 123,
    "quorum_type": 11
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "quorums": [{
      "height": 234767,
      "quorum_type": 11,
      "quorum": {
        "validators": ["4a8c30cea9e729b06c91132295cce32d2a8e6e5bcf7b74a998e2ee1b3ed590b3"],
        "workers": ["4a8c30cea9e729b06c91132295cce32d2a8e6e5bcf7b74a998e2ee1b3ed590b3"]
      }
    }],
    "untrusted": false
  }
}

Inputs:

  • start_height - uint64: (Optional): Start height, omit both start and end height to request the latest quorum
  • end_height - uint64: (Optional): End height, omit both start and end height to request the latest quorum
  • quorum_type - uint8: (Optional): Set value to request a specific quorum, 0 = Obligation, 1 = Checkpointing, 255 = all quorums, default is all quorums;

Outputs:

  • status - string: Generic RPC error code. "OK" is the success value.
  • quorums - quorum_for_height[]: An array of quorums associated with the requested height
  • height - uint64: The height the quorums are relevant for
  • quorum_type - uint8: The quorum type
  • quorum - quorum_t: Quorum of Service Nodes
    • validators - string[]: Public key of the service node
    • workers - string[]: Public key of the service node
  • untrusted - bool: If the result is obtained using bootstrap mode, and therefore not trusted true, or otherwise false.

GET_RANDOM_OUTS

Back to top

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

GET_SERVICE_KEYS

Back to top

Get the service public keys of the queried daemon, encoded in hex.  All three keys are used
when running as a service node; when running as a regular node only the x25519 key is regularly
used for some RPC and and node-to-SN communication requests.

Endpoints: get_service_keys, get_service_node_key

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_service_keys"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "service_node_pubkey": "4a8c30cea9e729b06c91132295cce32d2a8e6e5bcf7b74a998e2ee1b3ed590b3",
    "service_node_ed25519_pubkey": "1de25fd280b9b08da62f06a5521c735fd94b7ecf237ca7409748295e75b48104",
    "service_node_x25519_pubkey": "7a8d1961ec9d1ac77aa67a2cded9271b0b6b9e4406005b36e260d0a230943b0e",
    "status": "OK"
  }
}

Outputs:

  • service_node_pubkey - string: The queried daemon's service node public key. Will be empty if not running as a service node.
  • service_node_ed25519_pubkey - string: The daemon's ed25519 auxiliary public key.
  • service_node_x25519_pubkey - string: The daemon's x25519 auxiliary public key.
  • status - string: Generic RPC error code. "OK" is the success value.

GET_SERVICE_NODES

Back to top

Get information on some, all, or a random subset of Service Nodes.

Endpoints: get_service_nodes, get_n_service_nodes, get_all_service_nodes

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_service_nodes",
  "params": {
    "service_node_pubkeys": ["4a8c30cea9e729b06c91132295cce32d2a8e6e5bcf7b74a998e2ee1b3ed590b3"],
    "include_json": true,
    "limit": 2130706433,
    "active_only": true,
    "fields": {
      "all": true,
      "service_node_pubkey": true,
      "registration_height": true,
      "registration_hf_version": true,
      "requested_unlock_height": true,
      "last_reward_block_height": true,
      "last_reward_transaction_index": true,
      "active": true,
      "funded": true,
      "state_height": true,
      "decommission_count": true,
      "earned_downtime_blocks": true,
      "service_node_version": true,
      "contributors": true,
      "total_contributed": true,
      "total_reserved": true,
      "staking_requirement": true,
      "portions_for_operator": true,
      "swarm_id": true,
      "operator_address": true,
      "public_ip": true,
      "storage_port": true,
      "storage_lmq_port": true,
      "quorumnet_port": true,
      "pubkey_ed25519": true,
      "pubkey_x25519": true,
      "last_uptime_proof": true,
      "storage_server_reachable": true,
      "storage_server_reachable_timestamp": true,
      "version_major": true,
      "version_minor": true,
      "version_patch": true,
      "votes": true,
      "block_hash": true,
      "height": true,
      "target_height": true,
      "hardfork": true
    },
    "poll_block_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70"
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "service_node_states": [{
      "service_node_pubkey": "4a8c30cea9e729b06c91132295cce32d2a8e6e5bcf7b74a998e2ee1b3ed590b3",
      "registration_height": 234767,
      "registration_hf_version": 12345,
      "requested_unlock_height": 123,
      "last_reward_block_height": 234767,
      "last_reward_transaction_index": 2130706433,
      "active": true,
      "funded": true,
      "state_height": 123,
      "decommission_count": 2130706433,
      "earned_downtime_blocks": 123,
      "service_node_version": ["TODO(loki): Write example string"],
      "contributors": [{
        "amount": 26734261552878,
        "reserved": 123,
        "address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk",
        "locked_contributions": [{
          "key_image": "8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3",
          "key_image_pub_key": "b1b696dd0a0d1815e341d9fed85708703c57b5d553a3615bcf4a06a36fa4bc38",
          "amount": 26734261552878
        }]
      }],
      "total_contributed": 123,
      "total_reserved": 123,
      "staking_requirement": 100000000000,
      "portions_for_operator": 18446744073709551612,
      "swarm_id": 123,
      "operator_address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk",
      "public_ip": "8.8.8.8",
      "storage_port": 12345,
      "storage_lmq_port": 12345,
      "quorumnet_port": 12345,
      "pubkey_ed25519": "1de25fd280b9b08da62f06a5521c735fd94b7ecf237ca7409748295e75b48104",
      "pubkey_x25519": "7a8d1961ec9d1ac77aa67a2cded9271b0b6b9e4406005b36e260d0a230943b0e",
      "last_uptime_proof": 123,
      "storage_server_reachable": true,
      "storage_server_reachable_timestamp": 123,
      "version_major": 12345,
      "version_minor": 12345,
      "version_patch": 12345,
      "votes": [{
        "height": 234767,
        "voted": true
      }]
    }],
    "height": 234767,
    "target_height": 123,
    "block_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "unchanged": true,
    "hardfork": 11,
    "status": "OK",
    "as_json": "TODO(loki): Write example string"
  }
}

Inputs:

  • service_node_pubkeys - string[]: Array of public keys of registered Service Nodes to get information about. Omit to query all Service Nodes.
  • include_json - bool: When set, the response's as_json member is filled out.
  • limit - uint32: If non-zero, select a random sample (in random order) of the given number of service nodes to return from the full list.
  • active_only - bool: If true, only include results for active (fully staked, not decommissioned) service nodes.
  • fields - requested_fields_t
  • all - bool = true: internal use only: indicates whether none of the other parameters have been explicitly set
  • service_node_pubkey - bool
  • registration_height - bool
  • registration_hf_version - bool
  • requested_unlock_height - bool
  • last_reward_block_height - bool
  • last_reward_transaction_index - bool
  • active - bool
  • funded - bool
  • state_height - bool
  • decommission_count - bool
  • earned_downtime_blocks - bool
  • service_node_version - bool
  • contributors - bool
  • total_contributed - bool
  • total_reserved - bool
  • staking_requirement - bool
  • portions_for_operator - bool
  • swarm_id - bool
  • operator_address - bool
  • public_ip - bool
  • storage_port - bool
  • storage_lmq_port - bool
  • quorumnet_port - bool
  • pubkey_ed25519 - bool
  • pubkey_x25519 - bool
  • last_uptime_proof - bool
  • storage_server_reachable - bool
  • storage_server_reachable_timestamp - bool
  • version_major - bool
  • version_minor - bool
  • version_patch - bool
  • votes - bool
  • block_hash - bool
  • height - bool
  • target_height - bool
  • hardfork - bool
  • poll_block_hash - string: If specified this changes the behaviour to only return service node records if the block hash is not equal to the given hash; otherwise it omits the records and instead sets "unchanged": true in the response. This is primarily used to poll for new results where the requested results only change with new blocks.

Outputs:

  • service_node_states - entry[]: Array of service node registration information
  • service_node_pubkey - string: The public key of the Service Node.
  • registration_height - uint64: The height at which the registration for the Service Node arrived on the blockchain.
  • registration_hf_version - uint16: The hard fork at which the registration for the Service Node arrived on the blockchain.
  • requested_unlock_height - uint64: The height at which contributions will be released and the Service Node expires. 0 if not requested yet.
  • last_reward_block_height - uint64: The last height at which this Service Node received a reward.
  • last_reward_transaction_index - uint32: When multiple Service Nodes register on the same height, the order the transaction arrive dictate the order you receive rewards.
  • active - bool: True if fully funded and not currently decommissioned (and so active && !funded implicitly defines decommissioned)
  • funded - bool: True if the required stakes have been submitted to activate this Service Node
  • state_height - uint64: If active: the state at which registration was completed; if decommissioned: the decommissioning height; if awaiting: the last contribution (or registration) height
  • decommission_count - uint32: The number of times the Service Node has been decommissioned since registration
  • earned_downtime_blocks - int64: The number of blocks earned towards decommissioning, or the number of blocks remaining until deregistration if currently decommissioned
  • service_node_version - uint16[3]: The major, minor, patch version of the Service Node respectively.
  • contributors - service_node_contributor[]: Array of contributors, contributing to this Service Node.
    • amount - uint64: The total amount of locked Loki in atomic units for this contributor.
    • reserved - uint64: The amount of Loki in atomic units reserved by this contributor for this Service Node.
    • address - string: The wallet address for this contributor rewards are sent to and contributions came from.
    • locked_contributions - service_node_contribution[]: Array of contributions from this contributor.
    • key_image - string: The contribution's key image that is locked on the network.
    • key_image_pub_key - string: The contribution's key image, public key component
    • amount - uint64: The amount that is locked in this contribution.
  • total_contributed - uint64: The total amount of Loki in atomic units contributed to this Service Node.
  • total_reserved - uint64: The total amount of Loki in atomic units reserved in this Service Node.
  • staking_requirement - uint64: The staking requirement in atomic units that is required to be contributed to become a Service Node.
  • portions_for_operator - uint64: The operator percentage cut to take from each reward expressed in portions, see cryptonote_config.h's STAKING_PORTIONS.
  • swarm_id - uint64: The identifier of the Service Node's current swarm.
  • operator_address - string: The wallet address of the operator to which the operator cut of the staking reward is sent to.
  • public_ip - string: The public ip address of the service node
  • storage_port - uint16: The port number associated with the storage server
  • storage_lmq_port - uint16: The port number associated with the storage server (lokimq interface)
  • quorumnet_port - uint16: The port for direct SN-to-SN communication
  • pubkey_ed25519 - string: The service node's ed25519 public key for auxiliary services
  • pubkey_x25519 - string: The service node's x25519 public key for auxiliary services
  • last_uptime_proof - uint64: The last time this Service Node's uptime proof was relayed by at least 1 Service Node other than itself in unix epoch time.
  • storage_server_reachable - bool: Whether the node's storage server has been reported as unreachable for a long time
  • storage_server_reachable_timestamp - uint64: The last time this Service Node's storage server was contacted
  • version_major - uint16: Major version the node is currently running
  • version_minor - uint16: Minor version the node is currently running
  • version_patch - uint16: Patch version the node is currently running
  • votes - service_nodes::checkpoint_vote_record[]: Of the last N checkpoints the Service Node is in a checkpointing quorum, record whether or not the Service Node voted to checkpoint a block
    • height - uint64 = INVALID_HEIGHT
    • voted - bool = true
  • height - uint64: Current block's height.
  • target_height - uint64: Blockchain's target height.
  • block_hash - string: Current block's hash.
  • unchanged - bool: Will be true (and service_node_states omitted) if you gave the current block hash to poll_block_hash
  • hardfork - uint8: Current hardfork version.
  • status - string: Generic RPC error code. "OK" is the success value.
  • as_json - string: If include_json is set in the request, this contains the json representation of the entry data structure

GET_SERVICE_NODE_BLACKLISTED_KEY_IMAGES

Back to top

Get information on blacklisted Service Node key images.

Endpoints: get_service_node_blacklisted_key_images

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_service_node_blacklisted_key_images"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "blacklist": [{
      "key_image": "8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3",
      "unlock_height": 123,
      "amount": 26734261552878
    }],
    "status": "OK"
  }
}

Outputs:

  • blacklist - entry[]: Array of blacklisted key images, i.e. unspendable transactions
  • key_image - string: The key image of the transaction that is blacklisted on the network.
  • unlock_height - uint64: The height at which the key image is removed from the blacklist and becomes spendable.
  • amount - uint64: The total amount of locked Loki in atomic units in this blacklisted stake.
  • status - string: Generic RPC error code. "OK" is the success value.

GET_SERVICE_NODE_REGISTRATION_CMD

Back to top

Endpoints: get_service_node_registration_cmd

Constants: 
 * `response - GET_SERVICE_NODE_REGISTRATION_CMD_RAW::response`
Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_service_node_registration_cmd",
  "params": {
    "operator_cut": "1.1%",
    "contributions": [{
      "address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk",
      "amount": 26734261552878
    }],
    "staking_requirement": 100000000000
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "registration_cmd": "register_service_node 18446744073709551612 L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk 18446744073709551612 1555894565 f90424b23c7969bb2f0191bca45e6433a59b0b37039a5e38a2ba8cc7ea1075a3 ba24e4bfb4af0f5f9f74e35f1a5685dc9250ee83f62a9ee8964c9a689cceb40b4f125c83d0cbb434e56712d0300e5a23fd37a5b60cddbcd94e2d578209532a0d"
  }
}

Inputs:

  • operator_cut - string: The percentage of cut per reward the operator receives expressed as a string, i.e. "1.1%"
  • contributions - contribution_t[]: Array of contributors for this Service Node
  • address - string: The wallet address for the contributor
  • amount - uint64: The amount that the contributor will reserve in Loki atomic units towards the staking requirement
  • staking_requirement - uint64: The staking requirement to become a Service Node the registration command will be generated upon

Outputs:

  • status - string: Generic RPC error code. "OK" is the success value.
  • registration_cmd - string: The command to execute in the wallet CLI to register the queried daemon as a Service Node.

GET_SERVICE_NODE_REGISTRATION_CMD_RAW

Back to top

Endpoints: get_service_node_registration_cmd_raw
Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_service_node_registration_cmd_raw",
  "params": {
    "args": ["TODO(loki): Write example string"],
    "make_friendly": true,
    "staking_requirement": 100000000000
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "registration_cmd": "register_service_node 18446744073709551612 L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk 18446744073709551612 1555894565 f90424b23c7969bb2f0191bca45e6433a59b0b37039a5e38a2ba8cc7ea1075a3 ba24e4bfb4af0f5f9f74e35f1a5685dc9250ee83f62a9ee8964c9a689cceb40b4f125c83d0cbb434e56712d0300e5a23fd37a5b60cddbcd94e2d578209532a0d"
  }
}

Inputs:

  • args - string[]: (Developer) The arguments used in raw registration, i.e. portions
  • make_friendly - bool: Provide information about how to use the command in the result.
  • staking_requirement - uint64: The staking requirement to become a Service Node the registration command will be generated upon

Outputs:

  • status - string: Generic RPC error code. "OK" is the success value.
  • registration_cmd - string: The command to execute in the wallet CLI to register the queried daemon as a Service Node.

GET_SERVICE_NODE_STATUS

Back to top

Get information on the queried daemon's Service Node state.

Endpoints: get_service_node_status

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_service_node_status",
  "params": {
    "include_json": true
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "service_node_state": "TODO(loki): Write example string",
    "height": 234767,
    "block_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "status": "OK",
    "as_json": "TODO(loki): Write example string"
  }
}

Inputs:

  • include_json - bool: When set, the response's as_json member is filled out.

Outputs:

  • service_node_state - GET_SERVICE_NODES::response::entry: Service node registration information
  • height - uint64: Current block's height.
  • block_hash - string: Current block's hash.
  • status - string: Generic RPC error code. "OK" is the success value.
  • as_json - string: If include_json is set in the request, this contains the json representation of the entry data structure

GET_SERVICE_PRIVKEYS

Back to top

Get the service private keys of the queried daemon, encoded in hex.  Do not ever share
these keys: they would allow someone to impersonate your service node.  All three keys are used
when running as a service node; when running as a regular node only the x25519 key is regularly
used for some RPC and and node-to-SN communication requests.

Endpoints: get_service_privkeys, get_service_node_privkey

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_service_privkeys"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "service_node_privkey": "4a8c30cea9e729b06c91132295cce32d2a8e6e5bcf7b74a998e2ee1b3ed590b3",
    "service_node_ed25519_privkey": "1de25fd280b9b08da62f06a5521c735fd94b7ecf237ca7409748295e75b48104",
    "service_node_x25519_privkey": "7a8d1961ec9d1ac77aa67a2cded9271b0b6b9e4406005b36e260d0a230943b0e",
    "status": "OK"
  }
}

Outputs:

  • service_node_privkey - string: The queried daemon's service node private key. Will be empty if not running as a service node.
  • service_node_ed25519_privkey - string: The daemon's ed25519 private key (note that this is in sodium's format, which consists of the private and public keys concatenated together)
  • service_node_x25519_privkey - string: The daemon's x25519 private key.
  • status - string: Generic RPC error code. "OK" is the success value.

GET_SN_STATE_CHANGES

Back to top

Query hardcoded/service node checkpoints stored for the blockchain. Omit all arguments to retrieve the latest "count" checkpoints.

Endpoints: get_service_nodes_state_changes

Constants: 
 * `HEIGHT_SENTINEL_VALUE - uint64 = std::numeric_limits<uint64_t>::max() - 1`

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_service_nodes_state_changes",
  "params": {
    "start_height": 123,
    "end_height": 123
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "untrusted": false,
    "total_deregister": 2130706433,
    "total_ip_change_penalty": 2130706433,
    "total_decommission": 2130706433,
    "total_recommission": 2130706433,
    "total_unlock": 2130706433,
    "start_height": 123,
    "end_height": 123
  }
}

Inputs:

  • start_height - uint64
  • end_height - uint64: Optional: If omitted, the tally runs until the current block

Outputs:

  • 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.
  • total_deregister - uint32
  • total_ip_change_penalty - uint32
  • total_decommission - uint32
  • total_recommission - uint32
  • total_unlock - uint32
  • start_height - uint64
  • end_height - uint64

GET_STAKING_REQUIREMENT

Back to top

Get the required amount of Loki to become a Service Node at the queried height.
For stagenet and testnet values, ensure the daemon is started with the
`--stagenet` or `--testnet` flags respectively.

Endpoints: get_staking_requirement

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_staking_requirement",
  "params": {
    "height": 234767
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "staking_requirement": 100000000000,
    "height": 234767,
    "status": "OK"
  }
}

Inputs:

  • height - uint64: The height to query the staking requirement for. 0 (or omitting) means current height.

Outputs:

  • staking_requirement - uint64: The staking requirement in Loki, in atomic units.
  • height - uint64: The height requested (or current height if 0 was requested)
  • status - string: Generic RPC error code. "OK" is the success value.

GET_TRANSACTIONS

Back to top

Look up one or more transactions by hash.

Endpoints: get_transactions, gettransactions

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_transactions",
  "params": {
    "txs_hashes": ["b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123"],
    "decode_as_json": true,
    "prune": true,
    "split": true
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "txs_as_hex": ["TODO(loki): Write example string"],
    "txs_as_json": ["TODO(loki): Write example string"],
    "missed_tx": ["b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123"],
    "txs": [{
      "tx_hash": "b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123",
      "as_hex": "TODO(loki): Write example string",
      "pruned_as_hex": "TODO(loki): Write example string",
      "prunable_as_hex": "TODO(loki): Write example string",
      "prunable_hash": "b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123",
      "as_json": "TODO(loki): Write example string",
      "in_pool": true,
      "double_spend_seen": true,
      "block_height": 123,
      "block_timestamp": 123,
      "output_indices": [123],
      "relayed": true,
      "blink": true
    }],
    "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.
  • relayed - bool
  • blink - bool: True if this is an approved, blink transaction (only for in_pool transactions or txes in recent blocks)
  • 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_TRANSACTION_POOL

Back to top

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/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_transaction_pool"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "transactions": [{
      "id_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
      "tx_json": "TODO(loki): 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": "0402f78b05f78b05f78b0501ffd98b0502b888ddcf730229f056f5594cfcfd8d44f8033c9fda22450693d1694038e1cecaaaac25a8fc12af8992bc800102534df00c14ead3b3dedea9e7bdcf71c44803349b5e9aee2f73e22d5385ac147b7601008e5729d9329320444666d9d9d9dc602a3ae585de91ab2ca125665e3a363610021100000001839fdb0000000000000000000001200408d5ad7ab79d9b05c94033c2029f4902a98ec51f5175564f6978467dbb28723f929cf806d4ee1c781d7771183a93a1fd74f0827bddee9baac7e3083ab2b5840000",
      "blink": true
    }],
    "spent_key_images": [{
      "id_hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
      "txs_hashes": ["b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123"]
    }],
    "untrusted": false
  }
}

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.
  • blink - bool: True if this is a signed blink 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).

GET_TRANSACTION_POOL_BACKLOG

Back to top

Get all transaction pool backlog.

Endpoints: get_txpool_backlog

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

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "backlog": [{
      "weight": 123,
      "fee": 123,
      "time_in_pool": 123
    }],
    "untrusted": false
  }
}

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

GET_TRANSACTION_POOL_HASHES

Back to top

Get hashes from transaction pool.

Endpoints: get_transaction_pool_hashes

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_transaction_pool_hashes"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "tx_hashes": ["b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123"],
    "untrusted": false
  }
}

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

GET_TRANSACTION_POOL_STATS

Back to top

Get the transaction pool statistics.

Endpoints: get_transaction_pool_stats

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_transaction_pool_stats"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "pool_stats": {
      "bytes_total": 123,
      "bytes_min": 2130706433,
      "bytes_max": 2130706433,
      "bytes_med": 2130706433,
      "fee_total": 123,
      "oldest": 123,
      "txs_total": 2130706433,
      "num_failing": 2130706433,
      "num_10m": 2130706433,
      "num_not_relayed": 2130706433,
      "histo_98pc": 123,
      "histo": [{
        "txs": 2130706433,
        "bytes": 123
      }],
      "num_double_spends": 2130706433
    },
    "untrusted": false
  }
}

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.
  • pool_stats - txpool_stats: List of pool stats:
  • bytes_total - uint64: Total size of all transactions in pool.
  • bytes_min - uint32: Min transaction size in pool.
  • bytes_max - uint32: Max transaction size in pool.
  • bytes_med - uint32: Median transaction size in pool.
  • fee_total - uint64: Total fee's in pool in atomic units.
  • oldest - uint64: Unix time of the oldest transaction in the pool.
  • txs_total - uint32: Total number of transactions.
  • num_failing - uint32: Bumber of failing transactions.
  • num_10m - uint32: Number of transactions in pool for more than 10 minutes.
  • num_not_relayed - uint32: Number of non-relayed transactions.
  • histo_98pc - uint64: the time 98% of txes are "younger" than.
  • histo - txpool_histo[]: List of txpool histo.
    • txs - uint32: Number of transactions.
    • bytes - uint64: Size in bytes.
  • num_double_spends - uint32: Number of double spend transactions.
  • 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_VERSION

Back to top

Get current RPC protocol version.

Endpoints: get_version

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "get_version"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "version": 2130706433,
    "untrusted": false
  }
}

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.
  • version - uint32: RPC current version.
  • 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).

HARD_FORK_INFO

Back to top

Look up information regarding hard fork voting and readiness.

Endpoints: hard_fork_info

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "hard_fork_info",
  "params": {
    "version": 11
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "version": 11,
    "enabled": true,
    "window": 2130706433,
    "votes": 2130706433,
    "threshold": 2130706433,
    "voting": 11,
    "state": 2130706433,
    "earliest_height": 123,
    "status": "OK",
    "untrusted": false
  }
}

Inputs:

  • version - uint8: The major block version for the fork.

Outputs:

  • version - uint8: The major block version for the fork.
  • enabled - bool: Tells if hard fork is enforced.
  • window - uint32: Number of blocks over which current votes are cast. Default is 10080 blocks.
  • votes - uint32: Number of votes towards hard fork.
  • threshold - uint32: Minimum percent of votes to trigger hard fork. Default is 80.
  • voting - uint8: Hard fork voting status.
  • state - uint32: Current hard fork state: 0 (There is likely a hard fork), 1 (An update is needed to fork properly), or 2 (Everything looks good).
  • earliest_height - uint64: Block height at which hard fork would be enabled if voted in.
  • 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).

IMPORT_WALLET_REQUEST

Back to top

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

IN_PEERS

Back to top

Limit number of Incoming peers.

Endpoints: in_peers

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "in_peers",
  "params": {
    "set": true,
    "in_peers": 2130706433
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "in_peers": 2130706433,
    "status": "OK"
  }
}

Inputs:

  • set - bool: If true, set the number of incoming peers, otherwise the response returns the current limit of incoming peers. (Defaults to true)
  • in_peers - uint32: Max number of incoming peers

Outputs:

  • in_peers - uint32: The current limit set for outgoing peers
  • status - string: General RPC error code. "OK" means everything looks good.

IS_KEY_IMAGE_SPENT

Back to top

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/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "is_key_image_spent",
  "params": {
    "key_images": ["8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3"]
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "spent_status": [0, 1],
    "status": "OK",
    "untrusted": false
  }
}

Inputs:

  • key_images - string[]: List of key image hex strings to check.

Outputs:

  • spent_status - int32[]: 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).

LNS_NAMES_TO_OWNERS

Back to top

Get the name mapping for a Loki Name Service entry. Loki currently supports mappings
for Session.

Endpoints: lns_names_to_owners

Constants: 
 * `MAX_REQUEST_ENTRIES - uint64 = 256`
 * `MAX_TYPE_REQUEST_ENTRIES - uint64 = 8`

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "lns_names_to_owners",
  "params": {
    "entries": [{
      "name_hash": "BzT9ln2zY7/DxSqNeNXeEpYx3fxu2B+guA0ClqtSb0E=",
      "types": [12345]
    }]
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "entries": [{
      "entry_index": 123,
      "type": session,
      "name_hash": "BzT9ln2zY7/DxSqNeNXeEpYx3fxu2B+guA0ClqtSb0E=",
      "owner": "L8ssYFtxi1HTFQdbmG9Lt71tyudgageDgBqBLcgLnw5XBiJ1NQLFYNAAfYpYS3jHaSe8UsFYjSgKadKhC7edTSQB15s6T7g",
      "backup_owner": "L8PYYYTh6yEewvuPmF75uhjDn9fBzKXp8CeMuwKNZBvZT8wAoe9hJ4favnZMvTTkNdT56DMNDcdWyheb3icfk4MS3udsP4R",
      "encrypted_value": "8fe253e6f15addfbce5c87583e970cb09294ec5b9fc7a1891c2ac34937e5a5c116c210ddf313f5fcccd8ee28cfeb0fa8e9",
      "register_height": 123,
      "update_height": 123,
      "txid": "b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123",
      "prev_txid": "f26efb11e8eb6b446c5e0247e8883f41689591356f7abe65afe9fe75f567d40e"
    }],
    "status": "OK"
  }
}

Inputs:

  • entries - request_entry[]
  • name_hash - string: The name hashed using libsodium's crypto_generichash_blake2b in base64 to resolve to a public key via Loki Name Service
  • types - uint16[]: If empty, query all types. Currently only Session(0). In future updates more mapping types will be available.

Outputs:

  • entries - response_entry[]
  • entry_index - uint64: The index in request_entry's entries array that was resolved via Loki Name Service.
  • type - uint16: The type of Loki Name Service entry that the owner owns.
  • name_hash - string: The hash of the name that was queried in base64
  • owner - string: The public key that purchased the Loki Name Service entry.
  • backup_owner - string: The backup public key that the owner specified when purchasing the Loki Name Service entry.
  • encrypted_value - string: The encrypted value that the name maps to. This value is encrypted using the name (not the hash) as the secret.
  • register_height - uint64: The height that this Loki Name Service entry was purchased on the Blockchain.
  • update_height - uint64: The last height that this Loki Name Service entry was updated on the Blockchain.
  • txid - string: The txid of who purchased the mapping, null hash if not applicable.
  • prev_txid - string: The previous txid that purchased the mapping, null hash if not applicable.
  • status - string: Generic RPC error code. "OK" is the success value.

LNS_OWNERS_TO_NAMES

Back to top

Get all the name mappings for the queried owner. The owner can be either a ed25519 public key or Monero style
public key; by default purchases are owned by the spend public key of the purchasing wallet.

Endpoints: lns_owners_to_names

Constants: 
 * `MAX_REQUEST_ENTRIES - uint64 = 256`

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "lns_owners_to_names",
  "params": {
    "entries": ["25be5504d9f092f02f2c7ac8d2d277327dbfb00118c64faa5eccbecfa9bce90b"]
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "entries": [{
      "request_index": 0,
      "type": session,
      "name_hash": "BzT9ln2zY7/DxSqNeNXeEpYx3fxu2B+guA0ClqtSb0E=",
      "owner": "L8ssYFtxi1HTFQdbmG9Lt71tyudgageDgBqBLcgLnw5XBiJ1NQLFYNAAfYpYS3jHaSe8UsFYjSgKadKhC7edTSQB15s6T7g",
      "backup_owner": "L8PYYYTh6yEewvuPmF75uhjDn9fBzKXp8CeMuwKNZBvZT8wAoe9hJ4favnZMvTTkNdT56DMNDcdWyheb3icfk4MS3udsP4R",
      "encrypted_value": "8fe253e6f15addfbce5c87583e970cb09294ec5b9fc7a1891c2ac34937e5a5c116c210ddf313f5fcccd8ee28cfeb0fa8e9",
      "register_height": 123,
      "update_height": 123,
      "txid": "b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123",
      "prev_txid": "f26efb11e8eb6b446c5e0247e8883f41689591356f7abe65afe9fe75f567d40e"
    }],
    "status": "OK"
  }
}

Inputs:

  • entries - string[]: The owner's public key to find all Loki Name Service entries for.

Outputs:

  • entries - response_entry[]
  • request_index - uint64: (Deprecated) The index in request's entries array that was resolved via Loki Name Service.
  • type - uint16: The category the Loki Name Service entry belongs to, currently only Session whose value is 0.
  • name_hash - string: The hash of the name that the owner purchased via Loki Name Service in base64
  • owner - string: The backup public key specified by the owner that purchased the Loki Name Service entry.
  • backup_owner - string: The backup public key specified by the owner that purchased the Loki Name Service entry.
  • encrypted_value - string: The encrypted value that the name maps to. This value is encrypted using the name (not the hash) as the secret.
  • register_height - uint64: The height that this Loki Name Service entry was purchased on the Blockchain.
  • update_height - uint64: The last height that this Loki Name Service entry was updated on the Blockchain.
  • txid - string: The txid of who purchases the mapping.
  • prev_txid - string: The previous txid that purchased the mapping, null hash if not applicable.
  • status - string: Generic RPC error code. "OK" is the success value.

LOGIN

Back to top

TODO: Undocumented light wallet RPC call

Inputs:

  • address - string
  • view_key - string
  • create_account - bool

Outputs:

  • status - string
  • reason - string
  • new_address - bool

LOKINET_PING

Back to top

Endpoints: lokinet_ping
Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "lokinet_ping",
  "params": {
    "version": ["TODO(loki): Write example string"]
  }
}
EOF

Inputs:

  • version - int[3]: Lokinet version

MINING_STATUS

Back to top

Get the mining status of the daemon.

Endpoints: mining_status

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "mining_status"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "active": true,
    "speed": 123,
    "threads_count": 8,
    "address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk",
    "pow_algorithm": "RandomX (LOKI variant)",
    "block_target": 2130706433,
    "block_reward": 123,
    "difficulty": 123
  }
}

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.
  • pow_algorithm - string: Current hashing algorithm name
  • block_target - uint32: The expected time to solve per block, i.e. DIFFICULTY_TARGET_V2
  • block_reward - uint64: Block reward for the current block being mined.
  • difficulty - uint64: The difficulty for the current block being mined.

OUT_PEERS

Back to top

Limit number of Outgoing peers.

Endpoints: out_peers

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "out_peers",
  "params": {
    "set": true,
    "out_peers": 2130706433
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "out_peers": 2130706433,
    "status": "OK"
  }
}

Inputs:

  • set - bool: If true, set the number of outgoing peers, otherwise the response returns the current limit of outgoing peers. (Defaults to true)
  • out_peers - uint32: Max number of outgoing peers

Outputs:

  • out_peers - uint32: The current limit set for outgoing peers
  • status - string: General RPC error code. "OK" means everything looks good.

PERFORM_BLOCKCHAIN_TEST

Back to top

TODO: Undocumented, -- unused

Endpoints: perform_blockchain_test

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "perform_blockchain_test",
  "params": {
    "max_height": 123,
    "seed": 123
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "res_height": 123
  }
}

Inputs:

  • max_height - uint64
  • seed - uint64

Outputs:

  • status - string
  • res_height - uint64

POP_BLOCKS

Back to top

Endpoints: pop_blocks
Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "pop_blocks",
  "params": {
    "nblocks": 123
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "height": 234767
  }
}

Inputs:

  • nblocks - uint64: Number of blocks in that span.

Outputs:

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

PRUNE_BLOCKCHAIN

Back to top

Endpoints: prune_blockchain
Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "prune_blockchain",
  "params": {
    "check": true
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "pruned": true,
    "pruning_seed": 2130706433,
    "status": "OK"
  }
}

Inputs:

  • check - bool

Outputs:

  • pruned - bool
  • pruning_seed - uint32
  • status - string

RELAY_TX

Back to top

Relay a list of transaction IDs.

Endpoints: relay_tx

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "relay_tx",
  "params": {
    "txids": ["b605cab7e3b9fe1f6d322e3167cd26e1e61c764afa9d733233ef716787786123"]
  }
}
EOF

Inputs:

  • txids - string[]: List of transactions IDs to relay from pool.

REPORT_PEER_SS_STATUS

Back to top

Endpoints: report_peer_storage_server_status
Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "report_peer_storage_server_status",
  "params": {
    "type": "TODO(loki): Write example string",
    "pubkey": "1de25fd280b9b08da62f06a5521c735fd94b7ecf237ca7409748295e75b48104",
    "passed": true
  }
}
EOF

Inputs:

  • type - string: test type (currently used: ["reachability"])
  • pubkey - string: service node pubkey
  • passed - bool: whether the node is passing the test

SAVE_BC

Back to top

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/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "save_bc"
}
EOF

SEND_RAW_TX

Back to top

Broadcast a raw transaction to the network.

Endpoints: send_raw_transaction, sendrawtransaction

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "send_raw_transaction",
  "params": {
    "tx_as_hex": "TODO(loki): Write example string",
    "do_not_relay": true,
    "do_sanity_checks": true,
    "blink": true
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "reason": "TODO(loki): Write example string",
    "not_relayed": true,
    "untrusted": false,
    "tvc": {
      "m_should_be_relayed": true,
      "m_verifivation_failed": true,
      "m_verifivation_impossible": true,
      "m_added_to_pool": true,
      "m_low_mixin": true,
      "m_double_spend": true,
      "m_invalid_input": true,
      "m_invalid_output": true,
      "m_too_big": true,
      "m_overspend": true,
      "m_fee_too_low": true,
      "m_not_rct": true,
      "m_invalid_version": true,
      "m_invalid_type": true,
      "m_key_image_locked_by_snode": true,
      "m_key_image_blacklisted": true,
      "m_verbose_error": "TODO(loki): Write example string",
      "m_vote_ctx": {
        "m_verification_failed": true,
        "m_invalid_block_height": true,
        "m_duplicate_voters": true,
        "m_validator_index_out_of_bounds": true,
        "m_worker_index_out_of_bounds": true,
        "m_signature_not_valid": true,
        "m_added_to_pool": true,
        "m_not_enough_votes": true,
        "m_incorrect_voting_group": true,
        "m_invalid_vote_type": true,
        "m_votes_not_sorted": true
      }
    },
    "sanity_check_failed": true,
    "blink_status": "TODO(loki): Write example string"
  }
}

Inputs:

  • tx_as_hex - string: Full transaction information as hexidecimal string.
  • do_not_relay - bool: (Optional: Default false) Stop relaying transaction to other nodes. Ignored if blink is true.
  • do_sanity_checks - bool: (Optional: Default true) Verify TX params have sane values.
  • blink - bool: (Optional: Default false) Submit this as a blink tx rather than into the mempool.

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, "Not relayed" if transaction was accepted but not relayed, or some descriptive message of why the tx failed.
  • 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
  • m_should_be_relayed - bool
  • m_verifivation_failed - bool: bad tx, should drop connection
  • m_verifivation_impossible - bool: the transaction is related with an alternative blockchain
  • m_added_to_pool - bool
  • m_low_mixin - bool
  • m_double_spend - bool
  • m_invalid_input - bool
  • m_invalid_output - bool
  • m_too_big - bool
  • m_overspend - bool
  • m_fee_too_low - bool
  • m_not_rct - bool
  • m_invalid_version - bool
  • m_invalid_type - bool
  • m_key_image_locked_by_snode - bool
  • m_key_image_blacklisted - bool
  • m_verbose_error - string
  • m_vote_ctx - vote_verification_context
    • m_verification_failed - bool
    • m_invalid_block_height - bool
    • m_duplicate_voters - bool
    • m_validator_index_out_of_bounds - bool
    • m_worker_index_out_of_bounds - bool
    • m_signature_not_valid - bool
    • m_added_to_pool - bool
    • m_not_enough_votes - bool
    • m_incorrect_voting_group - bool
    • m_invalid_vote_type - bool
    • m_votes_not_sorted - bool
  • sanity_check_failed - bool
  • blink_status - blink_result: 0 for a non-blink tx. For a blink tx: 1 means rejected, 2 means accepted, 3 means timeout.

SETBANS

Back to top

Ban another node by IP.

Endpoints: set_bans

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "set_bans",
  "params": {
    "bans": [{
      "host": "127.0.0.1",
      "ip": 2130706433,
      "ban": true,
      "seconds": 2130706433
    }]
  }
}
EOF

Inputs:

  • bans - ban[]: List of nodes to ban.
  • host - string: Host to ban (IP in A.B.C.D form - will support I2P address in the future).
  • ip - uint32: IP address to ban, in Int format.
  • ban - bool: Set true to ban.
  • seconds - uint32: Number of seconds to ban node.

SET_LIMIT

Back to top

Set daemon bandwidth limits.

Endpoints: set_limit

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "set_limit",
  "params": {
    "limit_down": 123,
    "limit_up": 123
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "limit_up": 123,
    "limit_down": 123
  }
}

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.

SET_LOG_CATEGORIES

Back to top

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.

You can append to the current the log level for updating just one or more categories while
leaving other log levels unchanged by specifying one or more "<category>:<level>" pairs
preceded by a "+", for example "+difficulty:DEBUG,net:WARNING".

Endpoints: set_log_categories

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "set_log_categories",
  "params": {
    "categories": "TODO(loki): Write example string"
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "categories": "TODO(loki): 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

SET_LOG_HASH_RATE

Back to top

Set the log hash rate display mode.

Endpoints: set_log_hash_rate

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "set_log_hash_rate",
  "params": {
    "visible": true
  }
}
EOF

Inputs:

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

SET_LOG_LEVEL

Back to top

Set the daemon log level. By default, log level is set to `0`.  For more fine-tuned logging
control set the set_log_categories command instead.

Endpoints: set_log_level

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "set_log_level",
  "params": {
    "level": 8
  }
}
EOF

Inputs:

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

START_MINING

Back to top

Start mining on the daemon.

Endpoints: start_mining

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "start_mining",
  "params": {
    "miner_address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk",
    "threads_count": 123,
    "num_blocks": 123,
    "slow_mining": true
  }
}
EOF

Inputs:

  • miner_address - string: Account address to mine to.
  • threads_count - uint64: Number of mining thread to run.
  • num_blocks - uint64: Mine until the blockchain has this many new blocks, then stop (no limit if 0, the default)
  • slow_mining - bool: Do slow mining (i.e. don't allocate RandomX cache); primarily intended for testing

STOP_DAEMON

Back to top

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/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "stop_daemon"
}
EOF

STOP_MINING

Back to top

Stop mining on the daemon.

Endpoints: stop_mining

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "stop_mining"
}
EOF

STORAGE_SERVER_PING

Back to top

Endpoints: storage_server_ping
Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "storage_server_ping",
  "params": {
    "version_major": 12345,
    "version_minor": 12345,
    "version_patch": 12345,
    "storage_lmq_port": 12345
  }
}
EOF

Inputs:

  • version_major - int32: Storage Server Major version
  • version_minor - int32: Storage Server Minor version
  • version_patch - int32: Storage Server Patch version
  • storage_lmq_port - uint16: Storage Server lmq port to include in uptime proofs

SUBMITBLOCK

Back to top

Submit a mined block to the network.

Endpoints: submit_block, submitblock

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "submit_block",
  "params": {
    "blob": ["TODO(loki): Write example string"]
  }
}
EOF

Inputs:

  • blob - string[]: Block blob data - array containing exactly one block blob string which has been mined. See get_block_template to get a blob on which to mine.

SUBMIT_RAW_TX

Back to top

TODO: Undocumented light wallet RPC call

Inputs:

  • address - string
  • view_key - string
  • tx - string
  • blink - bool

Outputs:

  • status - string
  • error - string

SYNC_INFO

Back to top

Get synchronisation information.

Endpoints: sync_info

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "sync_info"
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "height": 234767,
    "target_height": 123,
    "next_needed_pruning_seed": 2130706433,
    "peers": [{
      "info": {
        "incoming": true,
        "localhost": true,
        "local_ip": true,
        "ssl": true,
        "address": "L8KJf3nRQ53NTX1YLjtHryjegFRa3ZCEGLKmRxUfvkBWK19UteEacVpYqpYscSJ2q8WRuHPFdk7Q5W8pQB7Py5kvUs8vKSk",
        "host": "127.0.0.1",
        "ip": "TODO(loki): Write example string",
        "port": "62950",
        "rpc_port": 12345,
        "peer_id": "c959fbfbed9e44fb",
        "recv_count": 123,
        "recv_idle_time": 123,
        "send_count": 123,
        "send_idle_time": 123,
        "state": "TODO(loki): Write example string",
        "live_time": 123,
        "avg_download": 123,
        "current_download": 123,
        "avg_upload": 123,
        "current_upload": 123,
        "support_flags": 2130706433,
        "connection_id": "083c301a3030329a487adb12ad981d2c",
        "height": 234767,
        "pruning_seed": 2130706433,
        "address_type": 11
      }
    }],
    "spans": [{
      "start_block_height": 123,
      "nblocks": 123,
      "connection_id": "083c301a3030329a487adb12ad981d2c",
      "rate": 2130706433,
      "speed": 2130706433,
      "size": 123,
      "remote_address": "127.0.0.1:22023"
    }],
    "overview": "TODO(loki): Write example string"
  }
}

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good. Any other value means that something went wrong.
  • height - uint64: Block height.
  • target_height - uint64: Target height the node is syncing from (optional, absent if node is fully synced).
  • next_needed_pruning_seed - uint32
  • peers - peer[]: Array of Peer structure
  • info - connection_info: Structure of connection info, as defined in get_connections.
    • incoming - bool
    • localhost - bool
    • local_ip - bool
    • ssl - bool
    • address - string
    • host - string
    • ip - string
    • port - string
    • rpc_port - uint16
    • peer_id - string
    • recv_count - uint64
    • recv_idle_time - uint64
    • send_count - uint64
    • send_idle_time - uint64
    • state - string
    • live_time - uint64
    • avg_download - uint64
    • current_download - uint64
    • avg_upload - uint64
    • current_upload - uint64
    • support_flags - uint32
    • connection_id - string
    • height - uint64
    • pruning_seed - uint32
    • address_type - uint8
  • spans - span[]: Array of Span Structure.
  • start_block_height - uint64: Block height of the first block in that span.
  • nblocks - uint64: Number of blocks in that span.
  • connection_id - string: Id of connection.
  • rate - uint32: Connection rate.
  • speed - uint32: Connection speed.
  • size - uint64: Total number of bytes in that span's blocks (including txes).
  • remote_address - string: Peer address the node is downloading (or has downloaded) than span from.
  • overview - string

UPDATE

Back to top

Update daemon.

Endpoints: update

Example Request
curl -X POST http://127.0.0.1:22023/json_rpc \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "jsonrpc": "2.0",
  "id": "0",
  "method": "update",
  "params": {
    "command": "TODO(loki): Write example string",
    "path": "TODO(loki): Write example string"
  }
}
EOF

Example Response
{
  "jsonrpc": "2.0",
  "id": "0",
  "result": {
    "status": "OK",
    "update": true,
    "version": "7",
    "user_uri": "TODO(loki): Write example string",
    "auto_uri": "TODO(loki): Write example string",
    "hash": "bf430a3279f576ed8a814be25193e5a1ec61d3ee5729e64f47d8480ce5a2da70",
    "path": "TODO(loki): Write example string"
  }
}

Inputs:

  • command - string: Command to use, either check or download.
  • path - string: Optional, path where to download the update.

Outputs:

  • status - string: General RPC error code. "OK" means everything looks good.
  • update - bool: States if an update is available to download (true) or not (false).
  • version - string: Version available for download.
  • user_uri - string
  • auto_uri - string
  • hash - string
  • path - string: Path to download the update.

Binary

GET_ALT_BLOCKS_HASHES

Back to top

Get the known blocks hashes which are not on the main chain.

Endpoints: get_alt_blocks_hashes.bin

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_BLOCKS_BY_HEIGHT

Back to top

Get blocks by height. Binary request.

Endpoints: get_blocks_by_height.bin, getblocksbyheight.bin

Inputs:

  • heights - uint64[]: List of block heights

Outputs:

  • blocks - block_complete_entry[]: Array of block complete entries
  • block - string
  • txs - string[]
  • checkpoint - string
  • blinks - serializable_blink_metadata[]
    • tx_hash - string[64]
    • height - uint64
    • quorum - uint8[]
    • position - uint8[]
    • signature - string[128][]
  • 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_BLOCKS_FAST

Back to top

Get all blocks info. Binary request.

Endpoints: get_blocks.bin, getblocks.bin

Constants: 
 * `MAX_COUNT - uint64 = 1000`

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[]
  • checkpoint - string
  • blinks - serializable_blink_metadata[]
    • tx_hash - string[64]
    • height - uint64
    • quorum - uint8[]
    • position - uint8[]
    • signature - string[128][]
  • 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_HASHES_FAST

Back to top

Get hashes. Binary request.

Endpoints: get_hashes.bin, gethashes.bin

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

GET_OUTPUTS_BIN

Back to top

Get outputs. Binary request.

Endpoints: get_outs.bin

Inputs:

  • outputs - get_outputs_out[]: Array of structure get_outputs_out.
  • amount - uint64: Amount of Loki in TXID.
  • index - uint64
  • get_txid - bool: TXID

Outputs:

  • outs - outkey[]: List of outkey information.
  • key - string[64]: The public key of the output.
  • mask - string[64]
  • 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).

GET_OUTPUT_BLACKLIST

Back to top

Get information on output blacklist.

Endpoints: get_output_blacklist

Outputs:

  • blacklist - uint64[]: (Developer): Array of indexes from the global output list, corresponding to blacklisted key images.
  • 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.

GET_TRANSACTION_POOL_HASHES_BIN

Back to top

Get hashes from transaction pool. Binary request.

Endpoints: get_transaction_pool_hashes.bin

Inputs:

  • long_poll - bool: Optional: If true, this call is blocking until timeout OR tx pool has changed since the last query. TX pool change is detected by comparing the hash of all the hashes in the tx pool. Ignored when using LMQ RPC.
  • tx_pool_checksum - string[64]: Optional: If long_poll is true the caller must pass the hashes of all their known tx pool hashes, XOR'ed together. Ignored when using LMQ RPC.

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

GET_TX_GLOBAL_OUTPUTS_INDEXES

Back to top

Get global outputs of transactions. Binary request.

Endpoints: get_o_indexes.bin

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