October 15, 2023

Guide - installing a validator node in the ZetaChain project

Website - Discord - Twitter - Github - Zealy

Updated - 24.01.2024

RU | ENG

Contents:

  1. A short introduction
  2. Preparation of the workplace
  3. Rent a server
  4. Connecting to the server
  5. Node installation
  6. Creating a wallet
  7. Let's create a validator!
  8. Working with a node
  9. Node update
  10. Backup
  11. Restore from backup
  12. Slem :)

A short introduction

There is almost no guide on the Internet for installing a node for this project, and even more so there are no such detailed guides for complete beginners :)

I will try to go through all the steps in sufficient detail from preparing the workplace to installing the node itself.

Preparation of the workplace

Windows will be used as the operating system, so all the software will be for this OS. If there is such a need, I’ll tell you what software can be used on MacOS.

Download the MobaXterm program from the link - select the Portable version if you do not want to install the software on your PC.

We need this program to remotely connect via SSH to the server we rented (we will rent the server later).

After we unpack the archive with the program we downloaded, we need to run the executable file in the folder MobaXterm_Personal_23.2.exe

After starting the program, we need to enable the option to display the resource consumption of the remote server so that we understand what load we are currently putting on our remote server.

Enable the parameter Remote-monitoring (experimental)

Then press the button ОК.

At this stage, we complete the preparation of the workplace.

Now we need to rent a remote server for our node.

Rent a server

We will rent a server from Hezner - a German company, price/quality at the moment. At the same time, it does not limit registration for sanctioned countries :)

You can also rent servers from companies that operate in your country, I’ll tell you, write :)

Follow my referral link and register on Hezner.

ou need to fill in your full name and country according to your local passport or international passport, as you will have to confirm your identity.

We will also need to link a card for payment. A virtual card can be created by installing the Pyypl application on your phone (there are many videos on YouTube, I will not dwell on this in detail).

For those who are doing well with their cards, we simply link them to their account :)

After we have registered, linked the card and confirmed our identity, we go to select a server.

Follow the link and click create project and enter any name.

Click on the block with our project

Click the add server button

A small digression: on Hezner, we pay for server rental according to the scheme, as much as we used, we paid that much, the price is for a month of continuous use. For example, if the server costs 15 euros per month, and we used the server for 10 days and deleted it, then at the end of the month we will receive an invoice only for these 10 days - approximately 5 euros. And yes, here we receive invoices in the mail stating how much we owe and for what, and after a couple of days this amount is automatically debited from the linked card.

Now let's see what server requirements are written in the official documentation on the ZetaChain website.

Since we will be installing a validator node, we need the following characteristics of a VPS server - a processor with 4 cores, 16 gigabytes of RAM and 300 gigabytes of disk space, preferably the disk should be SSD or better yet NVME for better read/write speed disk.

Also, based on the official documentation, we need to understand which operating system to choose for installation on our server.

We’ve decided on the server’s characteristics, let’s go choose a server on Hetzner.

We have already clicked the "Add Server" button earlier, select the location of our server and the operating system.

Then we select the type of our server, processor architecture and other characteristics. We will choose such a server, it’s okay that it falls a little short of the declared characteristics that are indicated in the official documentation on the ZetaChain website.

As you can see, the monthly price of such a server will cost us 16.32 euros per month, if you have dollars on your card, they will be converted into euros automatically.

Click "Create & Buy now"

After this, we need to wait a couple of minutes until our server is created and we will see this window.

Next, we go to our email and look at the letter from Hezner where they sent us all the access details to connect to our server via SSH.

Connecting to the server

Now we have everything to connect to our server via SSH.

Open our program MobaXterm

And we create our SSH connection.

In the "Remote host" field we insert the IPv4 address from the letter.

In the user field, we click the “Specify username” checkbox and in the right field, delete the selection and write “root” - after all, click the “OK” button.

On the left we have our connection, and on the right we see that we have connected to the server and all that remains is to enter the password from the letter.

Copy the password and IMPORTANT - to paste the password you just need to right-click once in this place.

The program will display a message and ask if we want to store this password in the password database, if yes, we will need to create a master password for all our such connections.

After we have saved the password, we see that we have connected to our server and we need to change our password with which we logged in for security purposes.

We enter again the current password with which we logged in, I remind you that on the remote server we paste all the commands with one right-click into the field where you need to enter something, and I will show you how to copy further :)

After you have inserted your password with the right mouse button, you will not see that anything has changed there, just press the "Enter" key and now we come up with your new password, you can start entering it simply from the keyboard or you can also write it somewhere and copy and paste. The trick is for security purposes on Linux/Unix operating systems when we enter a password, it is not displayed in any way and when typing we should not make mistakes even in one character, since we cannot erase an incorrectly typed character, since we do not see what we are typing: ) If you entered incorrectly by hand, simply press the "Enter" key and start entering again. But to avoid mistakes and manual typing, just copy and paste from somewhere :)

Enter a new password and repeat it again.

And now we are finally on our server and can start creating :)

But first, let's reconnect to our server again.

Since we changed the password, the next time we connect, the program will try to log in to the server with our saved old password.

Let's close the connection by clicking on the cross at the top.

Afterwards we simply double-click with the left mouse button on our already created connection.

And we see that access is denied to us and we need to enter the current password.

We enter the current password that we came up with ourselves and save it again in the password wizard of the MobaXterm program.

Now everything is definitely done :) You can start creating :)

Node installation

You can go the hard way and start installing a node using the official guide from the ZetaChain website, but we’ll cheat a little and use ready-made scripts from guys who professionally deal with nodes :)

First, let's run our first command on the server, our operating system has many installed components of various software. When Hezner created our server, he uploaded a ready-made image of the operating system and many of the components there were very outdated, let’s update this whole mess so that when installing the node we don’t have any errors or software incompatibility.

Copy the command and paste it with the right mouse button.

apt update && apt upgrade -y

Wherever there are similar windows, simply press the "Enter" key.

After the update is complete, you will again have a command prompt.

Now we go to the NodeJumper website - we will take the ready-made code for installing the node from them.

They have a special button on their website, by clicking on which we will copy an entire block of code.

Click the "Copy" button and right-click paste this block of code into our command line and press "Enter".

If a window appears, press "Enter".

After the update has finished, we will see an input line again.

Next, we will need to enter the name of our node in Latin, preferably without spaces or any symbols.

in the "Node Name" field - my node name is now written down, you don't need to write the same one when installing, we must come up with YOUR OWN :)

On the website, generate the code below with the name of your node, copy the large bottom block of code, paste it into the command line and press “Enter”.

Literally in 3-5 minutes, all the necessary components will be downloaded and the logs of the already running node will be sent, where we can see that the synchronization of blocks of the Zetachain blockchain itself begins.

The “height” parameter just shows us which block is currently being synchronized, otherwise this is called the block height.

We can always look at the current block on the NodeJumper website in the site header.

We compare the height of our blocks and the height indicated on the site; in the end they should be close to the same value.

At this stage we have installed the node and now we need to create our own wallet or import the seed phrase from your Kepler or Leap wallet :)

I will show you how to create a new wallet and give you a command on how to import your wallet through the seed phrase.

To exit the logging mode where we look to see if the blocks are moving and if there are any errors, press the key combination CTRL+C and we will again get to the command line.

If we go back to look at the logs, we insert this command.

sudo journalctl -u zetacored -f --no-hostname -o cat

Creating a wallet

We get almost all the commands here https://app.nodejumper.io/zetachain-testnet/cheat-sheet.

And so to create a new wallet, we need to run the following command.

zetacored keys add wallet

After executing this command, we will be shown our wallet and the seed phrase from it, we need to copy this somewhere and keep it carefully :)

root@ubuntu-8gb-fsn1-1:~# zetacored keys add wallet

- address: zeta1v4eg64c8qahhywefa0ecl72njkmdthnv7lm2jc
  name: wallet
  pubkey: '{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"Aw4zK6AP8mdlyYo7xzQHg3kh9KvbAmF98WNoq0ix/D65"}'
  type: local


**Important** write this mnemonic phrase in a safe place.
It is the only way to recover your account if you ever forget your password.

tower please minimum chimney state captain page hammer family erupt chef ribbon express gym enable peanut float educate road soon initial ride pa

If we have forgotten our wallet address, we can look at the list of addresses we created with this command.

zetacored keys list

Now that we have created our wallet address, let's request test tokens for it from the discord thread.

But first, we need to import our address into the wallet, I will show it using Kepler as an example. This is necessary so that we can request test tokens to the EVM address of our wallet, which looks like this.

0x65728d5707076f723b29eBf38Ff95395B6D5de6C

In the Zeta network, we create the following address.

zeta1v4eg64c8qahhywefa0ecl72njkmdthnv7lm2jc

We cannot request tokens to such an address in discord, so let’s go add the Zeta test network to Kepler and request tokens :)

I think it won’t be difficult for you to install the wallet itself using this link if you don’t yet have a port.

We import our seed phrase at this stage.

And so we installed the wallet and imported our address created on the server.

Let's now add the ZetaChain Athens-3 testnet.

Go to the website https://chains.keplr.app/

We write Zeta in the search and add it.

And so the network has been added and now we can check whether the address is displayed to us?

And as we see, we also now have an EVM address available that is associated with our IBC (Cosmos) wallet, and we will request test tokens on it in discord.

Copy the address and go to discord.

We go to the faucet branch zeta-faucet-athens-3 using this link

And we write the following request to the bot.

zeta faucet drip 0x65728d5707076f723b29eBf38Ff95395B6D5de6C

Naturally, you substitute your address.

We don’t pay attention to the screen below that there is a different address :) But the bot should answer you as in the screenshot and you should have 3 coins in your wallet.

Now let's check the number of coins on our server.

We enter the following command, only you need to replace my address that begins with “zeta” with your own.

zetacored q bank balances zeta1ng3h0tr24vvsupg3r965jhw89sms8s5c5a0c6v --node https://zetachain-athens.blockpi.network:443/rpc/v1/public

As a result, the server should show us the number of our coins.

In the "amount" field we see the number of our tokens. In my case, this is a little more than one token. For example, 1 token is 1 followed by 18 zeros. You should have 3 tokens there if you haven’t requested tokens before :)

For those who have already created their own address or have imported their seed phrase into Kepler or Leap.

On the server where a new wallet is created, we need to import your seed phrase, we do it with the following command.

zetacored keys add wallet --recover

Afterwards you will be asked to enter your seed phrase, paste it in and press “Enter”.

If everything is fine, then we check the list of our wallets with this command.

zetacored keys list

The rest of the steps are the same, add the network to your wallet and request tokens.

And so, now we move on to the most important stage, creating a validator!

Let's create a validator!

And so, we have tokens, it’s time to create our validator.

Let's run the following command.

zetacored tx staking create-validator \
--amount=1000000000000000000azeta \
--pubkey=$(zetacored tendermint show-validator) \
--moniker="NameMyNode" \
--identity=FFB0AA51A2DF5955 \
--details="velyar is the best" \
--chain-id=athens_7001-1 \
--commission-rate=0.10 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--from=wallet \
--gas-prices=0.1azeta \
--gas-adjustment=1.5 \
--gas=auto \
--node https://zetachain-athens.blockpi.network:443/rpc/v1/public \
-y

We copy this entire command into a notebook and change the moniker="NameMyNode" field - the NameMyNode value to your node name, which you specified when installing the node.

If all is well, the server will give you the hash of your transaction.

The validator has been created, congratulations to all of us :)

Now let's check whether we really created a validator and where we stand :)

Go to the website https://zetachain.exploreme.pro/validators

And we are looking for the name of our validator, there are two tabs.

You can click on your name and see all the details.

Here we see our wallet address, the valoper address of our node through which we can delegate tokens or tell it to someone to delegate to us :) Here is mine just in case :)

zetavaloper1ng3h0tr24vvsupg3r965jhw89sms8s5csahyh6

We can also see here the number of tokens delegated to us.

And we pay attention to the status of our node. Here it shows whether we are active validators or not, as well as whether we are in prison or not.

If you are in prison, you need to execute this command to get out of it.

zetacored tx slashing unjail --from wallet --chain-id athens_7001-1 --gas-prices 0.1azeta --gas-adjustment 1.5 --gas auto --node https://zetachain-athens.blockpi.network:443/rpc/v1/public -y

Then refresh the page and check the status. Naturally, you must have tokens to perform any such transaction :)

Let's now try to delegate one more token to ourselves.

Let's run the following command.

zetacored tx staking delegate $(zetacored keys show wallet --bech val -a) 1000000000000000000azeta --from wallet --chain-id athens_7001-1 --gas-prices 0.1azeta --gas-adjustment 1.5 --gas auto --node https://zetachain-athens.blockpi.network:443/rpc/v1/public -y

If we want to delegate our tokens to another validator, then the command is like this.

zetacored tx staking delegate zetavaloper1mvjy7qa5lh5s7667t0wupmk8zcczrer2xa42fr 1000000000000000000azeta --from wallet --chain-id athens_7001-1 --gas-prices 0.1azeta --gas-adjustment 1.5 --gas auto -y --node https://zetachain-athens.blockpi.network:443/rpc/v1/public -y

After the word delegate is the valoper address of the person to whom we delegate the tokens. We change it to the one you need and here it costs the same 1 token, if you need more, we also change the number.

This concludes our test.

Next I will show where you can take other commands to work with our node :)

Working with a node

In this section you can find all the useful commands.

For example, let's check whether our node has been completely synchronized; if after executing the command it returns the value "false", then the synchronization has been completed completely.

zetacored status 2>&1 | jq .SyncInfo.catching_up

We see that our value is “false” which means everything is in order.

There are many commands here, you can try it yourself or ask me what these or other commands are for :)

Node update

In the Zetachain discord in the #testnet-announcements thread, news about updates is posted. It usually indicates on which block it is necessary to update to the current version.

Once we have reached the block we need, we start updating.

Go to the Upgrade section and copy the entire code from the Manual Upgrade section.

After a successful update, we will have logs.

Be sure to check the version of zetacored after updating.

zetacored version

Backup

After we have successfully installed everything and made sure that everything is stable we need to make a backup of important files from our server, this is in case something goes wrong with our server and we have to urgently restore it to another hosting provider.

These are the files we'll need:

1. The most important file priv_validator_key.json, it is located in this path, since we work through the application MobaXterm we have easy access to the server files, just select the file we need and click to download it to your computer.

2. Also from the same folder we need to save two files addrbook.json and node_key.json.

3. And our address files are also important.

These two files are located here, save both.

Restore from backup

We will describe the recovery process step by step, it is important for us not to lose the Uptime of our node when moving to another server, downtime of our node is not desirable for the network, since the load increases on other network participants, and it is important for us to maintain the operation of the network without the slightest downtime.

1. The first step is to install the node on our new server and wait for the node to fully synchronize to the actual block.

2. In the second step, we stop the zetacored process on the new server with the command.

sudo systemctl stop zetacored

3. Now we need to copy all our files that we have saved to the same places, for this there is a button like this.

4. Now a very important step, completely stop our old server, physically shut down our server at the VPS provider, make sure it is not available and only then proceed to the next step.

5. Start our new server with the command.

sudo systemctl restart zetacored

After that we should have stable logs and green blocks will be shown.

Thanks to everyone who made it to the end!

That's all for now... :)

P.S. Vlad (Slem) Thank you very much for your patience and your overwhelming help! Really appreciate it :)