Returns global information about the blockchain, such as the current block height, chain name, protocol version, difficulty, and consensus status.
Arguments
- conn
A connection object created by
mc_connect.
Value
A list with blockchain metadata. Typical fields:
- chain
Name of the chain.
- blocks
Current block height.
- headers
Number of block headers.
- bestblockhash
Hash of the most recent block.
- difficulty
Current mining difficulty.
- chainwork
Total work in the chain.
See also
mc_get_chain_totals for counts of entities,
mc_get_last_block_info for the most recent block.
Other blockchain information:
mc_get_block(),
mc_get_block_hash(),
mc_get_chain_totals(),
mc_get_last_block_info(),
mc_list_blocks(),
mc_list_miners()
Examples
if (FALSE) { # \dontrun{
info <- mc_get_blockchain_info(conn)
print(info$blocks)
} # }