cfx_getBlockByHash
Returns block with given hash.
Params
(2)1. block_hash (required)
string
Match pattern:
^0x[0-9,a-f,A-F]{64}$
2. include_txs (required)
boolean
Result
(cfx_getBlockByHash_result)object or null
adaptive
booleanbaseFeePerGas
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
blame
stringMatch pattern:
^0x([1-9a-f][0-9a-f]{0,15}|0)$
blockNumber
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
custom
array[string]deferredLogsBloomHash
stringMatch pattern:
^0x[0-9,a-f,A-F]{64}$
deferredReceiptsRoot
stringMatch pattern:
^0x[0-9,a-f,A-F]{64}$
deferredStateRoot
stringMatch pattern:
^0x[0-9,a-f,A-F]{64}$
difficulty
stringMatch pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
epochNumber
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
gasLimit
stringMatch pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
gasUsed
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
hash
stringMatch pattern:
^0x[0-9,a-f,A-F]{64}$
height
stringMatch pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
miner
stringMatch pattern:
^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
nonce
stringMatch pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
parentHash
stringMatch pattern:
^0x[0-9,a-f,A-F]{64}$
posReference
string or null
Match pattern:
^0x[0-9,a-f,A-F]{64}$
powQuality
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
refereeHashes
array[string]size
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
timestamp
stringMatch pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
transactions
transactionsRoot
stringMatch pattern:
^0x[0-9,a-f,A-F]{64}$
Examples
Request
curl -X POST --data \
'{
"method": "cfx_getBlockByHash",
"params": [
"0x0000000000000000000000000000000000000000000000000000000000000000",
false
],
"jsonrpc": "2.0",
"id": 1
}' \
-H "Content-Type: application/json" \
localhost:12539
Result
null