Bitcoin-SONs Sanity Checks

CLI checks to ensure the successful installation of Bitcoin-SON node.

After installing a Bitcoin SON node, you might want to run some basic tests to ensure everything is running smoothly with your Bitcoin node. Here are a few bitcoin-cli commands that you can run to check your node's functionality.

You can use these commands to get an overview of the Bitcoin network, how your node connects to the network, and your configured wallet and address settings.

1. bitcoin-cli help

List all commands, or get help for a specified command.

bitcoin-cli help "command"

# For example...
# bitcoin-cli help "getblockchaininfo"

The "command" in the above code block can be one of any bitcoin-cli commands listed in the reference doc. It's also optional and if left out will list all available commands. The help command is a good place to start to ensure the bitcoin-cli is actually available on your system.

2. getblockchaininfo

Returns an object containing various state info regarding blockchain processing.

bitcoin-cli getblockchaininfo

This command doesn't have any parameters. Running this command will list a lot of important information about the chain and your node. This is the command to use to see how much of the chain your node has validated and that you are connected to Bitcoin's mainnet. Here's what is returned in the call:

{                                         (json object)
  "chain" : "str",                        (string) current network name (main, test, regtest)
  "blocks" : n,                           (numeric) the height of the most-work fully-validated chain. The genesis block has height 0
  "headers" : n,                          (numeric) the current number of headers we have validated
  "bestblockhash" : "str",                (string) the hash of the currently best block
  "difficulty" : n,                       (numeric) the current difficulty
  "mediantime" : n,                       (numeric) median time for the current best block
  "verificationprogress" : n,             (numeric) estimate of verification progress [0..1]
  "initialblockdownload" : true|false,    (boolean) (debug information) estimate of whether this node is in Initial Block Download mode
  "chainwork" : "hex",                    (string) total amount of work in active chain, in hexadecimal
  "size_on_disk" : n,                     (numeric) the estimated size of the block and undo files on disk
  "pruned" : true|false,                  (boolean) if the blocks are subject to pruning
  "pruneheight" : n,                      (numeric) lowest-height complete block stored (only present if pruning is enabled)
  "automatic_pruning" : true|false,       (boolean) whether automatic pruning is enabled (only present if pruning is enabled)
  "prune_target_size" : n,                (numeric) the target size used by pruning (only present if automatic pruning is enabled)
  "softforks" : {                         (json object) status of softforks
    "xxxx" : {                            (json object) name of the softfork
      "type" : "str",                     (string) one of "buried", "bip9"
      "bip9" : {                          (json object) status of bip9 softforks (only for "bip9" type)
        "status" : "str",                 (string) one of "defined", "started", "locked_in", "active", "failed"
        "bit" : n,                        (numeric) the bit (0-28) in the block version field used to signal this softfork (only for "started" status)
        "start_time" : xxx,               (numeric) the minimum median time past of a block at which the bit gains its meaning
        "timeout" : xxx,                  (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
        "since" : n,                      (numeric) height of the first block to which the status applies
        "statistics" : {                  (json object) numeric statistics about BIP9 signalling for a softfork (only for "started" status)
          "period" : n,                   (numeric) the length in blocks of the BIP9 signalling period
          "threshold" : n,                (numeric) the number of blocks with the version bit set required to activate the feature
          "elapsed" : n,                  (numeric) the number of blocks elapsed since the beginning of the current period
          "count" : n,                    (numeric) the number of blocks with the version bit set in the current period
          "possible" : true|false         (boolean) returns false if there are not enough blocks left in this period to pass activation threshold
        }
      },
      "height" : n,                       (numeric) height of the first block which the rules are or will be enforced (only for "buried" type, or "bip9" type with "active" status)
      "active" : true|false               (boolean) true if the rules are enforced for the mempool and the next block
    },
    ...
  },
  "warnings" : "str"                      (string) any network and blockchain warnings
}

3. getmempoolinfo

Returns details on the active state of the TX memory pool.

circle-info

The TX memory pool, or "mempool", is the pool of unverified transactions that don't yet belong to a block in the chain. These transactions are basically waiting for miners to verify and include them in blocks to make them official.

This command is useful to view the network backlog of transactions. Here's what is returned:

4. getnetworkinfo

Returns an object containing various state info regarding P2P networking.

This command is important for understanding the network connections of your node. Here is what is returned in this call:

5. getwalletinfo

Returns an object containing various wallet state info.

This shows the configuration of any wallets belonging to your node. In our case this will show us the "son-wallet" we should have set up. Here's what's returned:

6. getaddressinfo

Return information about the given bitcoin address.

circle-info

Some of the information will only be present if the address is in the active wallet.

This is how you can view the pubkey for your Bitcoin addresses. Much more than that is returned:

7. References

Last updated

Was this helpful?