World Chain: eth, debug (4/4)
API reference for World Chain. All methods ->
debug_traceTransaction
Traces the execution of a transaction specified by hash.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<transactionHash>(string; required): the hash of the transaction to trace.<object>(optional): the tracing options:tracer(string): the tracer to use, for examplecallTracerorprestateTracer.tracerConfig(object): tracer options, for example{"onlyTopCall": true}forcallTracerto skip internal calls.timeout(string): the tracing timeout, for example"5s".
Returns
<object>: the trace produced by the tracer selected.
Request example
Ankr's World Chain nodes keep receipts, logs, and state for the most recent ~100,000 blocks, about 55 hours. The block and transaction in this example were recent when this page was written; to run it, replace them with ones from that window.
curl -X POST https://rpc.ankr.com/worldchain/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "debug_traceTransaction",
"params": [
"0xe607038ada0169406eb384806f47215946431f550279e83489f10dd7ca192618",
{
"tracer": "callTracer",
"timeout": "5s",
"tracerConfig": {
"onlyTopCall": true
}
}
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"from": "0x0774f5544f32a7a5e33803f2ebd8264765f4ccbc",
"gas": "0x30d40",
"gasUsed": "0x73b4",
"to": "0x2cfc85d8e48f8eab294be644d9e25c3030863003",
"input": "0xa9059cbb00000000000000000000000090ed778edda7ea75f9b331a138a546b1c6e3b6fe0000000000000000000000000000000000000000000000dfe3437e527b480000",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"value": "0x0",
"type": "CALL"
}
}
debug_traceCall
Traces a call executed on top of the state of a block specified, without creating a transaction.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):<object>(required): the call object, the same as foreth_call:from,to,gas,gasPrice,value,data.<string>(required): a block number in hex, or one of the tagslatest,earliest,pending.<object>(optional): the tracing options, the same as fordebug_traceTransaction.
Returns
<object>: the trace produced by the tracer selected.
Request example
curl -X POST https://rpc.ankr.com/worldchain/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "debug_traceCall",
"params": [
{
"to": "0x2cfc85d8e48f8eab294be644d9e25c3030863003",
"data": "0x70a082310000000000000000000000000774f5544f32a7a5e33803f2ebd8264765f4ccbc"
},
"latest",
{
"tracer": "callTracer",
"timeout": "5s",
"tracerConfig": {
"onlyTopCall": true
}
}
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"from": "0x0000000000000000000000000000000000000000",
"gas": "0x2faf080",
"gasUsed": "0x5dba",
"to": "0x2cfc85d8e48f8eab294be644d9e25c3030863003",
"input": "0x70a082310000000000000000000000000774f5544f32a7a5e33803f2ebd8264765f4ccbc",
"output": "0x0000000000000000000000000000000000000000000000000000000000000000",
"value": "0x0",
"type": "CALL"
}
}