How to run a Initia Node? Complete Guide and Set Up

Airdrop

Posted by Thanh Dat - 15/05/2024

CryptoViet Info

    MỤC LỤC

Requirements

To run the 0G Validator from source,you need to meet the following conditions:

  • - Memory: 16 GB RAM
  • - CPU: 4 cores
  • - Disk: 1 TB SSD 
  • - Bandwidth: 1 Gbps
  • - Linux : Linux amd64 arm64 (Ubuntu LTS release)

Guide to running Initia node

1. Install required packages

sudo apt update && \
sudo apt install curl git jq build-essential gcc unzip wget lz4 -y

2. Install GO

cd $HOME && \
ver="1.22.0" && \
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

3. Install Initia binary

git clone https://github.com/initia-labs/initia.git
cd initia
git checkout v0.2.14
make install
initiad version

4. Set up variables

# Customize if you need
echo 'export MONIKER="My_Node"' >> ~/.bash_profile
echo 'export CHAIN_ID="initiation-1"' >> ~/.bash_profile
echo 'export WALLET_NAME="wallet"' >> ~/.bash_profile
echo 'export RPC_PORT="26657"' >> ~/.bash_profile
source $HOME/.bash_profile

MONIKER="My_Node"' >>
Be sure to change "My_Node" to the name you want

5. Initialize the node

cd $HOME
initiad init $MONIKER --chain-id $CHAIN_ID
initiad config set client chain-id $CHAIN_ID
initiad config set client node tcp://localhost:$RPC_PORT
initiad config set client keyring-backend os

6. Download genesis.json

wget https://initia.s3.ap-southeast-1.amazonaws.com/initiation-1/genesis.json -O $HOME/.initia/config/genesis.json

7. Add seeds and peers to the config.toml

PEERS="e3ac92ce5b790c76ce07c5fa3b257d83a517f2f6@178.18.251.146:30656,2692225700832eb9b46c7b3fc6e4dea2ec044a78@34.126.156.141:26656,2a574706e4a1eba0e5e46733c232849778faf93b@84.247.137.184:53456,40d3f977d97d3c02bd5835070cc139f289e774da@168.119.10.134:26313,1f6633bc18eb06b6c0cab97d72c585a6d7a207bc@65.109.59.22:25756,4a988797d8d8473888640b76d7d238b86ce84a2c@23.158.24.168:26656,e3679e68616b2cd66908c460d0371ac3ed7795aa@176.34.17.102:26656,d2a8a00cd5c4431deb899bc39a057b8d8695be9e@138.201.37.195:53456,329227cf8632240914511faa9b43050a34aa863e@43.131.13.84:26656,517c8e70f2a20b8a3179a30fe6eb3ad80c407c07@37.60.231.212:26656,07632ab562028c3394ee8e78823069bfc8de7b4c@37.27.52.25:19656,028999a1696b45863ff84df12ebf2aebc5d40c2d@37.27.48.77:26656,3c44f7dbb473fee6d6e5471f22fa8d8095bd3969@185.219.142.137:53456,8db320e665dbe123af20c4a5c667a17dc146f4d0@51.75.144.149:26656,c424044f3249e73c050a7b45eb6561b52d0db456@158.220.124.183:53456,767fdcfdb0998209834b929c59a2b57d474cc496@207.148.114.112:26656,edcc2c7098c42ee348e50ac2242ff897f51405e9@65.109.34.205:36656,140c332230ac19f118e5882deaf00906a1dba467@185.219.142.119:53456,4eb031b59bd0210481390eefc656c916d47e7872@37.60.248.151:53456,ff9dbc6bb53227ef94dc75ab1ddcaeb2404e1b0b@178.170.47.171:26656,ffb9874da3e0ead65ad62ac2b569122f085c0774@149.28.134.228:26656" && \
SEEDS="2eaa272622d1ba6796100ab39f58c75d458b9dbc@34.142.181.82:26656,c28827cb96c14c905b127b92065a3fb4cd77d7f6@testnet-seeds.whispernode.com:25756" && \
sed -i \
    -e "s/^seeds *=.*/seeds = \"$SEEDS\"/" \
    -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" \
    "$HOME/.initia/config/config.toml"

8. Set min gas price

sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.15uinit,0.01uusdc\"/" $HOME/.initia/config/app.toml

9. Create a service file

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

[Service] User=$USER Type=simple ExecStart=$(which initiad) start --home $HOME/.initia Restart=on-failure LimitNOFILE=65535

[Install] WantedBy=multi-user.target EOF

10.  Start the node

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

11. Create a wallet for your validator

initiad keys add $WALLET_NAME

You can recover your wallet :

initiad keys add $WALLET_NAME --recover

DO NOT FORGET TO SAVE THE SEED PHRASE

12. Request tokens from the faucet on Discord

https://faucet.testnet.initia.xyz/
!note: verified room in discord

13. Check wallet balance

Make sure your node is fully synced unless it won't work

initiad status | jq .SyncInfo.catching_up

If synced is completed, turn catching_up: False, wait maybe a few hours

initiad q bank balances $(initiad keys show $WALLET_NAME -a) 

14. Create a validator

initiad tx mstaking create-validator \
--amount=1000000uinit \
--pubkey=$(initiad tendermint show-validator) \
--moniker=$MONIKER \
--chain-id=$CHAIN_ID \
--commission-rate=0.05 \
--commission-max-rate=0.10 \
--commission-max-change-rate=0.01 \
--from=$WALLET_NAME \
--identity="" \
--website="" \
--details="Initia to the moon!" \
--gas=2000000 --fees=300000uinit \
-y

Do not forget to save priv_validator_key.json file located in $HOME/.initia/config/


Useful commands

Check node status

initiad status | jq

Query your validator

initiad q mstaking validator $(initiad keys show $WALLET_NAME --bech val -a) 

Query missed blocks counter & jail details of your validator

initiad q slashing signing-info $(initiad tendermint show-validator)

Unjail your validator

initiad tx slashing unjail --from $WALLET_NAME --gas=2000000 --fees=300000uinit -y

Delegate tokens to your validator

initiad tx mstaking delegate $(initiad keys show $WALLET_NAME --bech val -a)  <AMOUNT>uinit --from $WALLET_NAME --gas=2000000 --fees=300000uinit -y

Delete the node from the server

# !!! IF YOU HAVE CREATED A VALIDATOR, MAKE SURE TO BACKUP priv_validator_key.json file located in $HOME/.initia/config/
sudo systemctl stop initiad
sudo systemctl disable initiad
sudo rm /etc/systemd/system/initiad.service
rm -rf $HOME/.initia
sudo rm /usr/local/bin/initiad

Conclusion

We have completed the Guide to running Initia Node. If you encounter any errors while running Lava Node, please join our Telegram group for assistance.

DISCLAIMER: Thông tin trên trang web này chỉ được cung cấp cho mục đích thông tin và không đại diện cho lời khuyên đầu tư. Để đưa ra quyết định đầu tư, chúng tôi khuyên bạn nên tự nghiên cứu.

Có thể bạn sẽ quan tâm

Recent PostPopular Post
Categories
Follow Us
CryptoViet Info
CryptoViet Info
CryptoViet Info
CryptoViet Info
CryptoViet Info
CryptoViet Info
CryptoViet Info
CryptoViet Info
CryptoViet Info
©2017 CryptoViet Info. All Rights ReservedMedia Kit