curl --request POST \
--url https://nd-954-882-037.p2pify.com/66f812de2a6724a75a51f60dd6f2a154 \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "debug_getRawHeader",
"params": [
"latest"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}curl --request POST \
--url https://nd-954-882-037.p2pify.com/66f812de2a6724a75a51f60dd6f2a154 \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "debug_getRawHeader",
"params": [
"latest"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}debug_getRawBlock, this method returns only the header without transaction data, making it more efficient when only header information is needed.
arbtrace_* methods instead.quantity or tag — the block number in hex format or block tag (latest, earliest, pending, safe, finalized).data — the RLP-encoded block header as a hex string.debug_getRawHeader code examplesconst ethers = require('ethers');
const NODE_URL = "YOUR_CHAINSTACK_ENDPOINT";
const provider = new ethers.JsonRpcProvider(NODE_URL);
const debugGetRawHeader = async (block) => {
const result = await provider.send("debug_getRawHeader", [block]);
console.log(result);
};
debugGetRawHeader("latest");
debug_getRawHeader method is useful when you need to inspect or verify block headers without the overhead of retrieving full block data. This is particularly valuable for light client implementations, header chain verification, and tools that need to extract specific header fields like the state root, receipts root, or gas used from the raw RLP encoding.Was this page helpful?