# debug\_traceBlockByNumber

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

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

***

## **Parameters**

`blockNumber` - String - <mark style="color:red;">Required</mark> - The block number as a string in hexadecimal format.

`object` - Object - <mark style="color:red;">Required</mark> - 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 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.
* `calls` - A list of sub-calls.

```bash
// Result
{
	"jsonrpc": "2.0",
	"result": [
		{
			"txHash": "0xa3b5b3d805ae110ef84f3bd11762175abc103274c6f3be87cac77287dcfb4614",
			"result": {
				"from": "0xed237edb351c5da602bfa65304fcaa0ad59b9aca",
				"gas": "0x33450",
				"gasUsed": "0x17ec7",
				"to": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
				"input": "0x38ed1739000000000000000000000000000000000000000000001787c9c50d38b50d5e5000000000000000000000000000000000000000000000000054c8c67e5503180000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000ed237edb351c5da602bfa65304fcaa0ad59b9aca0000000000000000000000000000000000000000000000000000000066d8208d0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000f3768d6e78e65fc64b8f12ffc824452130bd5394000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
				"output": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000001787c9c50d38b50d5e500000000000000000000000000000000000000000000000005535d836ed3c9a67",
				"calls": [
					{
						"from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
						"gas": "0x2bc60",
						"gasUsed": "0x9c8",
						"to": "0x34a43471377dcce420ce8e3ffd9360b2e08fa7b4",
						"input": "0x0902f1ac",
						"output": "0x000000000000000000000000000000000000000000000015e5d5c4c4fe59833b00000000000000000000000000000000000000000005efeba2b86bbae29e230b0000000000000000000000000000000000000000000000000000000066d8200f",
						"type": "STATICCALL"
					},...
```

{% tabs %}
{% tab title="mainnet" %}

```bash
curl https://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0", "method":"debug_traceBlockByNumber","params":["0x13b7e35", {"tracer": "callTracer","tracerConfig": { "onlyTopCall": false}}],"id":1}'
    
```

{% endtab %}

{% tab title="testnet" %}

```bash
curl https://sepolia.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0", "method":"debug_traceBlockByNumber","params":["0x652c1f", {"tracer": "callTracer","tracerConfig": { "onlyTopCall": false}}],"id":1}'
    
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.validationcloud.io/v1/ethereum/debug-api/debug_traceblockbynumber.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
