trace_block RPC Method
Executes all transactions of a given block and returns their traces in the below mentioned format (parity style). Ideal for simulations and blockchain analysis.
Parameters
Block number or Tag
[required]
The block number as hex or the Tag
. "latest", "earliest", "pending", "safe" or "finalized", or an hexadecimal block number.
"Safe" and "finalized" are only availible on Ethereum and Arbitrum One chains. Read block parameter description in Ethereum documentation (opens in a new tab).
Returns
-
array
- The list of trace objects. One per transaction in the block.-
action
- The action performed, parity style.-
from
- The sender address. -
to
- The receiver address. -
callType
- The type of the call, either call or delegatecall. -
gas
- The gas provided. -
input
- The input data of the action (transaction). -
value
- The amount of ETH sent in this action (transaction). -
author
- The author of this transaction, for some transaction types. -
rewardType
- The type of the reward, for reward transactions.
-
-
blockHash
- The hash of the block where this action happened. -
blockNumber
- The number of the block where this action happened. -
result
- The result object, parity style.-
gasUsed
- The amount of gas used by this transaction. -
output
- The output of this transaction.
-
-
subtraces
- The number of traces of internal transactions that happened during this transaction. -
traceAddress
- The trace addresses (array) where the call executed (every contract where code was executed). -
transactionHash
- The hash of the transaction being traced. -
transactionPosition
- The position of the transaction in the block. -
type
- The type of the transaction like call or create or reward.
-
Need RPC API keys?
Get 12.5M archival requests for free today.
Request
POST https://<network>.chainnodes.org/YOUR-API-KEY
Example
Confusing? Ask blockchain developers in Chainnodes Telegram Chat (opens in a new tab)
- HTTPS POST Request with a JSON RPC call in the body
- Replace YOUR-API-KEY with the API key from your Chainnodes.org Dashboard
- You can use a different supported network by replacing
mainnet
curl https://mainnet.chainnodes.org/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"method":"trace_block","params":["0x1034094"],"id":1,"jsonrpc":"2.0"}'
Body
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"action": {
"from": "0xfc5e7ea8694db2d784e8653b72c3c2913e2366c2",
"callType": "call",
"gas": "0x0",
"input": "0x",
"to": "0xd018538c87232ff95acbce4870629b75640a78e7",
"value": "0xadae77ad227000"
},
"blockHash": "0x1d7edffa1f8d738fa8d0f2db7a21d63bb0c94962acb5c1fc02b8552287907ce2",
"blockNumber": 16990356,
"result": {
"gasUsed": "0x0",
"output": "0x"
},
"subtraces": 0,
"traceAddress": [],
"transactionHash": "0x76af15dd09aee8891ed7ee2ecc2334b2b638e877752b3efe1a37ec7dc8b71908",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"from": "0xa26e9795af46d9d85762f016664b8d4fe4189a03",
"callType": "call",
"gas": "0x0",
"input": "0x",
"to": "0x3f3de3465c97989c520abcf67c7a0ab88df2c0f8",
"value": "0x111cdaa4f44000"
},
"blockHash": "0x1d7edffa1f8d738fa8d0f2db7a21d63bb0c94962acb5c1fc02b8552287907ce2",
"blockNumber": 16990356,
"result": {
"gasUsed": "0x0",
"output": "0x"
},
"subtraces": 0,
"traceAddress": [],
"transactionHash": "0x5d472f79d463069f6e904baacf2d2e025bfad54d0f8d7d28fa512fbaa6b21184",
"transactionPosition": 1,
"type": "call"
},