getblockheader

Back to blockchain

Summary

If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'.

Description

If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'. If verbose is true, returns an Object with information about blockheader .

Arguments

  • blockhash (STR_HEX, required): The block hash
  • verbose (BOOL): true for a json object, false for the hex-encoded data

Results

  • value (OBJ): No description.
  • hash (STR_HEX): the block hash (same as provided)
  • confirmations (NUM): The number of confirmations, or -1 if the block is not on the main chain
  • height (NUM): The block height or index
  • version (NUM): The block version
  • versionHex (STR_HEX): The block version formatted in hexadecimal
  • merkleroot (STR_HEX): The merkle root
  • time (NUM_TIME): The block time expressed in UNIX epoch time
  • mediantime (NUM_TIME): The median block time expressed in UNIX epoch time
  • nonce (NUM): The nonce
  • bits (STR_HEX): nBits: compact representation of the block difficulty target
  • target (STR_HEX): The difficulty target
  • difficulty (NUM): The difficulty
  • chainwork (STR_HEX): Expected number of hashes required to produce the current chain
  • nTx (NUM): The number of transactions in the block
  • previousblockhash (STR_HEX, optional): The hash of the previous block (if available)
  • nextblockhash (STR_HEX, optional): The hash of the next block (if available)
  • value (STR_HEX): A string that is serialized, hex-encoded data for block 'hash'

Examples

qbit-cli getblockheader "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"
curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "getblockheader", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"]}' -H 'content-type: application/json' http://127.0.0.1:8352/