eth_getBlockByHash
Gets a block for a given hash
- CURL
curl --request POST \
--url https://evm.confluxrpc.com \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"params": ["0x1768f524493543ac12785a8dd50e5a5b2c5b1ebaaef4f6202a5832783fad13bc",false],
"method": "eth_getBlockByHash"
}'
Params
blockHash required
Schema
type : string
Pattern :
^0x[0-9,a-f,A-F]{64}$
includeTransactions required
Schema
type : boolean
Result
Block representation
type : object
author author
type : stringPattern :^0x[0-9,a-f,A-F]{40}$
baseFeePerGas baseFeePerGas
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
difficulty difficulty
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
extraData extraData
type : stringPattern :^0x[0-9a-f]*$
gasLimit gasLimit
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
gasUsed gasUsed
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
hash hash
type : stringPattern :^0x[0-9,a-f,A-F]{64}$
logsBloom logsBloom
type : stringPattern :^0x[0-9,a-f,A-F]{512}$
miner miner
type : stringPattern :^0x[0-9,a-f,A-F]{40}$
mixHash mixHash
type : stringPattern :^0x[0-9,a-f,A-F]{64}$
nonce nonce
type : stringPattern :^0x[0-9,a-f,A-F]{16}$
number number
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
parentHash parentHash
type : stringPattern :^0x[0-9,a-f,A-F]{64}$
receiptsRoot receiptsRoot
type : stringPattern :^0x[0-9,a-f,A-F]{64}$
sha3uncle sha3uncle
type : stringPattern :^0x[0-9,a-f,A-F]{64}$
size size
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
stateRoot stateRoot
type : stringPattern :^0x[0-9,a-f,A-F]{64}$
timestamp timestamp
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
totalDifficulty totalDifficulty
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
transactions transactions
oneOf- (H256,...)[]
- (Transaction,...)[]
type : arrayitems[x]
H256type : stringPattern :^0x[0-9,a-f,A-F]{64}$
type : arrayitems[x]
Transactiontype : objectaccessList accessList
type : arrayitems[x]
AccessListItemtype : objectaddress address
type : stringPattern :^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
storageKeys storageKeys
type : arrayitems[x]
H256type : stringPattern :^0x[0-9,a-f,A-F]{64}$
blockHash blockHash
type : stringPattern :^0x[0-9,a-f,A-F]{64}$
blockNumber blockNumber
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
chainId chainId
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,15}|0)$
creates creates
type : stringPattern :^0x[0-9,a-f,A-F]{40}$
from from
type : stringPattern :^0x[0-9,a-f,A-F]{40}$
gas gas
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
gasPrice gasPrice
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
hash hash
type : stringPattern :^0x[0-9,a-f,A-F]{64}$
input input
type : stringPattern :^0x[0-9a-f]*$
maxFeePerGas maxFeePerGas
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
maxPriorityFeePerGas maxPriorityFeePerGas
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
nonce nonce
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
publicKey publicKey
type : stringPattern :^0x[0-9,a-f,A-F]{128}$
r r
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
raw raw
type : stringPattern :^0x[0-9a-f]*$
s s
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
standardV standardV
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
status status
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,15}|0)$
to to
type : stringPattern :^0x[0-9,a-f,A-F]{40}$
transactionIndex transactionIndex
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
transactionType transactionType
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,15}|0)$
v v
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
value value
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
yParity yParity
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,15}|0)$
transactionsRoot transactionsRoot
type : stringPattern :^0x[0-9,a-f,A-F]{64}$
uncles uncles
type : arrayitems[x]
H256type : stringPattern :^0x[0-9,a-f,A-F]{64}$
Examples
- eth_getBlockByHash
- eth_getBlockByHash
- eth_getBlockByHash
- eth_getBlockByHash
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getBlockByHash",
"params": [
"0x1768f524493543ac12785a8dd50e5a5b2c5b1ebaaef4f6202a5832783fad13bc"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"author": "0x12794484b0a6b0f1fcee72b29d322e93e9de5aac",
"difficulty": "0x307fa8e",
"extraData": "0x",
"gasLimit": "0x1c9c380",
"gasUsed": "0xcee2a",
"hash": "0x1768f524493543ac12785a8dd50e5a5b2c5b1ebaaef4f6202a5832783fad13bc",
"logsBloom": "0x0020000000040000000000008000000000000002004000000000004200000000000000000000000000000000000000000000000000000400000000000080000000000040400400000000000800100020000000200000000880000000808054000000000000000800000000000000080000000000001000000000001000000000000000000000000000001000c000000000000001008000080000044000404000000000800000000000000000000000000000014100000000000000000001000000000002400000020080000000000000200100002000001000008000000000000000000000000000400020000000000800000002800800400000000000001000",
"miner": "0x12794484b0a6b0f1fcee72b29d322e93e9de5aac",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x000000000007b23f",
"number": "0x43543a1",
"parentHash": "0x5d7eaaa76573015a54aee6488eb13d8ec00bc6f4bc3089dfb88794ca7f39483d",
"receiptsRoot": "0x01f0410ef63f4ccf82b01199c9474a155b94bba110c70bdd057d4e6c8ed81b76",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x30d",
"stateRoot": "0xf4053634693102b431dce144d09bc98d1a2c55fe9d7a3aac07b635598ae65fc9",
"timestamp": "0x624e8191",
"totalDifficulty": "0x0",
"transactions": [
"0x1bbc639c7dd00b9a09e51b606137be180c7812c8a752aa90d89fb6b22ef45807",
"0x142febc57ab34e731da29cd68f5330f54311ddab11827ca4a0734ff219548602",
"0xb0312f4972128d4bfee5162ee10cdbea6d0252c337db0c88fed6ce4c16ce8008"
],
"transactionsRoot": "0x88f46d2a970b199cf94bb9fe88f5cc0cb52dffa66e5c6a4ac6b6eeda51b69d53",
"uncles": []
}