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": []
}
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getBlockByHash",
"params": [
"0x1768f524493543ac12785a8dd50e5a5b2c5b1ebaaef4f6202a5832783fad13bc",
true
]
}' \
-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": [
{
"blockHash": "0x1768f524493543ac12785a8dd50e5a5b2c5b1ebaaef4f6202a5832783fad13bc",
"blockNumber": "0x43543a1",
"chainId": "0x47",
"creates": null,
"from": "0x6bc6e87998fdb681afa45c4c4abbd0a1091684d8",
"gas": "0x51615",
"gasPrice": "0x1",
"hash": "0x1bbc639c7dd00b9a09e51b606137be180c7812c8a752aa90d89fb6b22ef45807",
"input": "0x7ff36ab5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000006bc6e87998fdb681afa45c4c4abbd0a1091684d800000000000000000000000000000000000000000000000000000000624e82b900000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ed3dddae5b2f321af0806181fbfa6d049be47d80000000000000000000000007d682e65efc5c13bf4e394b8f376c48e6bae0355",
"nonce": "0x1",
"publicKey": "0x1b115c131ad6acb6f88afd3403549eb2178b77998ac7029dd6f6e3d976c7466d1407cf9b7c8feb7422b5b106fb8d301c08887b6fa25bfc4acff79c4c485064fe",
"r": "0x8f59561733353ec50b1174e7f8cae8d52575619f642677ee749de205dee55990",
"raw": "0xf9014d01018305161594873789aaf553fd0b4252d0d2b72c6331c47aff2e888ac7230489e80000b8e47ff36ab5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000006bc6e87998fdb681afa45c4c4abbd0a1091684d800000000000000000000000000000000000000000000000000000000624e82b900000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ed3dddae5b2f321af0806181fbfa6d049be47d80000000000000000000000007d682e65efc5c13bf4e394b8f376c48e6bae035581b2a08f59561733353ec50b1174e7f8cae8d52575619f642677ee749de205dee559909f71a98449773de4c42bf6f1e50f40ec6c736c2eb6196229eb28f9312e6657a0",
"s": "0x71a98449773de4c42bf6f1e50f40ec6c736c2eb6196229eb28f9312e6657a0",
"standardV": "0x1",
"status": "0x1",
"to": "0x873789aaf553fd0b4252d0d2b72c6331c47aff2e",
"transactionIndex": "0x0",
"v": "0xb2",
"value": "0x8ac7230489e80000"
},
{
"blockHash": "0x1768f524493543ac12785a8dd50e5a5b2c5b1ebaaef4f6202a5832783fad13bc",
"blockNumber": "0x43543a1",
"chainId": "0x47",
"creates": null,
"from": "0x548f383c9946dbc8d35dd431ee914acab84b8ff3",
"gas": "0x51615",
"gasPrice": "0x1",
"hash": "0x142febc57ab34e731da29cd68f5330f54311ddab11827ca4a0734ff219548602",
"input": "0x7ff36ab500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000548f383c9946dbc8d35dd431ee914acab84b8ff300000000000000000000000000000000000000000000000000000000624e82ba00000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ed3dddae5b2f321af0806181fbfa6d049be47d800000000000000000000000049916ba65d0048c4bbb0a786a527d98d10a1cd2d",
"nonce": "0x0",
"publicKey": "0x0f711235c303b20f789978e765df5e5d73f629c5caa3c06ee1145ff817d45070ce7e413037d0353f6863e4c1336e9ea15b4aefcea8b1619660516bf9e30cdb49",
"r": "0x6a479fd459f97744d4c9ed2ac52d4e3206fe5bcc07b30c582eb1395a6fde1db",
"raw": "0xf9014e80018305161594873789aaf553fd0b4252d0d2b72c6331c47aff2e888ac7230489e80000b8e47ff36ab500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000548f383c9946dbc8d35dd431ee914acab84b8ff300000000000000000000000000000000000000000000000000000000624e82ba00000000000000000000000000000000000000000000000000000000000000020000000000000000000000002ed3dddae5b2f321af0806181fbfa6d049be47d800000000000000000000000049916ba65d0048c4bbb0a786a527d98d10a1cd2d81b2a006a479fd459f97744d4c9ed2ac52d4e3206fe5bcc07b30c582eb1395a6fde1dba0430087fce1bf8acde94419f1b0b27a5227668fc8b3076758734b150919cf94a9",
"s": "0x430087fce1bf8acde94419f1b0b27a5227668fc8b3076758734b150919cf94a9",
"standardV": "0x1",
"status": "0x1",
"to": "0x873789aaf553fd0b4252d0d2b72c6331c47aff2e",
"transactionIndex": "0x1",
"v": "0xb2",
"value": "0x8ac7230489e80000"
},
{
"blockHash": "0x1768f524493543ac12785a8dd50e5a5b2c5b1ebaaef4f6202a5832783fad13bc",
"blockNumber": "0x43543a1",
"chainId": "0x47",
"creates": null,
"from": "0x8d86bc475bedcb08179c5e6a4d494ebd3b44ea8b",
"gas": "0x64da4",
"gasPrice": "0x1",
"hash": "0xb0312f4972128d4bfee5162ee10cdbea6d0252c337db0c88fed6ce4c16ce8008",
"input": "0x9c312cfd",
"nonce": "0x813",
"publicKey": "0x12ad2589e15771fdefad4491915ecc2d895bd7b81a4bb12d136e2075ebe47e84e9cc1d223520a18dd32cddfd8dad8d22204c117f77e26dec4b83807fb123d681",
"r": "0x445441721c00b8404e5e599d50db2f37ff18912ac7066f7a2e0a25d67bc8cca9",
"raw": "0xf86a8208130183064da494e4cff55f193b3493f1aa6811738309b2acf6c96383036ee8849c312cfd81b1a0445441721c00b8404e5e599d50db2f37ff18912ac7066f7a2e0a25d67bc8cca9a0567d39820042e94bb3d469a37edc98c70578cc76447b90f8a3e0076509d4bc30",
"s": "0x567d39820042e94bb3d469a37edc98c70578cc76447b90f8a3e0076509d4bc30",
"standardV": "0x0",
"status": "0x1",
"to": "0xe4cff55f193b3493f1aa6811738309b2acf6c963",
"transactionIndex": "0x2",
"v": "0xb1",
"value": "0x36ee8"
}
],
"transactionsRoot": "0x88f46d2a970b199cf94bb9fe88f5cc0cb52dffa66e5c6a4ac6b6eeda51b69d53",
"uncles": []
}
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getBlockByHash",
"params": [
"0x0000000000000000000000000000000000000000000000000000000000000000"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
null
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getBlockByHash",
"params": [
"0x0000000000000000000000000000000000000000000000000000000000000000",
true
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
null