getblock
Summary
If verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.
Description
If verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.
For witness-pruned historical blocks, this returns the stored block bytes, which may omit witness data.
If verbosity is 1, returns an Object with information about block
Arguments
blockhash(STR_HEX, required): The block hashverbosity(NUM): 0 for hex-encoded data, 1 for a JSON object, 2 for JSON object with transaction data, and 3 for JSON object with transaction data including prevout information for inputs
Results
value(STR_HEX): A string that is serialized, hex-encoded data for block 'hash'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 chainsize(NUM): The block sizestrippedsize(NUM): The block size excluding witness dataweight(NUM): The block weight; qbit fully counts witness dataheight(NUM): The block height or indexversion(NUM): The block versionversionHex(STR_HEX): The block version formatted in hexadecimalmerkleroot(STR_HEX): The merkle roottx(ARR): The transaction idsvalue(STR_HEX): The transaction id
time(NUM_TIME): The block time expressed in UNIX epoch timemediantime(NUM_TIME): The median block time expressed in UNIX epoch timenonce(NUM): The noncebits(STR_HEX): nBits: compact representation of the block difficulty targettarget(STR_HEX): The difficulty targetdifficulty(NUM): The difficultychainwork(STR_HEX): Expected number of hashes required to produce the chain up to this block (in hex)nTx(NUM): The number of transactions in the blockpreviousblockhash(STR_HEX, optional): The hash of the previous block (if available)nextblockhash(STR_HEX, optional): The hash of the next block (if available)value(OBJ): No description.value(ELISION): Same output as verbosity = 1tx(ARR): No description.value(OBJ): No description.value(ELISION): The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 "tx" resultfee(NUM): The transaction fee in QBT, omitted if block undo data is not available
value(OBJ): No description.value(ELISION): Same output as verbosity = 2tx(ARR): No description.value(OBJ): No description.vin(ARR): No description.value(OBJ): No description.value(ELISION): The same output as verbosity = 2prevout(OBJ): (Only if undo information is available)generated(BOOL): Coinbase or notheight(NUM): The height of the prevoutvalue(STR_AMOUNT): The value in QBTscriptPubKey(OBJ): No description.asm(STR): Disassembly of the output scriptdesc(STR): Inferred descriptor for the outputhex(STR_HEX): The raw output script bytes, hex-encodedaddress(STR, optional): The qbit address (only if a well-defined address exists)type(STR): The type (one of: nonstandard, anchor, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_scripthash, witness_v0_keyhash, witness_v1_taproot, witness_v2_p2mr, witness_unknown)
Examples
qbit-cli getblock "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"
curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "getblock", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"]}' -H 'content-type: application/json' http://127.0.0.1:8352/