getblockheaderbyheight
Returns a block header by the given block height.
Request
{
"jsonrpc": "2.0",
"id": 0,
"method": "getblockheaderbyheight",
"params": {
"height": 1
}
}
Request parameters
- height - unsigned int; the main-chain height of the block whose header is requested.
0is the genesis block. The height must be less than the current blockchain size, otherwise the call returns a "too big height" error.
Response
{
"id": 0,
"jsonrpc": "2.0",
"result": {
"block_header": {
"depth": 2114588,
"difficulty": "1",
"hash": "901214ab938219f5b33b547008607aee14d29950a34834a2e9973b96269bd0b0",
"height": 1,
"major_version": 0,
"minor_version": 0,
"nonce": 1532031558827332528,
"orphan_status": false,
"prev_hash": "cc608f59f8080e2fbfe3c8c80eb6e6a953d47cf2d6aebd345bada3a1cab99852",
"reward": 1000000000000,
"timestamp": 1557342384
},
"status": "OK"
}
}
Response information
- depth - unsigned int; distance in blocks from the blockchain top, i.e. the number of blocks mined on top of this one.
0means this block is the current top block. - difficulty - unsigned int; block difficulty.
- hash - string; block identifier.
- height - unsigned int; block height.
- major_version - unsigned int; major version of a block.
- minor_version - unsigned int; minor version of a block.
- nonce - unsigned int; block nonce.
- orphan_status - boolean; indicates whether the block is an alternative (orphaned) block rather than part of the main chain. This call looks blocks up by main-chain height, so the value is always
false. - prev_hash - string; hex-encoded identifier of the previous block, i.e. the block this one was built on top of.
- reward - unsigned int; how much money this block has generated.
- status - string; call result.
OKif the header has been retrieved successfully, otherwise an error string such asBUSY. - timestamp - unsigned int; block timestamp.