For the complete documentation index, see llms.txt. This page is also available as Markdown.

Snapshot Downloader

The Snapshot Downloader is a Rust-based tool that automates setting up a Cronos node from a snapshot. It supports two modes:

  • Download only: Run with --profile to download a snapshot without any configuration file.

  • Full setup: Configure config.yaml and run cargo run to go through the full node setup lifecycle.

This guide walks you through installation, setup, and configuration. 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 it 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-progs

Format 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/.snapshots
mkdir -p ~/.snapshot-downloader/downloads
mkdir -p ~/.snapshot-downloader/workspace/home/data
sudo 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/data

Format and Mount 1 Disk

sudo parted /dev/nvme0n2 -- mklabel gpt
sudo parted /dev/nvme0n2 -- mkpart downloads btrfs 0% 100%
sudo mkfs.btrfs /dev/nvme0n2p1
mkdir -p ~/.snapshot-downloader
sudo mount /dev/nvme0n2p1 ~/.snapshot-downloader
sudo chown -R $USER ~/.snapshot-downloader

Resize Disk (Optional)

sudo growpart /dev/nvme0n3 1
sudo btrfs filesystem resize max ~/.snapshot-downloader/workspace/home/data

Dependencies 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.

Build Snapshot Downloader


Mode 1: Download Snapshot Only

Run with --profile to download a snapshot without a config.yaml file.

Full available profile list:


Mode 2: Full Node Setup with config.yaml

With config.yaml, the downloader runs through a 6-step lifecycle to set up and start a full node automatically.

Lifecycle steps:

  1. Download and extract cronosd binary

  2. Run cronosd init

  3. Download snapshot

  4. Extract snapshot

  5. Update app.toml and config.toml

  6. Start cronosd

Choose Snapshot

Check the latest snapshots at https://snapshot.cronos.com/.

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 addrbook download.

Run The Tool

Once configured, run:

The tool will go through all 6 steps in order. Use lifecycle hooks (post_snapshot_download_command, post_snapshot_extract_command, post_start_command) for any custom automation between steps.

Skipping Steps

You can skip one or more steps by passing skip flags. This is useful when re-running the tool after a partial run, or when certain steps have already been completed.

Flag
Skips

--skip-binary-download

Step 1: Download and extract cronosd binary

--skip-download-snapshot

Step 3: Download snapshot

--skip-extract-snapshot

Step 4: Extract snapshot

--skip-download-addrbook

Addrbook download (if addrbook_url is set)

--skip-execute-binary

Step 6: Start cronosd

Steps 2 (init) and 5 (update config) always run and cannot be skipped.

Examples

Re-run without re-downloading or re-extracting the snapshot:

Re-run from scratch but skip starting the node:

Skip everything except starting the node:

Last updated

Was this helpful?