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_printBlock",
"params": [
30000000
]
}
'{
"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_printBlock",
"params": [
30000000
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}eth_getBlockByNumber which returns structured JSON, this method returns a verbose text dump of the entire block structure including all header fields, transactions, and uncles. The output format uses Go’s spew.Sdump formatting.
arbtrace_* methods instead.number — the block number as a decimal integer.result — a human-readable string representation of the block, including all internal fields and nested structures.debug_printBlock code examplesconst ethers = require('ethers');
const NODE_URL = "YOUR_CHAINSTACK_ENDPOINT";
const provider = new ethers.JsonRpcProvider(NODE_URL);
const debugPrintBlock = async (blockNumber) => {
const result = await provider.send("debug_printBlock", [blockNumber]);
console.log(result);
};
debugPrintBlock(30000000);
debug_printBlock method is useful for quick debugging when you need a comprehensive view of a block’s internal structure. The human-readable output format reveals all fields including those not typically exposed by standard RPC methods, making it valuable for diagnosing block-level issues and understanding the complete block composition.Was this page helpful?