June 26, 2022

Sei Incentivized Testnet - NodeX

source : opensea.io/azuki

Guide to participate in Sei Incentivized Testnet

The testnet consists of 4 stages and will last approximately 8 weeks.

Allocate 1% of the total number of tokens for a reward

👉 Test registration: https://forms.gle/CzBeqENRZrrXXG4x7

👉 More about the test here: https://medium.com/@seinetwork/seinami-incentivized-testnet-a66be6aa6650

👉 Project website: https://www.seinetwork.io/

👉 Project Discord: https://discord.gg/xZTaK4JKv5


about the project

Sei Network is the first order book focused L1 blockchain. It is built using the Cosmos SDK and the Tendermint core and has a built-in central limit order book module. Sei-based dapps can be built on top of CLOB, and other Cosmos-based blockchains can use CLOB Sei as a shared liquidity hub and create markets for any asset.


equipment requirements

Developer hardware requirements

  • 4 processors; the higher the clock speed, the better
  • 32 GB RAM
  • 1 TB drive
  • Permanent Internet connection (traffic will be minimal during the testnet, 10 Mbps will be enough - at least 100 Mbps is expected for the mainnet)

Optimal hardware requirement

  • 4x processors; the higher the clock speed, the better
  • 8 GB RAM
  • 200GB storage (SSD or NVME)
  • Permanent Internet connection (traffic will be minimal during the testnet, 10 Mbps will be enough - at least 100 Mbps is expected for the mainnet)

Node installation

Option 1 ( Automatic installation )

For a fully automatic installation of the node, use our script, you will be prompted to enter the name of the validator node (moniker - which was indicated when registering in the form for participation in the testnet)

curl https://raw.githubusercontent.com/agonyp/Scripts-ALPHA-Noderunning/main/install-sui.sh | bash

After executing the script, proceed to create a wallet

Option 2 ( Manual installation )

Create a variable with the name of the node (replace the NAME of the NODE with the moniker that was specified during registration)

NODENAME = NODE_NAME

Saving and importing variables into the system

echo "export NODENAME=$NODENAME" >> $HOME/.bash_profile
echo "export WALLET=wallet" >> $HOME/.bash_profile
echo "export CHAIN_ID=sei-testnet-2" >> $HOME/.bash_profile
source $HOME/.bash_profile

Update on the server

sudo apt update && sudo apt upgrade -y

Install the packages we need to install the node

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.18.2"
cd $HOME
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" >> ~/.bash_profile
source ~/.bash_profile
go version

Download and compile the node

cd $HOME
git clone https://github.com/sei-protocol/sei-chain.git
cd sei-chain
git checkout 1.0.3beta
go build -o build/seid ./cmd/sei-chaind
chmod +x ./build/seid && sudo mv ./build/seid /usr/local/bin/seid

Configuring and initializing the node

seid config chain-id $CHAIN_ID
seid config keyring-backend file
seid init $NODENAME --chain-id $CHAIN_ID

Download the genesis file and addrbook

wget -qO $HOME/.sei/config/genesis.json "https://raw.githubusercontent.com/sei-protocol/testnet/master/sei-testnet-2/genesis.json"
wget -qO $HOME/.sei/config/addrbook.json "https://raw.githubusercontent.com/agonyp/Scripts-ALPHA-Noderunning/main/utilities/sei-addrbook.json"

Set the minimum gas price

sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0usei\"/" $HOME/.sei/config/app.toml

Set seeders and peers

SEEDS=""
PEERS="[email protected]:26656,[email protected]:26696,[email protected]:26696,[email protected]:26656,[email protected]:26656,[email protected]:45656,[email protected]:26656,[email protected]:46656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.sei/config/config.toml

We adjust pruning

pruning="custom"
pruning_keep_recent="100"
pruning_keep_every="0"
pruning_interval="10"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.sei/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.sei/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.sei/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.sei/config/app.toml

Resetting circuit data

seid unsafe-reset-all

We create a service

tee /etc/systemd/system/seid.service > /dev/null <<EOF
[Unit]
Description=seid
After=network.target
[Service]
Type=simple
User=$USER
ExecStart=$(which seid) start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

Register in the system and start the service

sudo systemctl daemon-reload
sudo systemctl enable seid
sudo systemctl restart seid

Wallet creation

Importing system variables

source ~/.bash_profile

Создание нового кошелька

seid keys add $WALLET

Восстановление кошелька по seed фразе (опционально)

seid keys add $WALLET --recover

Посмотреть список кошельков

seid keys list 

Добавляем адрес кошелька

WALLET_ADDRESS=$(seid keys show $WALLET -a)

Добавляем valoper адрес

VALOPER_ADDRESS=$(seid keys show $WALLET --bech val -a)

Импортируем переменные в систему

echo 'export WALLET_ADDRESS='${WALLET_ADDRESS} >> $HOME/.bash_profile
echo 'export VALOPER_ADDRESS='${VALOPER_ADDRESS} >> $HOME/.bash_profile
source $HOME/.bash_profile

Перед запросом монет из крана, убедитесь что нода синхронизирована

Команда для проверки синхронизации (False - синхронизирована)

curl -s localhost:26657/status | jq .result.sync_info

Запрашиваем монеты из крана (Монеты придут на баланс после синхронизации ноды)

curl -X POST -d '{"address": "'"$WALLET_ADDRESS"'", "coins": ["1000000usei"]}' http://3.22.112.181:8000

Если монеты не приходят после команды, или выбивает ошибку, переходим в Discord проекта, и запрашиваем токены в ветке faucet!
Проверяем баланс кошелька

seid query bank balances $WALLET_ADDRESS

Создаем валидатора

seid tx staking create-validator \
  --amount 1000000usei \
  --from $WALLET \
  --commission-max-change-rate "0.01" \
  --commission-max-rate "0.2" \
  --commission-rate "0.07" \
  --min-self-delegation "1" \
  --pubkey  $(seid tendermint show-validator) \
  --moniker $NODENAME \
  --chain-id $CHAIN_ID

Получение роли в Discord

After creating a validator, go to explorer , find yourself in the list of active / inactive validators and take a screenshot, which we drop into the general-chat branch and ask for the role of Sei Validators.


Staking, delegation and rewards

Delegate the rate (10000000usei delegation amount, change to the desired one)

seid tx staking delegate $VALOPER_ADDRESS 10000000usei --from=$WALLET --chain-id=$CHAIN_ID

Delegate a stake from a validator to another validator

seid tx staking redelegate <srcValidatorAddress> <destValidatorAddress> 10000000usei --from=$WALLET --chain-id=$CHAIN_ID --gas=auto

Withdraw all rewards

seid tx distribution withdraw-all-rewards --from=$WALLET --chain-id=$CHAIN_ID --gas=auto

Withdrawal of rewards with a commission

seid tx distribution withdraw-rewards $VALOPER_ADDRESS --from=$WALLET --commission --chain-id=$CHAIN_ID

Checking a node in the list of validators

It is possible to check yourself in the list using the link to explorer

https://sei.explorers.guru/validators

Get a list of validators

seid q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl

Troubleshooting

If your node is not synchronized, there are few peers, there is no connection, use static peers. In the command line, what is in brackets must be changed to actual peers from the off Discord project.

PEERS="[email protected]:26656,[email protected]:26641,[email protected]:26656,[email protected]:46656,[email protected]:26656,[email protected]:26656,[email protected]:26656"
sed -i.bak -e "s/^persistent_peers =./persistent_peers = "$PEERS"/" $HOME/.sei/config/config.toml

Update

You need to update after synchronizing version 1.0.3 to a height of 681000, so that the node automatically stops at this height, you can run:

HALT_HEIGHT=681000 sed -i.bak -e "s/^halt-height =./halt-height = $HALT_HEIGHT/" ~/.sei/config/app.toml
sudo sed -i.bak -e "s/^Restart =./Restart=no/" /etc/systemd/system/seid.service

To update, use one of the scripts to choose from

curl https://raw.githubusercontent.com/agonyp/Scripts-ALPHA-Noderunning/main/sei-update.sh | bash

Or this one:

git clone https://github.com/sei-protocol/sei-chain.git
cd sei-chain/
git fetch --tags -f
git checkout 1.0.4beta

make install

sudo systemctl restart seid

Useful Commands

Check logs

sei_logs
journalctl -fu seid -o cat

Synchronization check command

curl -s localhost:26657/status | jq .result.sync_info

Request tokens from a faucet

curl -X POST -d '{"address": "'"$WALLET_ADDRESS"'", "coins": ["1000000usei"]}' http://3.22.112.181:8000

Wallet balance check

seid query bank balances $WALLET_ADDRESS

Get currently connected list of peers with IDs

curl -sS http://localhost:26657/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'

Stop service

systemctl stop seid

start service

systemctl start seid

Restart the service

systemctl restart seid

Delete node

sudo systemctl stop seid
rm -rf ~/.sei
rm -rf ~/sei-chain
sudo systemctl disable seid
rm /usr/local/bin/seid

Credit by @nekiy_iz ❤️ @alphateam