Snapshot
Chain | Database | Format | Blockheight | Size | Full | Creation date | |
---|---|---|---|---|---|---|---|
direct link | ksmcc3 | rocksdb | pruned | 17113765 | 179G | 207G | Mon 20 Mar @ 02:22 |
direct link | ksmcc3 | paritydb | pruned | 17113866 | 169G | 176G | Mon 20 Mar @ 02:32 |
direct link | polkadot | rocksdb | pruned | 14720522 | 129G | 134G | Mon 20 Mar @ 02:40 |
direct link | polkadot | paritydb | pruned | 14720595 | 129G | 133G | Mon 20 Mar @ 02:47 |
ksmcc3 | paritydb | archive | 17114085 | 1.4T | Mon 20 Mar @ 02:53 | ||
polkadot | paritydb | archive | 14720660 | 910G | Mon 20 Mar @ 02:53 |
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.
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.
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
, which is sufficient for a validator node.
Database size
Below a overview of database sizes, you can also view only pruned or archive database size.
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
Manual install
Setup a validator node
Setting up a validator node is covered here. The default apt install creates an user polkadot with a home directory /home/polkadot
and a default service script /usr/lib/systemd/system/polkadot.service
.
Install the database
Database location: By default the polkadot binary runs as user polkadot and creates .local/share/polkadot
in the users homedirectory. So for user polkadot (the default when installing from apt) that is /home/polkadot/.local/share/polkadot
.
This can be changed with --base-path
so for example --base-path /home/polkadot
or --base-path /home/polkadot/myvalidator
or whatever you prefer.
To delete the old database, restore a new kusama paritydb database snapshot for your node with a default install:
su - polkadot -s /bin/bash
rm -fr /home/polkadot/.local/share/polkadot/chains/ksmcc3
mkdir -p /home/polkadot/.local/share/polkadot/chains/ksmcc3
curl -o - -L http://snapshot.stakeworld.io/paritydb-ksmcc3.lz4 | lz4 -c -d - | tar -x -C /home/polkadot/.local/share/polkadot/chains/ksmcc3
You can check the startup by running the binary as user polkadot and see if it accepts the database or throws any errors:
su - polkadot -s /bin/bash
polkadot --chain kusama --database paritydb
Edit the systemctl startup script
Edit the default service script and add for example --database paritydb --chain kusama
:
su -
vi /usr/lib/systemd/system/polkadot.service"
systemctl daemon-reload
systemctl retart polkadot
systemctl enable polkadot
Or create a new script by copying the default service script:
su -
cp /usr/lib/systemd/system/polkadot.service /etc/systemd/system/validator.service
vi /etc/systemd/system/validator.service
You can edit settings at wish, changing ports and settings at will.
[Service]
ExecStart=/usr/bin/polkadot --chain kusama --name validator --validator --state-pruning 1000 --prometheus-external --base-path /home/polkadot --database paritydb --telemetry-url 'wss://telemetry.polkadot.io/submit/ 1'
systemctl daemon-reload
systemctl start validator
systemctl enable validator
If you installed 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
Different databases:
Below restore commands for different databases to the default directory. Best run them as user polkadot (su - polkadot -s /bin/bash
) or when running as root do a chown polkadot:polkadot <dbdir>
) or when running as root do a chown polkadot:polkadot <dbdir>
. Of course change the part after -C
when installing to another location.
Paritydb kusama
curl -o - -L http://snapshot.stakeworld.io/paritydb-ksmcc3.lz4 | lz4 -c -d - | tar -x -C /home/polkadot/.local/share/polkadot/chains/ksmcc3
Paritydb polkadot
curl -o - -L http://snapshot.stakeworld.io/paritydb-polkadot.lz4 | lz4 -c -d - | tar -x -C /home/polkadot/.local/share/polkadot/chains/polkadot
Rocksdb kusama
curl -o - -L http://snapshot.stakeworld.io/rocksdb-ksmcc3.lz4 | lz4 -c -d - | tar -x -C /home/polkadot/.local/share/polkadot/chains/ksmcc3
Rocksdb polkadot
curl -o - -L http://snapshot.stakeworld.io/rocksdb-polkadot.lz4 | lz4 -c -d - | tar -x -C /home/polkadot/.local/share/polkadot/chains/polkadot