February 19, 2022

UMEE NODE

Basic knowledges for setup and maintenance UMEE v3.0.2 validator node.


Install node

Do system update and upgrade:

sudo apt update && sudo apt upgrade -y

Install dependences and useful utils:

sudo apt install make clang pkg-config libssl-dev build-essential git jq ncdu bsdmainutils htop nload net-tools lsof -y

Install GO programming language:

cd $HOME
wget -c -O go1.19.1.linux-amd64.tar.gz https://golang.org/dl/go1.19.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.19.1.linux-amd64.tar.gz && sudo rm go1.19.1.linux-amd64.tar.gz
echo 'export GOROOT=/usr/local/go' >> $HOME/.bash_profile
echo 'export GOPATH=$HOME/go' >> $HOME/.bash_profile
echo 'export GO111MODULE=on' >> $HOME/.bash_profile
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile && . $HOME/.bash_profile
sudo cp $(which go) /usr/local/bin
go version
# Output: go version go1.19 linux/amd64

Install UMEE binaries:

cd $HOME
git clone https://github.com/umee-network/umee.git
cd umee
git pull
git checkout tags/v3.0.2
make build
sudo cp $HOME/umee/build/umeed /usr/local/bin
umeed version
# Output: v3.0.2

Set variables:

MONIKER=MONIKER #Enter node moniker
WALLET=WALLET #Enter UMEE validator wallet name
PEGGO_WALLET=WALLET #Enter PEGGO orchestrator wallet name
echo "export MONIKER="${MONIKER}"" >> $HOME/.bash_profile
echo "export WALLET="${WALLET}"" >> $HOME/.bash_profile
echo "export PEGGO_WALLET="${PEGGO_WALLET}"" >> $HOME/.bash_profile
source $HOME/.bash_profile

Configure node:

umeed init $MONIKER --chain-id=umee-1
wget -O $HOME/.umee/config/genesis.json https://github.com/umee-network/mainnet/raw/main/genesis.json
jq -S -c -M '' $HOME/.umee/config/genesis.json | shasum -a 256
# Output: d4264b31472a922ec05620793dd8832a3a78032b23cdaa065f38ff3803f13800  -
umeed tendermint unsafe-reset-all
external_address=`curl ifconfig.me`
sed -i 's|external_address *=.*|external_address = "'$external_address:26656'"|g' $HOME/.umee/config/config.toml
sed -i 's|indexer *=.*|indexer = "null"|g' $HOME/.umee/config/config.toml
sed -i 's|minimum-gas-prices *=.*|minimum-gas-prices = "0uumee"|g' $HOME/.umee/config/app.toml
sed -i 's|pruning *=.*|pruning = "custom"|g' $HOME/.umee/config/app.toml
sed -i 's|pruning-keep-recent *=.*|pruning-keep-recent = "100"|g' $HOME/.umee/config/app.toml
sed -i 's|pruning-interval *=.*|pruning-interval = "10"|g' $HOME/.umee/config/app.toml

Create or recover UMEE validator wallet:

umeed keys add $WALLET #Create new wallet
umeed keys add $WALLET --recover #Recover wallet from seed phrase

Create umeed service file:

sudo tee /etc/systemd/system/umeed.service > /dev/null <<EOF
[Unit]
Description=Umee Node
After=network.target

[Service]
User=$USER
Type=simple
ExecStart=$(which umeed) start
Restart=on-failure
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

Synhronize UMEE from snapshot or stakesync: https://github.com/umee-network/umee/tree/main/networks/umee-1

sudo systemctl daemon-reload
sudo systemctl enable umeed
sudo systemctl restart umeed && journalctl -u umeed -f -o cat

Create validator:

umeed tx staking create-validator \
--amount=1000000uumee \
--pubkey=$(umeed tendermint show-validator) \
--moniker=$MONIKER \
--chain-id=umee-1 \
--commission-rate=0.05 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--gas=auto \
--fees="300uumee" \
--from=$WALLET

Install PEGGO:

cd $HOME
git clone https://github.com/umee-network/peggo.git
cd peggo
git pull
git checkout tags/v1.2.1
make build
sudo cp $HOME/peggo/build/peggo /usr/local/bin
peggo version
# Output: version: v1.2.1

Create or recover PEGGO orchestrator wallet:

umeed keys add $PEGGO_WALLET #Create new wallet
umeed keys add $PEGGO_WALLET --recover #Recover wallet from seed phrase

Register PEGGO:

umeed tx gravity set-orchestrator-address VALIDATOR_ADDRESS PEGGO_ADDRESS ETH_PEGGO_ADDRESS --chain-id=umee-1 --from=$WALLET --gas=auto --fees=300uumee 

Create peggod service file:

sudo tee /etc/systemd/system/peggod.service > /dev/null <<EOF
[Unit]
Description=Peggo service
After=network.target

[Service]
User=$USER
Type=simple
ExecStart=$(which peggo) orchestrator 0xb564ac229e9d6040a9f1298b7211b9e79ee05a2c \
--bridge-start-height="14211966" \
--eth-rpc="ETH_RPC_ENDPOINT" \
--relay-batches=false \
--valset-relay-mode=none \
--eth-merge-pause=true \
--cosmos-chain-id="umee-1" \
--cosmos-keyring-dir="$HOME/.umee" \
--cosmos-from="$PEGGO_WALLET" \
--cosmos-from-passphrase="WALLET_PASSWORD" \
--cosmos-keyring="os" \
--cosmos-keyring-dir="$HOME/.umee" \
--eth-alchemy-ws="ETH_ALCHEMY_RPC_ENDPOINT" \
--log-level=debug \
--log-format=text
Environment="PEGGO_ETH_PK=ETH_PEGGO_WALLET_PRIVATE_KEY" 
Restart=on-failure
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

Run PEGGO:

sudo systemctl daemon-reload
sudo systemctl enable peggod
sudo systemctl restart peggod && journalctl -u peggod -f -o cat

Install Price Feeder:

Follow this manual: https://umeeversity.umee.cc/validators/mainnet-validator.html#price-feeder

Upgrade node

Upgrade UMEE binaries:

sudo systemctl stop umeed
cd $HOME/umee
git pull
git checkout tags/vX.X.X #Enter binaries version 
make build
sudo cp $HOME/umee/build/umeed /usr/local/bin
umeed version
# Check UMEE vesion
sudo systemctl restart umeed && journalctl -u umeed -f -o cat

Upgrade PEGGO:

sudo systemctl stop peggod
cd $HOME/peggo
git pull
git checkout tags/vX.X.X #Enter binaries version 
make build
sudo cp $HOME/peggo/build/peggo /usr/local/bin
peggo version
# Check PEGGO version
sudo systemctl restart peggod && journalctl -u peggod -f -o cat

Wallets

List of available wallets:

umeed keys list

Show wallet addresses:

umeed keys show $WALLET -a

Show valoper addresses:

umeed keys show $WALLET -a --bech=val

Checking wallet balance:

umeed q bank balances $(umeed keys show $WALLET -a)

Transaction

Sending transaction:

umeed tx bank send FROM_WALLET_ADDRESS TO_WALLET_ADDRESS AMOUNTuumee --chain-id=umee-1 --gas=auto --fees=300uumee

Validator

Edit validator:

umeed tx staking edit-validator --from=$WALLET --chain-id=umee-1 --gas=auto --fees=300uumee --moniker=$MONIKER

Delegate to validator:

umeed tx staking delegate VALOPPER_ADDRESS AMOUNTuumee --from=$WALLET --chain-id=umee-1 --gas=auto --fees=300uumee

Self delegate:

umeed tx staking delegate $(umeed keys show $WALLET -a --bech val) AMOUNTuumee --from=$WALLET --chain-id=umee-1 --gas=auto --fees=300uumee

Redelegate:

umeed tx staking redelegate FROM_VALOPPER_ADDRESS TO_VALOPPER_ADDRESS AMOUNTuumee --from=$WALLET --chain-id=umee-1 --gas=auto --fees=300uumee

Undelegate (unbond):

umeed tx staking unbond VALOPPER_ADDRESS AMOUNTuumee --from=$WALLET --chain-id=umee-1 --gas=auto --fees=300uumee

Withdraw rewards & commission:

umeed tx distribution withdraw-rewards $(umeed keys show $WALLET -a --bech val) --from=$WALLET --chain-id=umee-1 --gas=auto --fees=300uumee --commission -y

Unjail validator:

umeed tx slashing unjail --from=$WALLET --chain-id=umee-1 --gas=auto --fees=3000uumee

Governance

Show available proposals:

umeed q gov proposals

Proposal voting:

umeed tx gov vote 22 yes --from=$WALLET --chain-id=umee-1 --fees=300uumee

Show votes for proposal:

umeed q gov votes 22

Submit proposal:

umeed tx gov submit-proposal \
--title=TITLE_OF_PROPOSAL \
--description=DESCRIPTION_OF_PROPOSAL \
--type=Text \
--deposit=1000000uumee \
--from=$WALLET \
--chain-id=umee-1 \
--fees=300uumee

Deposit proposal:

umeed tx gov deposit PROPOSAL_NUMBER AMOUNTuumee --from=$WALLET --chain-id=umee-1 --gas=auto --fees=300uumee

Monitoring

Logs:

# Current logs:
journalctl -u umeed -f -o cat
# Since some moment (UTC):
journalctl -u umeed -f -o cat --since "Y-M-D H:M:S"

Some examples of using Tendermint PRC:

# Check node overall status:
curl -s localhost:26657/status
# Check node syncing status:
curl -s localhost:26657/status | jq .result.sync_info.catching_up
# Check node peers:
curl -s localhost:26657/net_info | jq -r .result.n_peers
# Show timestamp of any block height:
curl -s localhost:26657/block?height=(NETWORK_HEIGHT) | grep timestamp | head -1
# Consensus state:
curl -s localhost:26657/consensus_state | jq -r ".result.round_state.height_vote_set[0].prevotes_bit_array"

Check validator status:

umeed q staking validator $(umeed keys show $WALLET -a --bech val)

Show list of available validators:

umeed q staking validators --limit 1000 -o json | jq -r '.validators[] | [.operator_address, .status, (.tokens|tonumber / pow(10; 6)), .description.moniker] | @csv' | column -t -s"," | sort -k3 -n -r | nl

Show node id:

umeed tendermint show-node-id