Archive bootstrap
Skip weeks of indexing by bootstrapping from Hiro's pre-indexed archives.
Overview
Instead of indexing from the genesis block, you can bootstrap your indexer using Hiro's regularly updated archives. This reduces initial sync time from weeks to hours.
Available archives
Hiro provides archives for different configurations:
Archive Type | Metaprotocols | Size | Sync Time |
---|---|---|---|
Full | Ordinals, Runes, BRC-20 | ~800 GB | 2-4 hours |
Ordinals only | Ordinals | ~450 GB | 1-2 hours |
Runes only | Runes | ~80 GB | 30 mins |
BRC-20 only | BRC-20 | ~120 GB | 45 mins |
Download archives
Create archive directory
$mkdir -p ~/bitcoin-indexer/archives$cd ~/bitcoin-indexer/archives
Download required archives
Download the archives for the metaprotocols you want to index:
$curl -O -C - https://archive.hiro.so/mainnet/bitcoin-indexer-adhoc/mainnet-bitcoin-indexer-ordinals-pg-latest.tar$curl -O -C - https://archive.hiro.so/mainnet/bitcoin-indexer-adhoc/mainnet-bitcoin-indexer-brc20-pg-latest.tar$curl -O -C - https://archive.hiro.so/mainnet/bitcoin-indexer-adhoc/mainnet-bitcoin-indexer-rocksdb-latest.tar.gz$curl -O -C - https://archive.hiro.so/mainnet/bitcoin-indexer-adhoc/mainnet-bitcoin-indexer-runes-pg-latest.tar
Archives are large (100-800GB). Use -C -
flag to enable resume on interruption. Download times vary from 2-8 hours depending on connection speed.
Extract archives
$tar -xzf mainnet-bitcoin-indexer-rocksdb-latest.tar.gz$tar -xf mainnet-bitcoin-indexer-ordinals-pg-latest.tar$tar -xf mainnet-bitcoin-indexer-brc20-pg-latest.tar$tar -xf mainnet-bitcoin-indexer-runes-pg-latest.tar
Move RocksDB data
$mv rocksdb ~/bitcoin-indexer/rocksdb-chainstate
Restore PostgreSQL databases
Set permissions
$sudo chown -R postgres:postgres ~/bitcoin-indexer/archives/brc20.dump$sudo chown -R postgres:postgres ~/bitcoin-indexer/archives/ordinals.dump$sudo chown -R postgres:postgres ~/bitcoin-indexer/archives/runes.dump
Import database dumps
Restore the PostgreSQL archives to your databases:
$sudo -u postgres pg_restore --verbose --jobs=6 -d ordinals -c --if-exists ~/bitcoin-indexer/archives/ordinals.dump[32mrestoring data for table "inscriptions"[0m[32mrestoring data for table "transfers"[0m[32mprocessing...[0m$sudo -u postgres pg_restore --verbose --jobs=6 -d brc20 -c --if-exists ~/bitcoin-indexer/archives/brc20.dump[32mrestoring data for table "tokens"[0m[32mrestoring data for table "balances"[0m$# Restore Runes database (if downloaded)$sudo -u postgres pg_restore --verbose --jobs=6 -d runes -c --if-exists ~/bitcoin-indexer/archives/runes.dump
Database restoration takes 1-4 hours depending on archive size and disk speed. The --jobs=6
flag uses parallel processing to speed up the restore.
Verify restoration
Check that data was imported successfully:
$sudo -u postgres psql -d ordinals -c "SELECT COUNT(*) FROM inscriptions;"$sudo -u postgres psql -d brc20 -c "SELECT COUNT(DISTINCT ticker) FROM tokens;"
Check archive block height
Find the block height of your restored archive:
$ls -la ~/bitcoin-indexer/rocksdb-chainstate/rocksdb/ | grep -i manifest
Configuration for archive bootstrap
No special configuration needed! The indexer automatically detects the archive state and continues from where it left off. Just ensure your paths match:
[storage]working_dir = "/home/bitcoin-indexer/bitcoin-indexer/rocksdb-chainstate"# ... rest of your configuration
Start indexing
With the archive in place, start the indexer:
$bitcoin-indexer start --config bitcoin-indexer.toml[32m✓[0m Loaded archive data from block 819,542[32m✓[0m Connected to Bitcoin node[32m✓[0m Catching up from block 819,542 to 820,123[32m✓[0m Processing block 819,543...
The indexer will:
- 1Load the archive state
- 2Connect to your Bitcoin node
- 3Process new blocks since the archive height
- 4Catch up to the chain tip
Creating custom archives
Export your own archives for backup or migration:
$bitcoin-indexer export \--data-dir /data/bitcoin-indexer \--output /backups/indexer-backup.tar.gz \--compress[32m✓[0m Exported blocks 0 to 820,000[32m✓[0m Archive size: 823 GB[32m✓[0m Compression saved 18%
Troubleshooting
Archive extraction fails
Ensure sufficient disk space - archives extract to 2x their compressed size temporarily.
Verification errors
$tar -tzf bitcoin-indexer-full-latest.tar.gz | wc -l[1m2,847,291 files[0m
Slow download speeds
Use a download manager with resume support:
$aria2c -x 16 -s 16 https://archive.hiro.so/bitcoin-indexer/mainnet/bitcoin-indexer-full-latest.tar.gz