May 27, 2022

How to set up the SEI node

Hello everyone. Let’s install the Sei node and join testate together.

More details about the project can be found on the official website.

Requirements for the node according to the documentation: 4 Cores (modern CPU's), 32GB RAM, 1TB of storage (SSD or NVME), but for the start standard configuration for cosmos is enough (4/8/200). Later on you will understand if you wish to stay connected and switch to required configurations.

As always, you need to update your server first

sudo apt update && sudo apt upgrade -y

Install additional packages

sudo apt install make clang pkg-config libssl-dev build-essential git gcc chrony curl jq ncdu bsdmainutils htop net-tools lsof fail2ban wget -y

Go lang installation. Please check the version at the end.

cd $HOME wget -O go1.18.1.linux-amd64.tar.gz https://golang.org/dl/go1.18.1.linux-amd64.tar.gz rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.18.1.linux-amd64.tar.gz && rm go1.18.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 go version

Download and install the binary

cd $HOME git clone https://github.com/sei-protocol/sei-chain.git cd sei chain git checkout 1.0.0beta go build -o build/seid ./cmd/sei-chaind

Move the binary to the correct folder

chmod +x ./build/seid && sudo mv ./build/seid /usr/local/bin/seid cd $HOME

Set variables. Change MONICKER to your preferred name and set the WALLET NAME as well. Do not change the CHAIN name.

MONIKER="your_name" CHAIN="sei-testnet-1" WALLET_NAME="your_name"

Save all variables to the .bash_profile

echo 'export MONIKER='${MONIKER} >> $HOME/.bash_profile echo 'export CHAIN='${CHAIN} >> $HOME/.bash_profile echo 'export WALLET_NAME='${WALLET_NAME} >> $HOME/.bash_profile source $HOME/.bash_profile

Initialize the node

seid init $MONIKER --chain-id $CHAIN

Download genesis file and address book

wget -qO $HOME/.sei-chain/config/genesis.json "https://raw.githubusercontent.com/sei-protocol/testnet/master/sei-testnet-1/genesis.json" wget -qO $HOME/.sei-chain/config/addrbook.json "https://raw.githubusercontent.com/sei-protocol/testnet/master/sei-testnet-1/addrbook.json"

Save the network name and keyring backend file to config.

seid config chain-id $CHAIN seid config keyring-backend file

Setting up pruning

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

Add peers

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,[email protected]:62136,[email protected]:26657,[email protected]:26656,[email protected]:26642,4aaa57eb2ed8f839253193a893389338c081929b @80.82.215.233:26656,[email protected]:26656"

sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.sei-chain/config/config.toml

Turn on prometheus

sed -i -e "s/prometheus=false/prometheus=true/" $HOME/.sei-chain/config/config.toml

Create a service file

tee /etc/systemd/system/seid.service > /dev/null <<EOF [unit] Description=SEI 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

Start the service

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

Check logs

journalctl -u seid -f -o cat

Also, you can check synchronization status . If catching_up": false, your node is synchronized.

seid status 2>&1 | jq .SyncInfo

If the node cannot connect to the peers, ask community in the Discord server to share available working peers.

After the synchronization, create your wallet. Do not change the name, we set it up earlier. Enter preferred password twice. Dont forget to save your mnemonic and wallet address.

seid keys add $WALLET_NAME

Create a variable for the wallet address (enter your password)

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

And add a variable to the .bash_profile

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

You need to have tokens in your wallet to create a validator. At the moment there is a faucet channel in the discord. You need to fill up the form and wait for funds. Or you can use faucet HERE

Check your balance:

seid query bank balances $WALLET_ADDRESS

If you already have tokens in your wallet, next step is creating validator. You can change amount for delegation.

seid tx staking create-validator \ --amount 100000000usei \ --from $WALLET_NAME \ --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 $MONIKER \ --chain-id $CHAIN

After creating validator, create a variable with its address (enter the password set earlier)

VALOPER=$(seid keys show $WALLET_ADDRESS --bech val -a)

Add this variable to the .bash_profile

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

Check the status

seid query staking validator $VALOPER

Delegate more to your validator. Check balance and change the amount if needed.

seid tx staking delegate $VALOPER 1000000usei --from $WALLET_NAME --chain-id $CHAIN

If you are JAILED, dont worry. This is the way back:

seid tx slashing unjail --from $WALLET_NAME --chain-id $CHAIN

Post in the discord proofs that you set up a validator and request the special role. Wait for announcements and participate inn community discussions.

Thank you! Have a great day ahead! Sincerely, MMS_Team