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 TypeMetaprotocolsSizeSync Time
FullOrdinals, Runes, BRC-20~800 GB2-4 hours
Ordinals onlyOrdinals~450 GB1-2 hours
Runes onlyRunes~80 GB30 mins
BRC-20 onlyBRC-20~120 GB45 mins

Download archives

Create archive directory

Terminal
$
mkdir -p ~/bitcoin-indexer/archives
$
cd ~/bitcoin-indexer/archives

Download required archives

Download the archives for the metaprotocols you want to index:

Terminal
$
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
Download time

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

Terminal
$
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

Terminal
$
mv rocksdb ~/bitcoin-indexer/rocksdb-chainstate

Restore PostgreSQL databases

Set permissions

Terminal
$
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:

Terminal
$
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
Restore time

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:

Terminal
$
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:

Terminal
$
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:

title="bitcoin-indexer-config.toml"
[storage]
working_dir = "/home/bitcoin-indexer/bitcoin-indexer/rocksdb-chainstate"
# ... rest of your configuration

Start indexing

With the archive in place, start the indexer:

Terminal
$
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:

  1. 1Load the archive state
  2. 2Connect to your Bitcoin node
  3. 3Process new blocks since the archive height
  4. 4Catch up to the chain tip

Creating custom archives

Export your own archives for backup or migration:

Terminal
$
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

Terminal
$
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:

Terminal
$
aria2c -x 16 -s 16 https://archive.hiro.so/bitcoin-indexer/mainnet/bitcoin-indexer-full-latest.tar.gz

Next steps