post https://polygon-mainnet-archive.allthatnode.com:8545/
Similar to debug_traceBlock, traceBlockByNumber accepts a block number and will replay the block that is already present in the database. For the second parameter see TraceConfig reference.
Parameters
QUANTITY
|TAG
- integer block number, or the string "latest", "earliest" or "pending", see the default block parameterOBJECT
- The tracer object with the following fields:tracer
:STRING
- The type of tracer. It could be callTracer or prestateTracercallTracer
- The calltracer keeps track of all call frames, including depth 0 calls, that are made during a transactionprestateTracer
- The prestateTracer replays the transaction and tracks every part of state that occured during the transaction
tracerConfig
:OBJECT
- The object to specify the configurations of the traceronlyTopCall
:BOOLEAN
- When set to true, this will only trace the primary (top-level) call and not any sub-calls. It eliminates the additional processing for each call frame
curl https://polygon-mainnet-archive.allthatnode.com:8545/8U3JLUhzIDg3GShvy9hkCCSYkLGc11kj \
--request POST \
--header "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "debug_traceBlockByNumber",
"params": [
"latest",
{
"tracer": "callTracer",
"tracderConfig": {
"onlyTopCall": true
}
}
]
}'
Returns
An ARRAY
ofOBJECT
with the following fields:
txHash
:STRING
- transaction hashresult
:OBJECT
from
- The address the transaction is sent fromgas
- The integer of the gas provided for the transaction executiongasUsed
- The integer of the gas usedto
- The address the transaction is directed toinput
- The data given at the time of inputoutput
- The data which is returned as an outputcalls
:ARRAY
- A array of sub-call objectsvalue
- The hex encoded integer of the value sent with this transactiontype
- The type of the call
{
"jsonrpc": "2.0",
"id": "1",
"result": [
{
"txHash": "0x637eabe31da13cbc095b62668fcfabdf10277bde60ce879e0e3bd06c4db120cc",
"result": {
"from": "0x4e14529d962cba526a70435132cee96599675d45",
"gas": "0xbf4a",
"gasUsed": "0xbded",
"to": "0x6a9014fb802dcc5efe3b97fd40aaa632585636d0",
"input": "0x095ea7b3000000000000000000000000f403c135812408bfbe8713b5a23a04b3d48aae31000000000000000000000000000000000000000000000046681f67c89dd49af3",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"calls": [
{
"from": "0x6a9014fb802dcc5efe3b97fd40aaa632585636d0",
"gas": "0x5ed3",
"gasUsed": "0x5ed3",
"to": "0xc629a01ec23ab04e1050500a3717a2a5c0701497",
"input": "0x095ea7b3000000000000000000000000f403c135812408bfbe8713b5a23a04b3d48aae31000000000000000000000000000000000000000000000046681f67c89dd49af3",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"value": "0x0",
"type": "DELEGATECALL"
}
],
"value": "0x0",
"type": "CALL"
}
},
// another objects
]
}