eth_getBlockByHash RPC Method
Fetches block details using the block's hash.
Parameters#
stringrequired
32-byte block hash, hex-encoded.
booleanrequired
When true, includes complete transaction objects; when false, only transaction hashes.
Result#
object | null - The block object, or null if no matching block exists.
Code sample#
{
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae",
false
],
"id": 1
}
Response#
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"hash": "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"number": "0x4b7",
"gasLimit": "0x1c9c380",
"gasUsed": "0x0",
"timestamp": "0x0",
"transactions": []
}
}
Try It