How to join validator set via snapshot

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.

Let’s start!

1.Get a server with recommended requirements ( check them out here )

Рисунок2

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

source $HOME/.bash_profile

mkdir ~/$WORKSPACE

cd ~/$WORKSPACE

  1. 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)

For VFN:

mkdir -p /var/lib/docker/volumes/aptos-fullnode/_data/db/

For Validator:

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:

For VFN:

mv ~/$WORKSPACE/data/db/* /var/lib/docker/volumes/aptos-fullnode/_data/db/

For Validator:

mv ~/$WORKSPACE/data/db/* /var/lib/docker/volumes/aptos-validator/_data/db/

2.4 Download the files needed to run VFN or Validator

For VFN:
vfn

For Validator:
valik

Remember to change the IP to the new one in the configuration file ~/$WORKSPACE/alice/operator.yaml

And start our node:
VFN:

cd ~/$WORKSPACE && docker-compose -f docker-compose-fullnode.yaml up -d

Validator:

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!

33 Likes

thx buddy
Hope this post will help someone

12 Likes

omg thx for information

12 Likes

Thanks for your info

17 Likes

Thanks for info

23 Likes

Many thanks for your post <3

14 Likes

Thanks a lot Bro

15 Likes

Great great info, thank you so much

11 Likes

Thanks mate bro

12 Likes

this post will help someone, thank you

14 Likes

Thanks for your info

15 Likes

Thanks for info :smiling_face_with_three_hearts:

9 Likes

Big thanks to you

8 Likes

Thank you so much

8 Likes

Thanks for helpfull info

9 Likes

That’s what this forum is for :+1:

10 Likes

But I think running a validator will require more programming experience and funds

11 Likes

wow, great info, thank mate

7 Likes

Thank you very much

5 Likes

Thanks for great info, bro

4 Likes