Fork that adds trace_blockRange
and trace_specificBlocks
rpc methods (no need to resync existing erigon node)
ex:
To get traces for blocks in the range 11406500-11406550
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"trace_blockRange","params":[11406500,11406550],"id":67}' https://localhost:8545/
To get traces for blocks 100, 200, and 300
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"trace_specificBlocks","params":[[100, 200, 300]],"id":67}' https://localhost:8545/
git clone --recurse-submodules -j8 https://github.com/taarushv/erigon-trace-fork.git
cd erigon-trace-fork
make erigon
./build/bin/erigon
make rpcdaemon && ./build/bin/rpcdaemon --chaindata ~/.local/share/erigon/chaindata/ --http.api=eth,web3,trace --http.addr 0.0.0.0 --http.vhosts=* --http.corsdomain=* --http.port 8545 --rpc.gascap=10000000000000000000 --ws
Start postgres db container
sudo docker-compose up -d
Install requirements
yarn
Scrape block traces
START=1 END=100 yarn start
PINATA_APIKEY=XYZ PINATA_SECRET=ABC START=1 END=100 node src/export.js
Response:
Starting export
Uploading to pinata!
Uploaded to IPFS, Hash: QmPNbDiHAWMfcsFxzZq6BULjKJHkZ3bfD1813SNbeD3Pcw
Visit https://gateway.pinata.cloud/ipfs/QmPNbDiHAWMfcsFxzZq6BULjKJHkZ3bfD1813SNbeD3Pcw
Stop container and delete database
sudo docker-compose down && sudo rm -rf trace-database/