Hey guys, today I will tell you about how to join validator set with snapshot, that’s really useful case when you know that your node will have technical maintenance time. Because you will receive full data base. Fast sync is ± the same speed, maybe even longer. But fast sync omits syncing historical transactions.
1.Get a server with recommended requirements ( check them out here )
1.2 Connect, configure as well as the main server with aptos validator:
Install the latest system updates.
Create a user, set up key login, open/close ports, etc.
Install docker and docker-compose. Optionally, you can install the Aptos CLI.
1.3 Create the same variables as you created on the main node.
echo export USERNAME=alice >> $HOME/.bash_profile
echo export WORKSPACE=mainnet >> $HOME/.bash_profile
- Downloading a snapshot
(more info here)
We will download snapshots from here (thanks to these guys):
mainnet: Aptos Node Snapshot | Polkachu
mainnet and testnet: Snapshots - BwareLabs
Next we need to create a folder where we will download the snapshot (blockchain database):
The folder with the database must be in the folder where the container will be created at start, by default this is /var/lib/docker/volumes/
If you have changed the root directory of the docker, you should use the directory you use
You can check it with the command:
docker info|grep “Docker Root Dir”
2.1 Create a directory where we will then download the blockchain database (Depending on what you want to run vfn or validator, the paths will look different)
mkdir -p /var/lib/docker/volumes/aptos-fullnode/_data/db/
mkdir -p /var/lib/docker/volumes/aptos-validator/_data/db/
Install the auxiliary software:
sudo apt install snapd -y
sudo snap install lz4
2.3 Download the snapshot (see above for links to the actual archive with the database):
wget -O aptos_126950751.tar.lz4 https://snapshots.polkachu.com/snapshots/aptos/aptos_126950751.tar.lz4 --inet4-only
Unpack the archive:
lz4 -c -d aptos_126950751.tar.lz4 | tar -x -C ~/$WORKSPACE
Downloading and unpacking takes about 2 hours (depends on your internet speed).
Then move the base to our directory, which will be used to start the node:
mv ~/$WORKSPACE/data/db/* /var/lib/docker/volumes/aptos-fullnode/_data/db/
mv ~/$WORKSPACE/data/db/* /var/lib/docker/volumes/aptos-validator/_data/db/
2.4 Download the files needed to run VFN or Validator
Remember to change the IP to the new one in the configuration file ~/$WORKSPACE/alice/operator.yaml
And start our node:
cd ~/$WORKSPACE && docker-compose -f docker-compose-fullnode.yaml up -d
cd ~/$WORKSPACE && docker-compose up -d
All done. Now check the connection of the Connect to Aptos Network | Aptos Docs node.
You can delete the downloaded archive to save space:
rm -v aptos_126950751.tar.lz4
Thanks for your attention and hope that was helpful!