trace
trace_replayBlockTransactions
Replays all transactions in a block and returns the requested traces for each transaction.
Replays all transactions in a block and returns the requested traces for each transaction.
Parameters
| # | Type | Description |
|---|---|---|
| 1 | string | Block number as hex string. |
| 2 | array | Array of trace types: "trace", "vmTrace", "stateDiff". |
Returns
| Type | Description |
|---|---|
array | Array of trace result objects, one per transaction in the block. |
Each Result Object
| Field | Type | Description |
|---|---|---|
trace | array | Call tree trace (if requested). |
vmTrace | object | VM execution trace (if requested). |
stateDiff | object | State changes (if requested). |
output | string | Return value of the transaction. |
transactionHash | string | Hash of the transaction. |
Example
curl -s -X POST https://rpc.pulsechain.box \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "trace_replayBlockTransactions",
"params": [
"0x100",
["trace"]
],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"output": "0x...",
"trace": [
{
"action": {
"callType": "call",
"from": "0x...",
"gas": "0x...",
"input": "0x...",
"to": "0x...",
"value": "0x0"
},
"result": {
"gasUsed": "0x...",
"output": "0x..."
},
"subtraces": 0,
"traceAddress": [],
"type": "call"
}
],
"transactionHash": "0x..."
}
]
}
TRY IT
Notes
- Combines
trace_blockfunctionality with the ability to requestvmTraceandstateDiff. - Very resource-intensive, especially with
vmTrace. Use with caution on blocks with many transactions. - All trace requests are routed to a an archive node with full trace support.
- An empty block returns an empty array.
