Skip to main content

trace_replayTransaction

POST

Re-executes a specified transaction and traces all events that occur during the process. Since the transaction execution is performed locally, it is not reflected on the actual blockchain. This method is used when you want to reproduce and analyze the execution of a past transaction.
param[0]
transactionHashstringrequired
Transaction hash is the unique identifier of a transaction. Transaction hashes are expressed as 64-digit hexadecimal strings.
param[1]
traceTypearrayrequired
Trace type specifies the data types used when querying detailed execution information for a specific transaction or block on the Ethereum blockchain. This array can contain the following three string values:
  • vmTrace: Traces the virtual machine's step-by-step execution in detail. This includes memory state, stack state, and the result of each execution instruction.
  • trace: Provides step-by-step logs of transaction execution. These logs include call flow and details of internal transactions that occurred.
  • stateDiff: Shows the difference in account state before and after transaction execution. This includes changed storage keys and values, account balance changes, and contract code changes.
This information helps developers better understand the transaction processing flow and debug. Each type provides detailed information on a specific aspect of the blockchain to clearly understand the impact of a transaction.
Responses
Information about the traced action
fromstring
Caller address
callTypestring
Call type (call, delegatecall, staticcall, etc.)
gasstring
Gas limit set for the call (hex)
inputstring
Call input data (hex)
tostring
Callee address
valuestring
Amount of ETH transferred (hex, in wei)
blockHashstring
Hash of the block containing the transaction
blockNumberinteger
Block number containing the transaction
Call result
gasUsedstring
Actual gas used (hex)
outputstring
Call return data (hex)
subtracesinteger
Number of sub-traces
traceAddressarray
Index array representing the trace path
transactionHashstring
Hash of the traced transaction
transactionPositioninteger
Position of the transaction within the block
typestring
Trace type (call, create, reward, etc.)
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "Unauthorized"
}
cURL
curl -X POST 'https://ethereum-mainnet.nodit.io' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "trace_replayTransaction",
"params": [
"0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3",
[
"trace"
]
]
}'