bb6e53f3f6
New features: - Enhanced bootstrap.sh with blockchain download option - create-blockchain-snapshot.sh for creating compressed snapshots - BOOTSTRAP.md documentation Benefits for Raspberry Pi users: - Download pre-synced blockchain (~500MB compressed) - Skip days/weeks of initial sync - Start mining immediately from latest block - Interactive installer asks: bootstrap or sync from scratch Snapshot creation: - Safely stops daemon - Excludes wallet.dat (security) - Compresses to ~70% original size - Includes checksums and metadata TODO: Create first snapshot from DNS2 and host on GitHub releases
3.0 KiB
3.0 KiB
TRI-PI Blockchain Bootstrap
Fast-sync your Raspberry Pi node with pre-synced blockchain data.
Why Use Bootstrap?
Without bootstrap:
- Sync from genesis block (block 0)
- Takes days/weeks on Raspberry Pi
- Heavy CPU/disk usage during sync
- Network bandwidth intensive
With bootstrap:
- Start from latest block height
- Ready to mine in minutes
- Minimal resource usage
- Only ~500MB download
Creating a Blockchain Snapshot
Run on a fully-synced node (DNS2, DNS3, etc.):
# Download snapshot creator
curl -L -o create-snapshot.sh \
https://raw.githubusercontent.com/SamiAhmed7777/tri-pi/main/scripts/create-blockchain-snapshot.sh
chmod +x create-snapshot.sh
# Create snapshot (stops daemon temporarily)
./create-snapshot.sh
Output:
tri-blockchain-v5.4.4-YYYY-MM-DD.tar.gz- Compressed blockchainsnapshot-info.txt- Metadata (block height, checksums)
Hosting the Snapshot
Option 1: GitHub Release (recommended for public distribution)
gh release upload v5.4.4 tri-blockchain-*.tar.gz
Option 2: Dropbox
dbxcli put tri-blockchain-*.tar.gz /Krystie/TRI/
dbxcli share /Krystie/TRI/tri-blockchain-*.tar.gz
Option 3: Custom Web Server
scp tri-blockchain-*.tar.gz user@server:/var/www/html/tri/
# Access at: https://example.com/tri/tri-blockchain-v5.4.4-2026-04-01.tar.gz
Updating Bootstrap Script
After uploading, update bootstrap.sh:
# Edit line 9
BLOCKCHAIN_URL="https://your-url-here/tri-blockchain-latest.tar.gz"
Commit and push to make it available to all Pi users!
Snapshot Contents
Included:
blk*.dat- Blockchain data filesdatabase/- Block indextxleveldb/- Transaction indexsmsgDB/- Secure messaging databasepeers.dat- Known peer cachesmsg.ini- Messaging config
Excluded (for security/privacy):
wallet.dat- NEVER include! Contains private keysdebug.log- Large, regenerated on runonion/- Regenerated automaticallytor_data/- Regenerated automatically
Maintenance Schedule
Recommended: Create new snapshots weekly/monthly as blockchain grows.
Automation example (cron):
# Every Sunday at 2 AM
0 2 * * 0 /usr/local/bin/create-snapshot.sh && \
gh release upload v5.4.4 /tmp/tmp.*/tri-blockchain-*.tar.gz --clobber
Compression Stats
Typical compression with tar.gz:
- Original blockchain: ~2-5GB (depends on block height)
- Compressed: ~500MB-1.5GB
- Compression ratio: ~70-75%
Security Notes
- Never include wallet.dat - Contains private keys!
- Verify checksums - Always provide SHA256 hashes
- Trust - Only use snapshots from trusted sources
- Update regularly - Stale snapshots still require catching up
Testing
Before releasing publicly:
# On a fresh Pi
rm -rf ~/.triangles
curl -sSL https://raw.githubusercontent.com/SamiAhmed7777/tri-pi/main/bootstrap.sh | bash
# Choose option 1 (bootstrap download)
# Verify it starts from correct block
trianglesd getinfo | grep blocks