Plasma: eth, debug (4/4)
API reference for Plasma. 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
curl -X POST https://rpc.ankr.com/plasma/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "debug_traceTransaction",
"params": [
"0xad1587245b0d6351c443f86052cac39e7e16d4c98ecbab8995cc0b4b379a485a",
{
"tracer": "callTracer",
"timeout": "5s",
"tracerConfig": {
"onlyTopCall": true
}
}
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"from": "0xfa1711c6513b09b13ee8aeef0dff266114b4e97c",
"gas": "0x169e1",
"gasUsed": "0xedfc",
"to": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"input": "0xa9059cbb000000000000000000000000091c0e9517c1c5bf5a6bbc1573be193c8309a20d000000000000000000000000000000000000000000000000000000000510ff40",
"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/plasma/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "debug_traceCall",
"params": [
{
"to": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"data": "0x70a08231000000000000000000000000fa1711c6513b09b13ee8aeef0dff266114b4e97c"
},
"0x22fff26",
{
"tracer": "callTracer",
"timeout": "5s",
"tracerConfig": {
"onlyTopCall": true
}
}
],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"from": "0x0000000000000000000000000000000000000000",
"gas": "0x23c34600",
"gasUsed": "0x79c4",
"to": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
"input": "0x70a08231000000000000000000000000fa1711c6513b09b13ee8aeef0dff266114b4e97c",
"output": "0x0000000000000000000000000000000000000000000000000000009ef78e0705",
"value": "0x0",
"type": "CALL"
}
}