Skip to main content

Snapshot

info

Snapshots are compressed backups of the database directory of a polkadot or kusama node. If you start a node for the first time it will start building the database from scratch, which will take a few days, depending on network speed. If you download an up to date database snapshot your node will be up and running quicker; under an hour or a few hours, depending on network speed.

caution

In principle building from scratch is the safest and cleanest; if there is an error in the snapshot database, this will propagate to the nodes who download the database. Also the database size increases with extended usage. STAKEWORLD checks for errors and periodically rebuilds its databases to ensure error free databases with minimum disk usage.

Snapshots

The snapshots are available for kusama --chain ksmcc3 and polkadot --chain polkadot in the paritydb --database paritydb and the rocksdb --database rocksdb database format. They are pruned with --state-pruning 1000 --blocks-pruning 1000, which is sufficient for a validator node.

An example systemctl service file can be found here: yourvalidator.service. Copy to /etc/systemd/system and of course change --name, --chain and --database to your preference.

ChainDatabaseFormatBlockheightSizeFullCreation date
Rebuilding snapshotksmcc3rocksdbpruned1433547959G77GThu 08 Dec @ 03:22
direct linkksmcc3paritydbpruned15662497154G160GThu 08 Dec @ 03:27
direct linkpolkadotrocksdbpruned13260585110G114GThu 08 Dec @ 03:35
direct linkpolkadotparitydbpruned13260660110G114GThu 08 Dec @ 03:42
ksmcc3paritydbarchive156627441.2TThu 08 Dec @ 03:49
polkadotparitydbarchive13260723708GThu 08 Dec @ 03:49

Database size

Below a overview of database sizes, you can also view only pruned or archive database size. snapsize

Automatic install

The following script can restore a snapshot for a quickstart. If you want you can first review it on github. You can choose "snapinstall" for a snapshot restore or "nodeinstall" to install a complete node. The script will ask some questions and create an install or restore script which you can review before executing.

The script is for ubuntu/debian flavoured servers.

curl -o- -L https://raw.githubusercontent.com/stakeworld/stakeworld-scripts/master/node-install.sh | bash

Install the database directly

caution

The default binary/systemctl from the apt repository will run as user "polkadot". If you install as root you will get an error "failed to create a test file: Permission denied". You can solve this by running chown -R polkadot:polkadot <dbdir>

Install to /root/.local/share/polkadot/chains/<chain> or change to your target directory.

Paritydb kusama

curl -o - -L http://snapshot.stakeworld.io/paritydb-ksmcc3.lz4 | lz4 -c -d - | tar -x -C /root/.local/share/polkadot/chains/ksmcc3

Paritydb polkadot

curl -o - -L http://snapshot.stakeworld.io/paritydb-polkadot.lz4 | lz4 -c -d - | tar -x -C /root/.local/share/polkadot/chains/polkadot

Rocksdb kusama

curl -o - -L http://snapshot.stakeworld.io/rocksdb-ksmcc3.lz4 | lz4 -c -d - | tar -x -C /root/.local/share/polkadot/chains/ksmcc3

Rocksdb polkadot

curl -o - -L http://snapshot.stakeworld.io/rocksdb-polkadot.lz4 | lz4 -c -d - | tar -x -C /root/.local/share/polkadot/chains/polkadot