๐Ÿ“ท Snapshot (archive)

Update every 6 hours

โ—ป๏ธ How to use?

Copy and paste the command on your server.

sudo apt update && sudo apt install -y curl tmux jq lz4 unzip aria2
sed -i.bak "s/^enable *=.*/enable = false/" $HOME/.story/story/config/config.toml

# Stop services and prepare for snapshot restoration
sudo systemctl stop story story-geth
cd $HOME

# Download snapshots
aria2c -x 16 -s 16 -o story_latest.tar.lz4 https://snapshots2-testnet.unitynodes.com/story/story_latest.tar.lz4
aria2c -x 16 -s 16 -o story_latest_geth.tar.lz4 https://snapshots2-testnet.unitynodes.com/story/story_latest_geth.tar.lz4

# Backup validator state and clean up old data
cp $HOME/.story/story/data/priv_validator_state.json $HOME/.story/story/priv_validator_state.json.bak
rm -rf $HOME/.story/story/data
tar -I lz4 -xvf story_latest.tar.lz4 -C $HOME/.story/story
mv $HOME/.story/story/priv_validator_state.json.bak $HOME/.story/story/data/priv_validator_state.json

# Replace Geth data and extract new snapshot
rm -rf $HOME/.story/geth/odyssey/geth/chaindata
tar -I lz4 -xvf story_latest_geth.tar.lz4 -C $HOME/.story/geth/odyssey/geth

# Restart services and verify logs
sudo systemctl restart story story-geth
sudo journalctl -u story -u story-geth -f

โ—ป๏ธ How to check?

After downloading the snapshot, you can use the command to check the synchronization of your node with the network, you will be shown the following information:

while true; do 
  local_height=$(story status | jq -r .sync_info.latest_block_height)
  network_height=$(curl -s https://rpc.story-testnet.unitynodes.com/status | jq -r '.result.sync_info.latest_block_height')
  blocks_left=$((network_height - local_height))

  echo -e "\033[1;33m[Sync Status]\033[0m \033[1;32mNode Height:\033[0m \033[1;37m$local_height\033[0m | \033[1;32mNetwork Height:\033[0m \033[1;37m$network_height\033[0m | \033[1;32mBlocks Left:\033[0m \033[1;31m$blocks_left\033[0m"

  sleep 5
done

If "Block left - 0-1" - synchronized

โ—ป๏ธ How does it work?

When a new node joins a blockchain network, it can use a snapshot to quickly synchronize with the current state of the network. Snapshots are compressed backups of blockchain data that significantly reduce the time required for node synchronization compared to fully verifying the entire transaction history. Conditionally, there are 100,000 blocks in the network. Without a snapshot, you would have to sync and download all of them completely. In the case of using a snapshot, it can be conditionally only the last 10,000 blocks.

Our team provides up-to-date network snapshots that are updated every 6 hours, so you can sync with less of your own time.

โ—ฝ Advantages of using snapshots:

  • Speed: Significantly reduces sync time.

  • Saving resources: reduces the load on server resources and data storage.

  • Convenience: allows you to quickly restore the operation of the node after failures or transfers.

Last updated