Актуально
February 12, 2023

Humans.ai

Discord

Docs

Twitter

Server Preparation

Working with a binary file and setting up

Creating a validator and generating a wallet

Useful commands

State Sunc

Update

1.Подготовка сервера - Server Preparation

Обновление и установка зависимостей - Upgrade and install dependencies

sudo apt update && sudo apt upgrade -y && \
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu gcc git jq chrony liblz4-tool -y

Installing Go

ver="1.19.1" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \
source $HOME/.bash_profile && \
go version

2.Работа с бинарным файлом и настройка - Working with a binary file and setting up

Cloning a repository

# Download the installation setup configuration
git clone https://github.com/humansdotai/humans
cd humans
git checkout v1.0.0
go build -o humansd cmd/humansd/main.go
sudo cp humansd /usr/local/bin/humansd

Initializing

humansd init <name_moniker> --chain-id testnet-1
humansd config keyring-backend test
humansd config chain-id testnet-1

Download genesis

curl -s https://rpc-testnet.humans.zone/genesis | jq -r .result.genesis > $HOME/.humans/config/genesis.json

Correct the configuration file

external_address=$(wget -qO- eth0.me)
sed -i.bak -e "s/^external_address *=.*/external_address = \"$external_address:26656\"/" $HOME/.humans/config/config.toml

sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0025uheart\"/;" ~/.humans/config/app.toml

PEERS="e4234a5fba85b2c3d2ad157b6961ac3d115f4c49@humans-testnet.nodejumper.io:28656,[email protected]:26656,[email protected]:30656,[email protected]:2556,[email protected]:56656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:17656,[email protected]:26656,[email protected]:26656,[email protected]:23656,[email protected]:15656,[email protected]:60856,[email protected]:13656,[email protected]:22656,[email protected]:22656,[email protected]:39656,[email protected]:26656,[email protected]:26656,[email protected]:13656,[email protected]:26656,[email protected]:26656,[email protected]:60556,[email protected]:12656,[email protected]:46656,[email protected]:60856,[email protected]:26656,[email protected]:11026,[email protected]:26656,[email protected]:48656,[email protected]:26756,[email protected]:26656,[email protected]:36656,[email protected]:17656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:55686,[email protected]:11026,[email protected]:26656,[email protected]:26656,[email protected]:18456,[email protected]:1166"
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.humans/config/config.toml

SEEDS=""
sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.babylond/config/config.toml

Prunning `app.toml'

pruning="custom"
pruning_keep_recent="1000"
pruning_interval="10"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.babylond/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.babylond/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.babylond/config/app.toml

Create a service file

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

Launch

sudo systemctl daemon-reload
sudo systemctl enable humansd
sudo systemctl start humansd

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

3.Создание валидатора и генерация кошелька - Creating a validator and generating a wallet

Wallet

# создать кошелек
humansd  keys add <name_wallet> --keyring-backend os

# восстановить кошелек (после команды вставить seed)
humansd  keys add <name_wallet> --recover --keyring-backend os

Creating a validator

humansd tx staking create-validator \
--amount=9000000uheart \
--pubkey=$(humansd tendermint show-validator) \
--moniker="$NODE_MONIKER" \
--chain-id=testnet-1 \
--commission-rate=0.1 \
--commission-max-rate=0.2 \
--commission-max-change-rate=0.05 \
--min-self-delegation=1 \
--fees=10000uheart \
--from=wallet \
-y

4. Удаление - Delete

Deleting

systemctl stop humansd && \
systemctl disable humansd && \
rm /etc/systemd/system/humansd.service && \
systemctl daemon-reload && \
cd $HOME && \
rm -rf .humans humans && \
rm -rf $(which humansd)