debug_traceBlockByHash

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

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 orprestateTracer.

    • 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.

  • 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.

// 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"
					},...
curl https://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"debug_traceBlockByHash","params":["0x5162380f2a130835c1b17ed38be2d6aa293d2440596c14995f0e6d63fae3d5ff", {"tracer": "callTracer","tracerConfig": { "onlyTopCall": false}}],"id":1}'
    

Last updated