https://github.com/ethersphere/batch-export
batch-export is a tool to retrieve Ethereum event logs for Swarm's Postage Stamp contract on the Gnosis Chain
https://github.com/ethersphere/batch-export
Last synced: 8 months ago
JSON representation
batch-export is a tool to retrieve Ethereum event logs for Swarm's Postage Stamp contract on the Gnosis Chain
- Host: GitHub
- URL: https://github.com/ethersphere/batch-export
- Owner: ethersphere
- License: bsd-3-clause
- Created: 2025-05-06T07:28:51.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-24T15:56:33.000Z (about 1 year ago)
- Last Synced: 2025-06-24T16:49:13.053Z (about 1 year ago)
- Language: Go
- Homepage:
- Size: 158 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# batch-export
batch-export is a tool to retrieve Ethereum event logs for specific contracts, particularly designed for Swarm's Postage Stamp contract on the Gnosis Chain. It fetches logs within a specified block range using the `export` command and saves them to a file.
## Features
- Retrieve event logs for a specified contract address and block range.
- Handles large block ranges by querying in smaller chunks.
- Supports rate limiting for RPC requests.
- Saves retrieved logs to a specified output file (default: `export.ndjson`) in NDJSON format.
- Graceful shutdown on interrupt signals (Ctrl+C).
## Requirements
- Go 1.24 or later
## Installation
```sh
git clone https://github.com/ethersphere/batch-export.git
cd batch-export
make binary
# The binary will be located in the dist/ folder
```
## Usage
The primary command is export.
```sh
./dist/batch-export export --help
```
```sh
./dist/batch-export export \
--start 31306381 \
--endpoint \
--output my_logs.ndjson
```
## Flags
```sh
-b, --block-range-limit uint32 Max blocks per log query (default 5)
-c, --compress Compress to GZIP
--end uint End block (optional, uses latest block if 0) (default 39810670)
-e, --endpoint string Ethereum RPC endpoint URL
-h, --help help for export
-m, --max-request int Max RPC requests/sec (default 15)
-o, --output string Output file path (NDJSON) (default "export.ndjson")
--start uint Start block (optional, uses contract start block if 0) (default 31306381)
-v, --verbosity string Log verbosity (silent, error, warn, info, debug) (default "info")
```