curl --request POST \
--url https://optimism-mainnet.core.chainstack.com/efb0a5eccd2caa5135eb54eba6f7f300 \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "debug_traceTransaction",
"id": 1,
"params": [
"0x2f6ff16a96580e1d51b91314c1bdf9339f2f7ce0e7a22228bbc65f419dd7be51"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {
"structLogs": [
{}
],
"gas": 123,
"returnValue": "<string>",
"gasUsed": 123,
"failed": true
}
}curl --request POST \
--url https://optimism-mainnet.core.chainstack.com/efb0a5eccd2caa5135eb54eba6f7f300 \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "debug_traceTransaction",
"id": 1,
"params": [
"0x2f6ff16a96580e1d51b91314c1bdf9339f2f7ce0e7a22228bbc65f419dd7be51"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {
"structLogs": [
{}
],
"gas": 123,
"returnValue": "<string>",
"gasUsed": 123,
"failed": true
}
}debug_traceTransaction RPC method retrieves a detailed execution trace of a transaction, identified by the transaction’s hash. This method is crucial for developers and analysts who need to understand the execution flow of a transaction, including all the operations (opcodes) executed, gas usage, and the transaction’s outcome.
debug_traceTransaction, send a POST request with a JSON RPC call in the body.
string): The hash of the transaction to trace.object): The detailed execution trace, including:
array): An array of execution steps (opcodes) taken by the transaction.integer): The gas provided by the transaction.string): The return value of the transaction, if any.integer): The total gas used by the transaction.boolean): Indicates whether the transaction failed.debug_traceTransaction method is essential for:
Was this page helpful?