How to Set Up and Manage a Validator on the Humans Blockchain

BlockHunters
5 min readMay 2, 2023

--

In this article, we will explore the process of setting up and managing a validator on the Humans blockchain. Validators play a crucial role in maintaining the security and integrity of the blockchain, and they are rewarded with tokens for their efforts. By following the steps outlined below, you can create your own validator and contribute to the health and stability of the Humans blockchain.

Installing the Humans.ai Friction Testnet Node

The Humans.ai Friction Testnet is a Tendermint-based blockchain designed to provide high-performance, scalable infrastructure for AI and machine learning applications. If you’re interested in participating in the network as a validator or simply want to explore the blockchain, you’ll need to set up a node.

Prerequisites

Before you begin, you’ll need the following:

  • A remote server with SSH access
  • Git installed on your server
  • Basic knowledge of Linux command-line interface

1. Install Go 1.20.4

Download the Go binary archive from the official website

wget https://golang.org/dl/go1.20.4.linux-amd64.tar.gz

Extract the archive to the /usr/local directory:

sudo tar -C /usr/local -xzf go1.20.4.linux-amd64.tar.gz

Add the Go binary directory to your PATH environment variable. You can do this by adding the following line to your ~/.bashrc or ~/.zshrc file:

export PATH=$PATH:/usr/local/go/bin

Reload your shell to update the PATH environment variable:

source ~/.bashrc

Verify that Go is installed by running the following command:

go version

You should see output similar to the following:

go version go1.20.4 linux/amd64

That’s it! Go 1.20.4 is now installed on your Ubuntu server. You can proceed with the remaining steps in the installation guide for the Humans.ai Friction Testnet node.

2. Build & Install Humans Binary

Clone the Humans GitHub repository to your server

  • Run the following command to clone the repository:
git clone https://github.com/humansdotai/humans.git

Change to the directory of the cloned repository:

  • Run the following command to navigate to the directory:
cd humans

Check out the specified release version:

  • Run the following command to check out the release version v0.1.0:
git checkout v0.1.0

Build the node software:

  • Run the following commands to build and install the software:
make build
sudo make install

3. Connect to the Humans Friction Testnet

Init Humans Node:

  • Run the following commands to create .humansd folder in the default PATH:
# Replace <node_moniker> with your desired moniker
humansd init <node_moniker> --chain-id humans_3000-1

Edit the config files:

  • Replace the values of the following parameters in the app.toml file located in the ~/.humansd/config folder
# Replace
prometheus-retention-time = 0
enabled = false

# With
prometheus-retention-time = 1000000000000
enabled = truetoml
  • Replace the values of the following parameters in the config.toml file located in the ~/.humansd/config folder
# Replace
create_empty_blocks = true
prometheus = false
create_empty_blocks_interval = "0s"
timeout_propose = "3s"
timeout_propose_delta = "500ms"
timeout_prevote = "1s"
timeout_prevote_delta = "500ms"

# With
create_empty_blocks = false
prometheus = true
create_empty_blocks_interval = "30s"
timeout_propose = "30s"
timeout_propose_delta = "5s"
timeout_prevote = "10s"
timeout_prevote_delta = "5s"

Add seed nodes to the config.toml file located in the ~/.humansd/config folder.

# Replace
seeds = ""

# With
seeds = "ffeadb613989c004a6b39dbaa6c3f732c6413d4c@seed.humans-friction.bh.rocks:36656"

Download the genesis.jsonfile:

wget https://raw.githubusercontent.com/humansdotai/testnets/master/friction/genesis-M1-P2.json -O ~/.humansd/config/genesis.json

4. Install Cosmovisor and set up a Linux system service

Install Cosmovisor

  • Run the following command to install Cosmovisor
go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.0.0

Configure Cosmovisor:

  • Create a directory for cosmovisor:
mkdir -p ~/.humansd/cosmovisor
  • Create a directory for the genesis binary:
mkdir -p ~/.humansd/cosmovisor/genesis/bin
  • Copy the node binary to the Cosmovisor directory:
cp `which humansd` ~/.humansd/cosmovisor/genesis/bin
  • Create a currentsymlink to the genesis folder in the Cosmovisor directory
ln -s ~/.humansd/cosmovisor/genesis/bin ~/.humansd/cosmovisor/current

Set up a Linux system service for Cosmovisor:

  • Create a new service file in the /etc/systemd/system directory:
sudo nano /etc/systemd/system/humansd.service
  • Add the following content to the service file:
[Unit]
Description=Humans.ai Friction Testnet Node
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=5s
User=<YOUR_USER>
Environment="DAEMON_NAME=humansd"
Environment="DAEMON_HOME=/<YOUR_USER>/.humansd"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true"
Environment="DAEMON_LOG_BUFFER_SIZE=512"
Environment="UNSAFE_SKIP_BACKUP=true"
ExecStart=/usr/local/bin/cosmovisor start
LimitNOFILE=infinity
LimitNPROC=infinity

[Install]
WantedBy=multi-user.target

Replace <YOUR_USER> with the username of the target machine

  • Save and close the file.
  • Reload the systemd configuration:
sudo systemctl daemon-reload
  • Enable the service to start at boot time:
sudo systemctl enable humans.service
  • Start the service:
sudo systemctl start humans.service

This will start the node and it should begin syncing.

  • You may check the syncing status by using one of the following commands:
# Query the node's RPC API
humansd status
# Read the system service logs
sudo journalctl -fu humansd

Creating a Validator

First, you need to generate your validator’s public key (humanvalconspub…). This key can be used to create a new validator by staking $HEART tokens. To find your validator’s public key, run the following command:

humansd tendermint show-validator

Keep your public key safe and secure, as you will need it later in the process.

To create your validator on the testnet, use the following command:

humansd tx staking create-validator \
— amount=1000000000000000000aheart \
— pubkey=$(humansd tendermint show-validator) \
— moniker=”choose a moniker” \
— chain-id=<chain_id> \
— commission-rate=”0.05" \
— commission-max-rate=”0.10" \
— commission-max-change-rate=”0.01" \
— min-self-delegation=”1000000" \
— gas=”auto” \
— gas-prices=”1800000000aheart” \
— from=<key_name>

This command will create your validator on the testnet and set various parameters, such as commission rates and minimum self-delegation. Make sure to replace <key_name> with the appropriate values for your setup.

After creating your validator, you can confirm that it is part of the validator set by using a third-party explorer.

Editing Validator Description
You can edit your validator’s public description, which will help delegators decide which validators to stake. To edit your validator’s description, use the following command:

humansd tx staking edit-validator
— moniker=”<your_moniker>” \
— website=”https://humans.ai" \
— identity=<your_keybase_identity> \
— details=”To infinity and beyond!” \
— chain-id=<chain_id> \
— gas=”auto” \
— gas-prices=”1800000000aheart” \
— from=<key_name> \
— commission-rate=”0.10"

Replace <your_moniker>, <your_keybase_identity>, <chain_id>, and <key_name> with the appropriate values for your setup.

Viewing Validator Information
To view your validator’s information, use the following command:

humansd query staking validator <account_cosmos>

Tracking Validator Signing Information
To keep track of your validator’s signatures, use the signing-info command:


humansd query slashing signing-info <validator-pubkey>\
— chain-id=<chain_id>

Unjailing Validator

If your validator becomes “jailed” due to downtime, you must submit an Unjail transaction to regain block proposer rewards. Use the following command to unjail your validator:

humansd tx slashing unjail \
— from=<key_name> \
— chain-id=<chain_id>

Confirming Your Validator is Running

To confirm your validator is active, use the following command:

humansd query tendermint-validator-set | grep "$(humansd tendermint show-address)"

Common Problems and Solutions

Validator has voting_power: 0

If your validator is jailed, follow these steps to unjail your validator and regain voting power:

Start humansd if it is not running.

humansd start

Wait for your full node to catch up to the latest block, then unjail your validator.

humansd tx slashing unjail \
— from=<key_name> \
— chain-id=<chain_id>

Check your validator’s status to see if the voting power is restored.


humansd status

In conclusion, setting up and managing a validator node on the Humans blockchain can be a rewarding experience, both financially and personally. By following the steps outlined in this guide, you can become an important contributor to the network’s security and receive block rewards for your efforts. However, it is essential to stay up to date with the latest developments in the ecosystem and to continuously monitor your node’s performance to ensure optimal performance. We hope this guide has been helpful in getting you started on your validator journey, and we look forward to seeing you contribute to the Humans blockchain’s success!

--

--

No responses yet