π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. Here are some examples,
Mainnet
FULL node snapshot
curl "https://snapshots.taraxa.io/api?network=mainnet" -s | jq -r '.full.url'
LITE node snapshot
curl "https://snapshots.taraxa.io/api?network=mainnet" -s | jq -r '.light.url'
Testnet
FULL node snapshot
curl "https://snapshots.taraxa.io/api?network=testnet" -s | jq -r '.full.url'
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_db
anddb
folders into the data folder for your node. (Default path is~/.taraxa/data
or 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: `
docker cp ./db $(docker ps --format "{{.Names}}" | grep mainnet | grep node):/opt/taraxa_data/data/db/db_new
docker cp ./state_db $(docker ps --format "{{.Names}}" | grep mainnet | grep node):/opt/taraxa_data/data/db/state_db_new
docker-compose down
docker run --rm -it -v $(docker volume ls | awk '{print $2}' | grep -i mainnet):/data alpine ash -c "cd /data/db; mv db db_bk; mv state_db state_db_bk; mv db_new db; mv state_db_new state_db"
docker-compose up -d
docker-compose logs -f
Congrats you are all done and node will sync faster than having started from the beginning!
Last updated
Was this helpful?