Export attestation and reward data from RustChain to standard formats (CSV, JSON, JSONL) for analysis, reporting, and compliance.
# Clone the repository
git clone https://github.com/Krishna2918/rustchain-export.git
cd rustchain-export
# Install dependencies
pip install httpx
# Optional: Install rustchain-sdk for better integration
pip install git+https://github.com/Krishna2918/rustchain-sdk.git# Export all data to CSV
python rustchain_export.py --format csv --output ./data
# Export to JSON
python rustchain_export.py --format json --output ./data
# Export to JSONL (one record per line)
python rustchain_export.py --format jsonl --output ./data# Export data from a specific date range
python rustchain_export.py --format csv --from 2025-12-01 --to 2026-02-01# Export only miners
python rustchain_export.py --miners-only
# Export only balances
python rustchain_export.py --balances-only
# Export specific tables
python rustchain_export.py --tables miners,balances,epochs# Use a different RustChain node
python rustchain_export.py --node https://custom-node.com --format csv| File | Description |
|---|---|
miners.csv |
All miner IDs, architectures, last attestation, total earnings |
epochs.csv |
Epoch number, timestamp, pot size, settlement status |
rewards.csv |
Per-miner per-epoch reward amounts |
attestations.csv |
Attestation log (miner, timestamp, device info) |
balances.csv |
Current RTC balances |
miner_id,hardware_type,multiplier,last_seen,blocks_mined
eafc6f14...,PowerPC G4 (Vintage),2.5,1770078232,100
modern-sophia...,x86-64 (Modern),0.8,1770078201,50[
{
"epoch": 62,
"started_at": "2026-02-01T00:00:00Z",
"ends_at": "2026-02-08T00:00:00Z",
"block_height": 15000
}
]- ✅ Multiple output formats: CSV, JSON, JSONL
- ✅ Date range filtering
- ✅ Works with RustChain SDK or standalone
- ✅ Handles self-signed SSL certificates
- ✅ Streaming export for large datasets
- ✅ Proper CSV escaping and headers
This tool operates in API mode by default, fetching data from the public RustChain node API. This is sufficient for most use cases.
For full database access (all historical data), you would need direct SQLite access to the node.
- Python 3.8+
- httpx (or rustchain-sdk)
MIT License