Skip to contents

Returns global information about the blockchain, such as the current block height, chain name, protocol version, difficulty, and consensus status.

Usage

mc_get_blockchain_info(conn)

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

Examples

if (FALSE) { # \dontrun{
info <- mc_get_blockchain_info(conn)
print(info$blocks)
} # }