trace
trace_block
Returns all traces created during execution of all transactions in a block. This uses the OpenEthereum trace format.
Returns all traces created during execution of all transactions in a block. This uses the OpenEthereum trace format.
Parameters
| # | Type | Description |
|---|---|---|
| 1 | string | Block number as hex string. |
Returns
| Type | Description |
|---|---|
array | Array of trace objects for every internal operation in the block. |
Trace Object Fields
| Field | Type | Description |
|---|---|---|
action | object | Details of the operation (from, to, value, gas, input, callType). |
result | object | Output of the operation (gasUsed, output). |
subtraces | number | Number of child traces. |
traceAddress | array | Position in the trace tree (empty array for top-level calls). |
type | string | Operation type: "call", "create", "suicide", or "reward". |
blockNumber | number | Block number containing this trace. |
transactionHash | string | Transaction hash (null for block rewards). |
transactionPosition | number | Index of the transaction in the block. |
Example
curl -s -X POST https://rpc.pulsechain.box \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "trace_block",
"params": ["0x100"],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"action": {
"callType": "call",
"from": "0x...",
"gas": "0x...",
"input": "0x...",
"to": "0x...",
"value": "0x0"
},
"blockHash": "0x...",
"blockNumber": 256,
"result": {
"gasUsed": "0x...",
"output": "0x..."
},
"subtraces": 0,
"traceAddress": [],
"transactionHash": "0x...",
"transactionPosition": 0,
"type": "call"
}
]
}
TRY IT
Notes
- Block rewards appear as traces with
type: "reward"and notransactionHash. - The
traceAddressarray shows the path through nested calls.[]is the top-level call,[0]is the first internal call,[0, 1]is the second sub-call of the first internal call, etc. - All trace requests are routed to a an archive node with full trace support.
- Response size grows with block complexity. Blocks with many DeFi interactions can produce thousands of traces.
