bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "debug_traceBlockByHash",
"params": [
"0x849a3ac8f0d81df1a645701cdb9f90e58500d2eabb80ff3b7f4e8c13f025eff2",
{"tracer": "callTracer"}
],
"id": "getblock.io"
}'
javascriptconst axios = require('axios');
const blockHash = '0x849a3ac8f0d81df1a645701cdb9f90e58500d2eabb80ff3b7f4e8c13f025eff2';
const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
jsonrpc: '2.0',
method: 'debug_traceBlockByHash',
params: [blockHash, { tracer: 'callTracer' }],
id: 'getblock.io'
}, {
headers: { 'Content-Type': 'application/json' }
});
const traces = response.data.result;
console.log('Total Transactions Traced:', traces.length);
traces.forEach((trace, index) => {
console.log(`Tx ${index}: ${trace.result.type} - ${trace.result.from} -> ${trace.result.to}`);
});
pythonimport requests
block_hash = '0x849a3ac8f0d81df1a645701cdb9f90e58500d2eabb80ff3b7f4e8c13f025eff2'
response = requests.post(
'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
headers={'Content-Type': 'application/json'},
json={
'jsonrpc': '2.0',
'method': 'debug_traceBlockByHash',
'params': [block_hash, {'tracer': 'callTracer'}],
'id': 'getblock.io'
}
)
result = response.json()
traces = result['result']
print(f'Total Transactions Traced: {len(traces)}')
for i, trace in enumerate(traces):
print(f'Tx {i}: {trace["result"]["type"]}')
rustuse reqwest::Client;
use serde_json::{json, Value};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let block_hash = "0x849a3ac8f0d81df1a645701cdb9f90e58500d2eabb80ff3b7f4e8c13f025eff2";
let response = client
.post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
.header("Content-Type", "application/json")
.json(&json!({
"jsonrpc": "2.0",
"method": "debug_traceBlockByHash",
"params": [block_hash, {"tracer": "callTracer"}],
"id": "getblock.io"
}))
.send()
.await?
.json::<Value>()
.await?;
let traces = response["result"].as_array().unwrap();
println!("Total Traces: {}", traces.len());
Ok(())
}
javascriptconst { ethers } = require('ethers');
const provider = new ethers.JsonRpcProvider('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/');
async function traceBlockByHash(blockHash) {
const traces = await provider.send('debug_traceBlockByHash', [
blockHash,
{ tracer: 'callTracer' }
]);
console.log('Total Transactions:', traces.length);
traces.forEach((trace, index) => {
const result = trace.result;
console.log(`\nTransaction ${index}:`);
console.log(' Hash:', trace.txHash);
console.log(' Type:', result.type);
console.log(' From:', result.from);
console.log(' To:', result.to);
console.log(' Gas Used:', parseInt(result.gasUsed, 16));
if (result.error) {
console.log(' Error:', result.error);
}
});
return traces;
}
traceBlockByHash('0x849a3ac8f0d81df1a645701cdb9f90e58500d2eabb80ff3b7f4e8c13f025eff2');
javascriptimport { createPublicClient, http } from 'viem';
import { base } from 'viem/chains';
const client = createPublicClient({
chain: base,
transport: http('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/')
});
async function traceBlockByHash(blockHash) {
const traces = await client.request({
method: 'debug_traceBlockByHash',
params: [blockHash, { tracer: 'callTracer' }]
});
console.log('Total Transactions:', traces.length);
traces.forEach((trace, index) => {
console.log(`Tx ${index}:`, {
hash: trace.txHash,
type: trace.result.type,
gasUsed: parseInt(trace.result.gasUsed, 16)
});
});
return traces;
}
traceBlockByHash('0x849a3ac8f0d81df1a645701cdb9f90e58500d2eabb80ff3b7f4e8c13f025eff2');