πSyncing From Snapshot
Instructions for faster syncing by use of a recent snapshot
What are Snapshots?
Snapshots are versions of the Taraxa network's overall state.
The Taraxa network has an extremely high throughput, and hence a very large historical state. New nodes joining the network could have a very hard time syncing and catching up with the rest of the network if they start from scratch. So snapshots of the latest network state (with some delay) are provided so that new nodes won't have to start from scratch, and also making syncing a lite node much more painless.
Latest Snapshots
Snapshots are provided for the Mainnet and Testnet through an API, which returns the latest image file paths in JSON. We have stopped providing full node snapshots as the data egress charges are pretty high, we'll update if we find an affordable alternative.
Here are some examples,
Mainnet
LITE node snapshot
curl "https://snapshots.taraxa.io/api?network=mainnet" -s | jq -r '.light.url'Testnet
LITE node snapshot
curl "https://snapshots.taraxa.io/api?network=testnet" -s | jq -r '.light.url'Installing Snapshot On Local Machine
Follow the these steps:
Download the snapshot (link above)
Uncompress the snapshot archive
Stop the node process
Replace
state_dbanddbfolders into the data folder for your node. (Default path is~/.taraxa/dataor as specified in your node config.)Restart your node to begin syncing from the block height of your snapshot.
Congrats you are all done and node will sync faster than having started from the beginning!
Installing Snapshot On Dockerized Node
Follow the these steps:
Download the snapshot (link above)
Uncompress the snapshot archive
Open a terminal and navigate to the location containing the renamed snapshot state_db and db folders.
Run the following commands in the terminal to copy them into your dockerized container: `
Congrats you are all done and node will sync faster than having started from the beginning!
Snapshot Management
The Taraxa node automatically downloads the latest blockchain snapshot on first start to speed up synchronization. The snapshot-puller container handles this process before the node starts.
Default Behavior
By default, the snapshot-puller will:
Check if the data directory already exists and has content
If data exists, skip snapshot download and use existing data
If data directory is empty, download the latest snapshot for your network and node type
Configuration Options
You can customize the snapshot behavior using environment variables in your docker-compose.yml:
Network Selection
Node Type
Custom Snapshot URL
To use a specific snapshot instead of the latest:
Force Fresh Snapshot Download
If you have a corrupted database or want to start fresh, use the DELETE_DATA flag to remove existing data and download a new snapshot:
Warning: Setting DELETE_DATA=true will permanently delete all existing blockchain data in your data directory before downloading a fresh snapshot.
Light Node Performance Considerations
When running a light node (with --light flag), the initial pruning can take a significant amount of time as it processes and prunes historical data. If you don't want to wait for the long initial sync, you can:
Run your node without the
--lightflag (full node mode)Periodically use
DELETE_DATA=trueto remove old data and download a fresh snapshot
This approach allows you to save disk space by regularly refreshing with the latest snapshot instead of maintaining full historical data, while avoiding the long sync times associated with light node initialization.
Example Configurations
Standard Light Node Configuration
Periodic Snapshot Refresh (Alternative to Light Node)
For users who want to save space without waiting for light node sync:
Important: After the snapshot is downloaded and your node is confirmed to be running successfully, it is highly advisable to set DELETE_DATA=false. Only switch it back to true when you intentionally want to force delete the data and download a fresh snapshot. Leaving DELETE_DATA=true permanently could result in unintended data loss on container restarts.
Last updated