Snapshot Downloader
The Snapshot Downloader is a Rust-based automation tool that downloads a blockchain binary, snapshot (single or multi-part), and address book, then automatically extracts the binary and snapshot, initializes the node, merges custom settings into app.toml and config.toml, and starts the chain. It also provides lifecycle hooks to execute commands at different stages (post-download, post-extraction, post-start).
This guide walks you through the installation, setup, and configuration of the Snapshot Downloader for running a Cronos node. Follow the steps in order, adapting to your hardware setup (e.g. number of disks).
Environment Setup
The tool works best on Linux with Btrfs, as the tool leverages Btrfs subvolumes for efficient snapshot handling. On Linux, users can manually create snapshots of subvolumes and roll back to previous states if needed.
On macOS and Windows, the downloader still supports snapshot download, extraction, and node start, but Btrfs-specific snapshot and rollback features are unavailable.
Note: On Windows, it requires a Unix-compatible shell (e.g., Git Bash) to run the tool.
Linux Only โ Btrfs Setup
Install btrfs-progs
sudo apt install -y btrfs-progsFormat and Mount Disk(s)
Choose one of the below according to the number of additional disk(s) mounted.
Format and Mount 2 Disks
sudo parted /dev/nvme0n2 -- mklabel gpt
sudo parted /dev/nvme0n2 -- mkpart downloads btrfs 0% 100%
sudo mkfs.btrfs /dev/nvme0n2p1
sudo parted /dev/nvme0n3 -- mklabel gpt
sudo parted /dev/nvme0n3 -- mkpart chain-data btrfs 0% 100%
sudo mkfs.btrfs /dev/nvme0n3p1
mkdir -p ~/test
sudo mount /dev/nvme0n3p1 ~/test
sudo btrfs sub create ~/test/data
sudo btrfs sub create ~/test/data/.snapshotsmkdir -p ~/.snapshot-downloader/downloads
mkdir -p ~/.snapshot-downloader/workspace/home/datasudo mount /dev/nvme0n2p1 ~/.snapshot-downloader/downloads
sudo mount -osubvol=data /dev/nvme0n3p1 ~/.snapshot-downloader/workspace/home/data
sudo chown -R $USER ~/.snapshot-downloader/downloads
sudo chown -R 1001:1002 ~/.snapshot-downloader/workspace/home/dataFormat and Mount 1 Disk
sudo parted /dev/nvme0n2 -- mklabel gpt
sudo parted /dev/nvme0n2 -- mkpart downloads btrfs 0% 100%
sudo mkfs.btrfs /dev/nvme0n2p1mkdir -p ~/.snapshot-downloadersudo mount /dev/nvme0n2p1 ~/.snapshot-downloader
sudo chown -R $USER ~/.snapshot-downloaderResize Disk (Optional)
sudo growpart /dev/nvme0n3 1
sudo btrfs filesystem resize max ~/.snapshot-downloader/workspace/home/dataDependencies Installation
Install Rust using the official installer.
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$ . "$HOME/.cargo/env"Install other dependencies needed for building Rust projects.
$ sudo apt install -y gcc libssl-dev pkg-configBuild Snapshot Downloader
Configure Snapshot Downloader config.yaml
config.yamlThe tool supports single-file or multi-part snapshots, custom lifecycle hooks, and TOML overrides for node configuration.
This example demonstrates a multi-part archive snapshot, including an addrbook download.
Choose Snapshot
Checkout the latest snapshots at https://snapshot.cronos.org/
Update DB Settings
In snapshot-downloader2/config.yaml, under the app_yaml and config_yaml sections, update the database settings according to the target snapshot database type and pruning type, along with any other desired configurations. Follow the same pattern as:
Below are examples of each database with pruning type Default , overriding minimum-gas-prices and persistent_peers.
Full Config Examples
Below are examples of snapshot-downloader2/config.yaml for Cronos EVM. Update URLs, chain IDs, and settings as needed for the latest snapshots and binaries.
Cronos EVM Mainnet Example 1: Single File
This example uses a single file snapshot for the Cronos EVM chain.
Cronos EVM Mainnet Example 2: Multi-part
This example demonstrates a multi-part archive snapshot, including an
addrbookdownload.
Running the Tool
Once configured, run the tool with:
Monitor the output for progress. The tool will handle downloads, extractions, initialization, and startup. Use lifecycle hooks ( post_snapshot_download_command post_snapshot_extract_command and post_start_command ) for custom automation.
To re-run the tool without re-downloading or re-extracting the snapshot, run:
For troubleshooting, check logs in the workspace directory or adjust retry settings in the config. Always verify snapshot and binary URLs from official sources for the latest versions.
Last updated
Was this helpful?