May 3, 2023

HumansAI running validator


Setting up a validator node in HumansAI can seem like a daunting task at first, but with a little guidance, it can be accomplished by anyone. Here’s a step-by-step guide on how to set up your own validator node in HumansAI.

Step 1: Hardware and Software Requirements

Before setting up the validator node, make sure you have the following hardware and software requirements:

To run mainnet or testnet validator nodes, you will need a machine with the following minimum hardware requirements:

  • 6 or more physical CPU cores
  • At least 500GB of SSD disk storage
  • At least 32GB of memory (RAM)
  • At least 1000mbps network bandwidth

First, let's update our system:

sudo apt update 

sudo apt upgrade

sudo apt install golang

go version 
# Should return go version go1.20.1+ linux/amd64

Now come up with a name for the node and install the latest version of Humansd

NODE_MONIKER=”Your Node Name”

*You must replace — Your node name.

cd || return

rm -rf humans

git clone https://github.com/humansdotai/humans

cd humans || return

git checkout v0.1.0

make install

humansd version # 0.1.0

Initialize the humansd directories and create the local file with the correct chain-id

humansd config keyring-backend test

humansd config chain-id humans_3000-1

humansd init "$NODE_MONIKER" --chain-id humans_3000-1


Download genesis and addrbook

wget -O $HOME/.humansd/config/genesis.json https://testnet-files.itrocket.net/humans/genesis.json

wget -O $HOME/.humansd/config/addrbook.json https://testnet-files.itrocket.net/humans/addrbook.json

Adding seeds

SEEDS="6ce9a9acc23594ec75516617647286fe546f83ca@humans-testnet-seed.itrocket.net:17656"
PEERS=""
sed -i 's|^seeds *=.*|seeds = "'$SEEDS'"|; s|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.humansd/config/config.toml

Editing the file app.toml

sed -i 's|^pruning *=.*|pruning = "custom"|g' $HOME/.humansd/config/app.toml
sed -i 's|^pruning-keep-recent  *=.*|pruning-keep-recent = "100"|g' $HOME/.humansd/config/app.toml
sed -i 's|^pruning-interval *=.*|pruning-interval = "10"|g' $HOME/.humansd/config/app.toml
sed -i 's|^snapshot-interval *=.*|snapshot-interval = 0|g' $HOME/.humansd/config/app.toml

Then editing config.toml

sed -i 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0.001aheart"|g' $HOME/.humansd/config/app.toml
sed -i 's|^prometheus *=.*|prometheus = true|' $HOME/.humansd/config/config.toml
sed -i 's|^create_empty_blocks_interval *=.*|create_empty_blocks_interval = "30s"|' $HOME/.humansd/config/config.toml
sed -i 's|^timeout_propose *=.*|timeout_propose = "30s"|' $HOME/.humansd/config/config.toml
sed -i 's|^timeout_propose_delta *=.*|timeout_propose_delta = "5s"|' $HOME/.humansd/config/config.toml
sed -i 's|^timeout_prevote *=.*|timeout_prevote = "10s"|' $HOME/.humansd/config/config.toml
sed -i 's|^timeout_prevote_delta *=.*|timeout_prevote_delta = "5s"|' $HOME/.humansd/config/config.toml

Creating service

sudo tee /etc/systemd/system/humansd.service > /dev/null << EOF
[Unit]
Description=Humans AI Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which humansd) start
Restart=on-failure
RestartSec=10
LimitNOFILE=10000
[Install]
WantedBy=multi-user.target
EOF

Reset and download snapshot and start humansd

humansd tendermint unsafe-reset-all --home $HOME/.humansd

curl https://testnet-files.itrocket.net/humans/snap_humans.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.humansd

sudo systemctl daemon-reload

sudo systemctl enable humansd

sudo systemctl start humansd

Checking logs

sudo journalctl -u humansd -f

Create validator and wallet

humansd keys add wallet

!Saving our seed phares and validator keys

cat $HOME/.humans/config/priv_validator_key.json

Checking sync

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

Checking balance before create a validator

humansd q bank balances $(humansd keys show wallet -a)

Finaly create our validator

humansd tx staking create-validator \
--amount 1000000uheart \
--from $WALLET \
--commission-rate 0.1 \
--commission-max-rate 0.2 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--pubkey $(humansd tendermint show-validator) \
--moniker "$MONIKER" \
--identity "" \
--details "Our future is AI" \
--chain-id humans_3000-1 \
--gas auto --gas-adjustment 1.5 \
-y


Explorers

itrocket

NodesGuru