> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validationcloud.io/llms.txt
> Use this file to discover all available pages before exploring further.

# debug_traceBlockByHash

Traces every transaction in the block specified by block hash and returns the tracer result for each one.

This method will use `80` [Compute Units](https://docs.validationcloud.io/nodeapi/about/billing.md).

***

## **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` or `prestateTracer`.
  * `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 tracks every part of state that occurred during the transaction.
* `tracerConfig` - Object (Optional) - The object to specify the configurations of the tracer.
  * `onlyTopCall` - Boolean - When set to true, this will only trace the primary (top-level) call and not any sub-calls. It eliminates the additional processing for each call frame.

## **Returns**

`result` - An array with one entry per transaction in the block, each containing:

* `txHash` - The hash of the transaction.
* `result` - With `callTracer`, the call trace of the transaction, an object with:
  * `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.
  * `output` - The data returned by the call, when present.
  * `value` - The integer of the value sent with this transaction.
  * `type` - The type of call.
  * `calls` - A list of sub-calls, when present.

With `prestateTracer`, each result is instead a map keyed by account address, holding the state the transaction touched (such as `balance`, `nonce`, `code` and `storage`).

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
// Result (first of the block's 12 traces shown)
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "result": {
        "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
        "gas": "0xf4240",
        "gasUsed": "0xb45a",
        "to": "0x4200000000000000000000000000000000000015",
        "input": "0x3db6be2b00000000000000000000000000000005000000006adab4a700000000019092be00000000000000000000000000000000000000000000000000000000...",
        "calls": [
          {
            "from": "0x4200000000000000000000000000000000000015",
            "gas": "0xe9b4a",
            "gasUsed": "0x489b",
            "to": "0x1160d963acd3799e820b75809cdba75bcef8bf74",
            "input": "0x3db6be2b00000000000000000000000000000005000000006adab4a700000000019092be00000000000000000000000000000000000000000000000000000000...",
            "value": "0x0",
            "type": "DELEGATECALL"
          }
        ],
        "value": "0x0",
        "type": "CALL"
      },
      "txHash": "0x0cf46910a7ede71333dbb1689c03b2eb77b958af08701039cbef40f0cace0a4c"
    }
  ]
}
```

```bash title="mainnet" theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl https://mainnet.xlayer.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"debug_traceBlockByHash","params":["0x241a36521807e99d82624139dd3dd2ee0007c3126d9e15b82d08e2e76b6b7c8f",{"tracer":"callTracer"}],"id":1}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.