debug_traceBlockByNumber RPC Method
Please note that this RPC method is available to all users on the Build plan and higher. If you are using the Free plan, you will need to upgrade to utilize this method. See our pricing for more information.
Parameters
blockNumber
string
REQUIRED
Loading...
object
array
REQUIRED
Loading...
tracer
string
Loading...
callTracer
string
Loading...
prestateTracer
string
Loading...
tracerConfig
object
Loading...
onlyTopCall
boolean
Loading...
diffMode
boolean
Loading...
Returns
type
Loading...
from
Loading...
to
Loading...
value
Loading...
gas
Loading...
gasUsed
Loading...
input
Loading...
output
Loading...
calls
Loading...
Request
curl https://docs-demo.quiknode.pro/ \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"debug_traceBlockByNumber","params":["0xccde12", {"tracer": "callTracer"}],"id":1,"jsonrpc":"2.0"}'
require 'eth' client = Eth::Client.create 'https://docs-demo.quiknode.pro/' payload = { "jsonrpc": "2.0", "method": "debug_traceBlockByNumber", "params": ["0xccde12", {"tracer": "callTracer"}], "id": "1" } response = client.send(payload.to_json) puts response
import { ethers } from "ethers"; (async () => { const provider = new ethers.JsonRpcProvider("https://docs-demo.quiknode.pro/"); const response = await provider.send("debug_traceBlockByNumber", [ "0xccde12", {"tracer": "callTracer"}, ]); console.log(response); })();
var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify({ "method": "debug_traceBlockByNumber", "params": [ "0xccde12", { "tracer": "callTracer" } ], "id": 1, "jsonrpc": "2.0" }); var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("https://docs-demo.quiknode.pro/", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));
import requests import json url = "https://docs-demo.quiknode.pro/" payload = json.dumps({ "method": "debug_traceBlockByNumber", "params": [ "0xccde12", { "tracer": "callTracer" } ], "id": 1, "jsonrpc": "2.0" }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
require "uri" require "json" require "net/http" url = URI("https://docs-demo.quiknode.pro/") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "method": "debug_traceBlockByNumber", "params": [ "0xccde12", { "tracer": "callTracer" } ], "id": 1, "jsonrpc": "2.0" }) response = https.request(request) puts response.read_body
from web3 import HTTPProvider client = HTTPProvider('https://docs-demo.quiknode.pro/') params = ['0xccde12', {'tracer': 'callTracer'}] response = client.make_request('debug_traceBlockByNumber', params) print(response)
Response
{ "jsonrpc": "2.0", "id": 1, "result": [ { "type": "CALL", "from": "0x3b5b09d988ba5be25d130a6959a7e4dc5cad4578", "to": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d", "value": "0x2386f26fc10000", "gas": "0x55730", "gasUsed": "0x3d227", "input": "0x7ff36ab5000000000000000000000000000000000000000000000000000b8d442e2d8b000000000000000000000000000003b5b09d988ba5be25d130a6959a7e4dc5cad45780000000000000000000000000000000000000000000000000000000064a571e9", "output": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000002e90edd00000", "calls": [ { "type": "CALL", "from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d", "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "value": "0x2386f26fc10000", "gas": "0x12e04", "gasUsed": "0x8fc", "input": "0xd0e30db0", "output": "0x", "calls": [] }, { "type": "CALL", "from": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d", "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "value": "0x0", "gas": "0x11b36", "gasUsed": "0x2c33", "input": "0xa9059cbb0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f0000000000000000000000000000000000000000000000000002386f26fc10000", "output": "0x0000000000000000000000000000000000000000000000000000000000000001", "calls": [] } ] }, { "type": "CALL", "from": "0xf04a5cc80b1e94c69b48f5ee68a08cd2f09a7c3e", "to": "0x881d40237659c251811cec9c364ef91dc08d300c", "value": "0x0", "gas": "0x29dbb", "gasUsed": "0x16e0a", "input": "0x38ed1739000000000000000000000000000000000000000000000000000429d069189e00000000000000000000000000000000000000000000000000029e8d66e8203c2e0000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f04a5cc80b1e94c69b48f5ee68a08cd2f09a7c3e0000000000000000000000000000000000000000000000000000000064a571f40000000000000000000000000000000000000000000000000000000000000002000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000d8775f648430679a709e98d2b0cb6250d2887ef", "output": "0x0000000000000000000000000000000000000000000000000029e8d66e8203c2e", "calls": [] } ] }
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free