debug
debug_traceBlockByNumber
Traces all transactions in a block by block number. Returns an array of traces, one per transaction in the block.
Traces all transactions in a block by block number. Returns an array of traces, one per transaction in the block.
Parameters
| # | Type | Description |
|---|---|---|
| 1 | string | Block number as hex string, or "latest". |
| 2 | object | (optional) Tracer options (same as debug_traceTransaction). |
Tracer Options
| Field | Type | Description |
|---|---|---|
tracer | string | Tracer type: "callTracer" or "prestateTracer". |
timeout | string | Maximum duration for the trace (e.g., "30s"). |
Returns
| Type | Description |
|---|---|
array | Array of trace results, one per transaction in the block. Each element has a result field containing the trace. |
Example
curl -s -X POST https://rpc.pulsechain.box \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "debug_traceBlockByNumber",
"params": [
"0x100000",
{"tracer": "callTracer"}
],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"txHash": "0x...",
"result": {
"type": "CALL",
"from": "0x...",
"to": "0x...",
"value": "0x0",
"gas": "0x...",
"gasUsed": "0x...",
"input": "0x...",
"output": "0x..."
}
}
]
}
TRY IT
Notes
- Tracing an entire block can be very slow and resource-intensive, especially for blocks with many transactions.
- Use the
timeoutparameter to avoid long-running requests. - The response size scales with the number of transactions in the block and the complexity of each trace.
- Consider tracing individual transactions with
debug_traceTransactionwhen possible.
