Add blockchain bootstrap support to dramatically speed up initial sync: New files: - setup/bootstrap.sh: Downloads and extracts blockchain snapshot from http://194.233.88.206/triangles-bootstrap.tar.gz (~1.3GB) - docs/BOOTSTRAP.md: Complete documentation on bootstrap process, time savings, security, and troubleshooting - build/test-bootstrap.sh: Bootstrap functionality tests Installer changes (setup/install.sh): - Automatically downloads bootstrap before starting trianglesd - Skips bootstrap if already applied (.bootstrapped marker) - Allows opt-out with BOOTSTRAP=no environment variable - Reports bootstrap status in installation summary Benefits: - Reduces initial sync from 2-5 days to 1-6 hours - Downloads 1.3GB instead of syncing 3GB over days - Still validates all blocks from bootstrap point forward - Safe: maintains full consensus rules Bootstrap server updated weekly (Sundays 4 AM) with fresh snapshots.
3.7 KiB
Blockchain Bootstrap
TRI-PI supports automatic blockchain bootstrapping to dramatically speed up initial sync.
What Is Bootstrap?
Instead of syncing from block 0 (genesis), your Pi downloads a recent snapshot of the blockchain (~1.3GB) and only syncs the remaining blocks. This reduces initial sync time from days to hours.
How It Works
- During installation, the installer automatically downloads the bootstrap
- Extracts blockchain data to
/var/lib/triangles/ - trianglesd starts and syncs only recent blocks
Bootstrap Source
Bootstrap files are hosted at:
http://194.233.88.206/triangles-bootstrap.tar.gz
This server is maintained by the Triangles network and updated weekly with fresh blockchain snapshots.
Automatic Bootstrap (Default)
The installer automatically bootstraps unless you disable it:
# Install with bootstrap (default)
sudo ./setup/install.sh
# Install WITHOUT bootstrap (sync from genesis)
sudo BOOTSTRAP=no ./setup/install.sh
Manual Bootstrap
If you skipped bootstrap during installation or want to re-bootstrap:
# Stop the daemon
sudo systemctl stop trianglesd
# Run bootstrap script
sudo bash ./setup/bootstrap.sh
# Start the daemon
sudo systemctl start trianglesd
Bootstrap Status
Check if your node was bootstrapped:
# Check bootstrap marker file
ls -la /var/lib/triangles/.bootstrapped
# View bootstrap date
cat /var/lib/triangles/.bootstrap-date
Time Savings
Without bootstrap:
- Full sync from genesis: 2-5 days (depending on Pi model)
- Network bandwidth: ~3GB download over days
- CPU intensive (validation from block 0)
With bootstrap:
- Download: 1.3GB (~10-30 minutes on decent connection)
- Remaining sync: 1-6 hours (only recent blocks)
- Less CPU usage (fewer blocks to validate)
Security
Is bootstrap safe?
Yes! Even with bootstrap, your node:
- ✅ Validates all blocks after the bootstrap point
- ✅ Verifies proof-of-work for new blocks
- ✅ Rejects invalid transactions
- ✅ Maintains full consensus rules
The bootstrap only speeds up getting to the current chain tip. Your node still validates everything from the bootstrap point forward.
Bootstrap Updates
The bootstrap server automatically updates weekly:
- Every Sunday at 4 AM PDT
- Captures latest blockchain state
- Old bootstrap files are replaced
- Always <1 week behind current tip
Troubleshooting
Bootstrap download fails:
# Check connectivity to bootstrap server
curl -I http://194.233.88.206/triangles-bootstrap.tar.gz
# Try manual download
wget http://194.233.88.206/triangles-bootstrap.tar.gz
# Skip bootstrap and sync from genesis
BOOTSTRAP=no sudo ./setup/install.sh
Bootstrap extraction fails:
# Check disk space
df -h /var/lib/triangles
# Verify download integrity
ls -lh /tmp/triangles-bootstrap-*/bootstrap.tar.gz
# Manually extract
sudo tar -xzf bootstrap.tar.gz -C /var/lib/triangles --strip-components=1
Node still syncing slowly after bootstrap:
This is normal! After bootstrap, your node still needs to:
- Download remaining blocks (could be thousands)
- Validate each block
- Build indexes
Check sync progress:
# Via RPC
curl --user tripi:$(grep rpcpassword /etc/triangles/triangles.conf | cut -d= -f2) \
--data-binary '{"jsonrpc":"1.0","id":"1","method":"getblockcount","params":[]}' \
-H 'content-type: text/plain;' http://127.0.0.1:19112/
# Via dashboard
curl -s http://127.0.0.1:8080/api/status | jq
Custom Bootstrap Server
To use a different bootstrap source:
BOOTSTRAP_URL=http://your-server.com/bootstrap.tar.gz sudo ./setup/install.sh
Or edit /setup/bootstrap.sh and change BOOTSTRAP_URL.