Many think that being a validator needs impossible technical skills, others think that it’s just very easy if you are a programmer for example, and many other have no clue what this means.
As we just started the Testnet for Humans.ai, a project that has as main goal Artificial intelligence used to improve and make easier our life, work, to gain new skills and time, we want to also make clearer what a validator is and how to create one for Humans.io.
The below article is going to be full of technical stuff, but it’s main aim is to translate what needs to be done and make it easier to understand even to a newbie.
I) What does a Validator mean?
A validator is a special kind of node that participates in the consensus, and becomes responsible for verifying, voting and maintaining a record of transactions.
Validators store a copy of the blockchain of the network and must perform certain functions in order to keep the system secure. Depending on the network, there might be a limited number of Validator nodes or unlimited. For example, for Humans.ai there there were only 50 validators chosen for Testnet, and other 25 are in pending list.
The most essential part of POS system (Proof of Stake) is represented by validators. They are acting like moderators of the staking system and they have the important job of adding new blocks on the chain.
In order to have the most decentralized system as possible, it is important to elect a good number of validators. This helps the community by offering a greater variety of staking options as well as protecting the system by preventing having the blockchain controlled by one very wealthy validator.
II) What do you need to run a Validator?
- Prerequisites or System requirements
For the technical projects these needs are called prerequisites. Similar with any other service, prerequisites are very important!
a) Strong internet connection
b) You will need to make sure that you get a server with at least 32GB of memory (RAM)
c) Solid-state drive with at least 500GB of SSD disk storage
d) At least 1000mbps network bandwidth
e) Open several ports to connect to the Humans peer-to-peer network
- In order to export tendermint metrics, Prometheus listen address: 26660
- Prometheus exporter: 9464
- To connect to the Humans peer-to-peer network: 26656
- Export Cosmos SDK metrics: 1317
Note that as the usage of the blockchain grows, the server requirements may increase as well, so you should have a plan for updating your server as well.
III) How to build your Humans node/validator
All projects share tutorials and very useful information on their Github. So, make sure you make Github your bestfriend :)
From this point on, we recommend you to follow the official tutorial that you can find here: https://github.com/humansdotai/testnets
In addition to the above steps, you will need to perform as well, our service setup as follows:
- Make sure your machine runs on Ubuntu 20.04
- Start by updating the packages list:
sudo apt update
3. Install the build-essential package by typing:
sudo apt upgrade -y
4. This command installs a bunch of new packages including gcc, g++ and make.
sudo apt-get install manpages-dev
5. Install the necessary packages to run Go
sudo apt install build-essential -y
6. Check the gcc version
7. First remove any existing old Go installation
sudo rm -rf /usr/local/go
sudo rm -rf /root/go
8. Install the compatible and correct Go version
curl https://dl.google.com/go/go1.20.1.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf -
9. Update environment variables to include Go
cat <<'EOF' >>$HOME/.profile
10. Check the GO version
In response, we should get something like this:
go1.20.1 linux / amd64
11. Install git utility ( in case is not installed already)
apt install git
12. Install humansd the latest version and make sure to checkout the correct tag
git clone https://github.com/humansdotai/humans
cd humans && git checkout tags/v0.1.0
13. Verify the installed version with
humansd version --long
14. Set your validator name
humansd init stake2earn --chain-id=humans_3000-1
15. Create a local key or recover an existent one
humansd keys add wallet_test
humansd keys add --recover wallet_test
Don't forget to save your mnemonic seed!
16. Check all the keys your have with
humansd keys list
IV) How to start and manage your Humans node/validator
In order to track your logs and errors, you can create the following files and service file. This is mandatory only if you want to sync the node automatically and restart the Humans Cosmos daemon whenever is needed in cause of failure:
1. Create the files to track errors:
sudo mkdir -p /var/log/humans && sudo touch /var/log/humans/humans.log && sudo touch /var/log/humans/humans_error.log
2. And copy the below script in your system service
sudo tee /etc/systemd/system/humans.service > /dev/null <<'EOF'
Description=humans sync node service
ExecStart=/root/go/bin/humansd start - log_level=warn
3. Check your system service
4. Control & track your logs via next commands:
sudo systemctl enable humans
sudo systemctl start humans
sudo systemctl stop humans
sudo systemctl restart humans
systemctl -l status humans
sudo journalctl -u humans-f
tail -f /var/log/humans/humans.log
tail -f /var/log/humans/humans_error.log
5. Check the status of your node/validator
humansd status 2>&1 | jq .SyncInfo
Pay attention to “catching_up”
If “true” means NOT synced yet.
If “false” means synchronized.
6. Create Validator
After the catching_up is false, you need to create your validator:
humansd tx staking create-validator \
--pubkey=$(humansd tendermint show-validator) \
--moniker=stake2earn 🌜 \
--details="Blockhain validator in POS networks - Decentralized and noncustodial crypto staking services 🌜" \
--gas-prices 0.025uheart \
If you have any questions do not hesitate to contact the stake2earn team via e-mail: firstname.lastname@example.org
We are also very social, and you can find us on: