Fast Sync Using Snapshots
Applies to: Ubuntu 22.04 / 24.04 Prerequisites:
xoned
installed and configured; stop any running node service (sudo systemctl stop xone-node
).
1. Install Dependencies
sudo apt update
sudo apt install -y lz4 wget
2. Define Variables
# Snapshot date: recommended to use yesterday’s date, format YYYYMMDD
SNAP_DATE=$(date -d "yesterday" +%Y%m%d)
# Snapshot filename and download URL
SNAP_FILE="snapshot-${SNAP_DATE}.tar.lz4"
SNAP_URL="https://xone-mainnet-files.s3.ap-southeast-1.amazonaws.com/snapshots/${SNAP_FILE}"
# Data directory (same as used during init)
DATA_DIR="${HOME}/.xone"
3. Download the Snapshot
cd /tmp
wget "${SNAP_URL}" -O "${SNAP_FILE}"
Tip: Use
ls -lh ${SNAP_FILE}
to verify the file size matches the official reference.
4. Backup priv_validator_state.json
cp "${DATA_DIR}/data/priv_validator_state.json" \
"${DATA_DIR}/priv_validator_state.json.backup"
Note: This file holds your validator’s signing state. Restoring it after reset prevents double-signing.
5. Reset Local Chain Data
xoned tendermint unsafe-reset-all \
--home "${DATA_DIR}" \
--keep-addr-book
--keep-addr-book
retains your peer address book to avoid re-discovering peers.
6. Decompress the Snapshot
lz4 -dc "/tmp/${SNAP_FILE}" | tar -xf - -C "${DATA_DIR}"
-dc
: decompresses to stdout and pipes directly intotar
.
7. Restore Validator State
cp "${DATA_DIR}/priv_validator_state.json.backup" \
"${DATA_DIR}/data/priv_validator_state.json"
8. Start the Node Service
sudo systemctl start xone-node
9. Verify Sync Status
# Check service status
sudo systemctl status xone-node
# Tail the logs in real time
sudo journalctl -f -u xone-node
10. Clean Up the Snapshot File
rm "/tmp/${SNAP_FILE}"
Tips
- To automate this process, combine the above steps into a script and make it executable.
- If the snapshot version or URL changes, update
SNAP_DATE
orSNAP_URL
accordingly. - Snapshots accelerate syncing only; before participating in consensus, ensure your node is fully caught up and healthy.