debug_traceBlockByHash

Returns the possible tracing result number by executing all transactions in the block specified by the block hash with a tracer.

Note: debug_traceBlockByHashis only supported for non-archive requests, i.e. for blocks and transactions near the head of the chain. All other BNB Smart Chain method requests will be archive requests unless otherwise stated.

This method will use 40 Compute Units.


Parameters

blockHash - String - Required - The block hash.

object - Object - Required - The tracer object with the following fields:

  • tracer - String - The type of tracer, options are: callTracer ,prestateTracer or flatCallTracer.

    • callTracer - String - The callTracer keeps track of all call frames, including depth - calls, that are made during a transaction.

    • prestateTracer - String - The prestateTracer replays the transaction and trackers every part of state that occurred during the transaction.

    • flatCallTracer - String - The flatCallTracer is a specific type of tracer that provides a flattened view of all calls made during transaction execution. It offers a simplified output compared to the standard callTracer, making it easier to analyze complex transactions.

Returns

result - An array of transactions for that block, each containing:

  • txHash - The transaction hash of the transaction

  • from - The address the transaction is sent from.

  • gas - The integer of the gas provided for the transaction execution.

  • gasUsed - The integer of the gas used.

  • to - The address the transaction is directed to.

  • input - The data given at the time of input.

  • value - The integer of the value sent with this transaction.

  • type - The type of call.

// Result
{
        "jsonrpc": "2.0",
        "result": [
                {
                        "txHash": "0xb4f73866b92843791ecdadc79db9fcf99051efaf456832102420a34b4cbe85bd",
                        "result": [
                                {
                                        "action": {
                                                "callType": "call",
                                                "from": "0xa38a8efa14fb1e541c87371cb52391f8c2a53af0",
                                                "gas": "0x7a122",
                                                "input": "0x",
                                                "to": "0x0000000000b35ae47b12b8ccf2f8d51e208760c8",
                                                "value": "0x0"
                                        },
                                        "blockHash": "0xd03a11a769c68e018c6019c3f176862c8e75b619842b2bb92ad683cf2aef891e",
                                        "blockNumber": 41927824,
                                        "result": {
                                                "gasUsed": "0x523f",
                                                "output": "0x"
                                        },
                                        "subtraces": 0,
                                        "traceAddress": [],
                                        "transactionHash": "0xb4f73866b92843791ecdadc79db9fcf99051efaf456832102420a34b4cbe85bd",
                                        "transactionPosition": 0,
                                        "type": "call"
                                }
                        ]
                },...
curl https://mainnet.bsc.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"debug_traceBlockByHash","params":["0xd03a11a769c68e018c6019c3f176862c8e75b619842b2bb92ad683cf2aef891e", {"tracer": "flatCallTracer"}],"id":1}'

Last updated