For the complete documentation index, see llms.txt. This page is also available as Markdown.

eth_getBlockByHash - Robinhood

Example code for the eth_getBlockByHash JSON-RPC method. Complete guide to using the eth_getBlockByHash JSON-RPC method in GetBlock.io Web3 documentation.

Returns block information by hash. Pass true as the second parameter to include full transaction objects; false to receive only transaction hashes. Robinhood Chain blocks may include an additional l1BlockNumber field indicating the L1 block that included the batch containing this L2 block.

Parameters

Parameter
Type
Required
Description

blockHash

DATA (32 bytes)

Yes

Block hash

fullTransactions

boolean

Yes

true for full transaction objects, false for hashes only

Request Example

curl --location --request POST 'https://shared.us-east-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getBlockByHash",
    "params": [
        "0x8b5c6f1a9e8d7c6b5a4f3e2d1c0b9a8e7f6d5c4b3a2b1f9e8d7c6b5a4f3e2d1c",
        false
    ],
    "id": "getblock.io"
}'
import axios from 'axios';

const data = JSON.stringify({
    "jsonrpc": "2.0",
    "method": "eth_getBlockByHash",
    "params": [
        "0x8b5c6f1a9e8d7c6b5a4f3e2d1c0b9a8e7f6d5c4b3a2b1f9e8d7c6b5a4f3e2d1c",
        false
    ],
    "id": "getblock.io"
});

const config = {
    method: 'post',
    url: 'https://shared.us-east-1.getblock.io/<ACCESS-TOKEN>/',
    headers: {
        'Content-Type': 'application/json'
    },
    data: data
};

axios(config)
    .then(response => console.log(JSON.stringify(response.data, null, 2)))
    .catch(error => console.log(error));

Response Example

Response Parameters

Field
Type
Description

result.number

QUANTITY

Block number

result.hash

DATA

Block hash

result.parentHash

DATA

Parent block hash

result.timestamp

QUANTITY

Unix timestamp of block creation

result.miner

DATA

Address that produced the block (sequencer address on Arbitrum Orbit)

result.gasLimit

QUANTITY

Maximum gas allowed in the block

result.gasUsed

QUANTITY

Total gas used by all transactions

result.baseFeePerGas

QUANTITY

EIP-1559 base fee

result.l1BlockNumber

QUANTITY

Arbitrum-specific: L1 block that included the batch containing this L2 block

result.transactions

array

Transaction hashes (or full objects if requested)

Use Cases

  • Block-by-block indexing in explorers

  • Verifying that a specific block exists and is canonical

  • Tracking L1 anchoring via the l1BlockNumber field

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

-32603

Internal error

Server-side error while processing the request

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?