Paxeer Docs logo

Join the network using Snapshots

Learn how to quickly join the Paxeer network using snapshot sync, including download, restore, and troubleshooting steps for validators and nodes.

Before you resync a node using snapshots, make sure that in case of a successful resync that you under no circumstance double sign blocks at previous heights with your validator. Failure to do so will cause tombstoning of your validator.

Follow this guide to join the Paxeer network through snapshot sync. To quickly spin up a fresh full node and join the network, it's recommended to restore from a snapshot instead of replaying all historical blocks.

Snapshot Sync

Snapshot sync allows a new node to join a network by downloading a recent, compressed copy of the entire application state and extracting it directly into the data directory. This reduces the initial sync time from days to minutes.

Snapshot Providers

You can select from various providers for downloading snapshots. Check the Paxeer community channels for current snapshot availability.

Clean Up & Preparation

If you are not starting a node from fresh, perform the following backups and clean-ups first.

Note: This step is not needed for fresh nodes.
  1. Stop the service

    sudo systemctl stop paxd
  2. Backup Validator State (Critical for Validators) Assuming your Paxeer home directory is $HOME/.paxeer, back up priv_validator_key.json and priv_validator_state.json:

    cp $HOME/.paxeer/data/priv_validator_state.json $HOME/priv_validator_state.json
    cp $HOME/.paxeer/config/priv_validator_key.json $HOME/priv_validator_key.json
  3. Reset the State

    paxd tendermint unsafe-reset-all --home $HOME/.paxeer
  4. Remove Data

    rm -rf $HOME/.paxeer/data

Download & Restore

The following commands are generic examples. Please verify the SNAPSHOT_URL and extraction command from your chosen provider.

Prerequisites

Ensure you have the necessary tools installed (e.g., lz4, aria2, pv, wget).

sudo apt update
sudo apt install curl lz4 wget aria2 pv -y

Download and Extract

  1. Set the Snapshot URL Replace <SNAPSHOT_URL> with the link from your chosen provider.

    SNAPSHOT_URL="<PASTE_SNAPSHOT_URL_HERE>"
  2. Download and Extract The following command streams the download and extracts it into $HOME/.paxeer.

    curl -L $SNAPSHOT_URL | lz4 -c -d | tar -x -C $HOME/.paxeer

    Alternative: Parallel Download with aria2

    # Download with 16 parallel connections
    aria2c -x 16 -s 16 -o snapshot.tar.lz4 $SNAPSHOT_URL
    
    # Extract after download completes
    lz4 -c -d snapshot.tar.lz4 | tar -x -C $HOME/.paxeer
    
    # Clean up the downloaded file
    rm snapshot.tar.lz4
  3. Restore Validator State

    cp $HOME/priv_validator_state.json $HOME/.paxeer/data/priv_validator_state.json
  4. Enable State Commit Make sure to enable state-commit in your config if it's not already enabled:

    sed -i.bak -E "/^\[state-commit\]/,/^\[.*\]/ s|^(sc-enable[[:space:]]*=[[:space:]]*).*$|\1true| ; /^\[state-store\]/,/^\[.*\]/ s|^(ss-enable[[:space:]]*=[[:space:]]*).*$|\1true|" $HOME/.paxeer/config/app.toml
  5. Restart the Node

    sudo systemctl start paxd
  6. Monitor Logs

    sudo journalctl -fu paxd

Troubleshooting

Q: I can't download a snapshot. A: Try another time later as these snapshots are refreshed regularly.

Q: The snapshot finishes, but I immediately get AppHash errors upon regular block syncing. A: Make sure that you use the latest version of the node software. This usually means the snapshot version doesn't match your node version, or the snapshot is corrupted.

Q: "No space left on device" A: Snapshots require significant disk space to download and extract. Ensure you have enough free space (check with df -h).