FANDOM


This is only a draft for a new version of the protocol. Please do NOT rely on it!



NOTES:

  • Every call should be invoked using HTTP POST messages
  • RPC services must enforce using the HTTPS protocol in order to keep the communication safe


Default URL: localhost:18081/rpc/


Method Description
query_network_info Returns information about the network's status, including information about the current block.

Input: N/A

Output: NetworkInformation

{
    "block_height_downloaded":   <UInt64>
    "block_height_total":        <UInt64>
    "block_current_difficulty":  <UInt64>
    "block_count_alternative":   <UInt64>
    "tx_count":                  <UInt64>
    "tx_pool_size":              <UInt64>
    "connection_count_incoming": <UInt64>
    "connection_count_outgoing": <UInt64>
    "peerlist_size_white":       <UInt64>
    "peerlist_size_grey":        <UInt64>
}
query_block_header_last Returns the header of the last downloaded block.

Input: N/A

Output: TypeBlockHeader

{
    "version_major": <UInt8>
    "version_minor": <UInt8>
    "timestamp":     <UInt64>
    "hash_current":  <String>
    "hash_previous": <String>
    "height":        <UInt64>
    "depth":         <UInt64>
    "difficulty":    <TypeDifficulty>
    "reward":        <UInt64>
    "nonce":         <UInt32>
    "is_orphaned":   <Bool>
}

TypeDifficulty:

<UInt64>
query_block_header_by_hash Returns the header of the block specified by a hash.

Input:

{
    "hash": <String>
}

Output: TypeBlockHeader

{
    "version_major": <UInt8>
    "version_minor": <UInt8>
    "timestamp":     <UInt64>
    "hash_current":  <String>
    "hash_previous": <String>
    "height":        <UInt64>
    "depth":         <UInt64>
    "difficulty":    <TypeDifficulty>
    "reward":        <UInt64>
    "nonce":         <UInt32>
    "is_orphaned":   <Bool>
}

TypeDifficulty:

<UInt64>

Errors:

Code Message
10 Invalid block hash.
query_block_header_by_height Returns the header of the block specified by height.

Input:

{
    "height": <UInt64>
}

Output: TypeBlockHeader

{
    "version_major": <UInt8>
    "version_minor": <UInt8>
    "timestamp":     <UInt64>
    "hash_current":  <String>
    "hash_previous": <String>
    "height":        <UInt64>
    "depth":         <UInt64>
    "difficulty":    <TypeDifficulty>
    "reward":        <UInt64>
    "nonce":         <UInt32>
    "is_orphaned":   <Bool>
}

TypeDifficulty:

<UInt64>

Errors:

Code Message
10 Invalid block height.
query_blocks Returns information about the blocks requested, including transactions in each block.

Input: List of block heights or hashes

{
    "hashes":                    List<String>
}

or

{
    "heights":                   List<UInt64>
}

Output: List<BlockInformation>

{
    "block_height":              <UInt64>
    "tx_count":                  <UInt64>
    "tx_hashes":                 <String>
    "payment_ids":               <String>
}
query_mining_status Returns the status of the miner function.

Input: N/A

Output:

{
    "is_active":      <Bool>
    "speed":          <UInt64>
    "wallet_address": <String>
    "threads_count":  <UInt32>
}
request_mining_start Starts miner threads.

Input:

{
    "wallet_address": <String>
    "threads_count":  <UInt64>
}

Output: N/A (Standard JSON output)

request_mining_stop Stops every miner thread.

Input: N/A

Output: N/A (Standard JSON output)

request_shutdown Disconnects safely from every node, and then terminates the daemon process.

Input: N/A

Output: N/A (Standard JSON output)

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.