RPC Command Use

TOP

This section explains how to execute a basic Nano RPC command and how they can be used while maintaining your Nano Node. Nano's RPC commands are in the form of a JSON HTTP POST request. This section is not a comprehensive list of the available commands. All available RPC Commands are listed in the Nano RPC Reference Documentation.

For consistency, all example commands will be issued with curl.

In order to issue RPC commands, the rai_node must be configured to accept RPC commands. This guide encourages the use of the official Docker image which has RPC commands enabled by default.

Checking Sync Status

To check if the node is in sync, check the block_count of the rai_node.

curl -d '{"action": "block_count"}' 127.0.0.1:7076
{
    "count": "572356",
    "unchecked": "6254543"
}
Key Meaning
count Number of valid blocks in local ledger
unchecked Number of cached blocks that are either unchecked (only relevant during bootstrapping) or don't fit into the current local ledger

If the count is similar to a reliable source, such as a block explorer, the rai_node is in sync. The number of unchecked blocks does not determine whether or not the node is in sync.