Node Installation

Initia node installation

Install dependencies

sudo apt update && sudo apt upgrade -y
sudo apt -qy install curl git jq lz4 build-essential

Install Go if nedeed

cd $HOME
VER="1.21.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"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin

Set variables

You can change the variables here as you want.

echo "export INITIA_WALLET_NAME="MyWallet"" >> $HOME/.bash_profile
echo "export INITIA_MONIKER="MyNodes"" >> $HOME/.bash_profile
echo "export INITIA_PORT="213"" >> $HOME/.bash_profile

source $HOME/.bash_profile

Download binary

cd $HOME
rm -rf initia
git clone https://github.com/initia-labs/initia.git
cd initia
git checkout v0.2.21
make install

Configure Initia App

initiad init $INITIA_MONIKER --chain-id initiation-1
initiad config set client chain-id initiation-1
initiad config set client node tcp://localhost:${INITIA_PORT}657
sed -i -e "s|^node *=.*|node = \"tcp://localhost:${INITIA_PORT}657\"|" $HOME/.initia/config/client.toml

Download genesis and addrbook

curl -Ls https://krews.xyz/snapshots/data/initia/genesis.json > $HOME/.initia/config/genesis.json
curl -Ls https://krews.xyz/snapshots/data/initia/addrbook.json > $HOME/.initia/config/addrbook.json

Set seeds and peers

SEEDS="25ed2cb891b05bd5a28725cd19df601360b7cfdb@initia-seed.krews.xyz:51656"
PEERS="8f1a831c74c94c08ba745398baad1306687b2bc1@209.38.42.27:26656,807eaf0e07231766b7df788f4aa3422fa813dad8@43.131.26.90:26656,d1aeb143f1e4b8b2390a37fe87864d396b61c342@109.123.253.29:26656,3b944bcae9db0b88d8419adde8e26188a6a5ef5d@65.109.59.22:25756,ae0aff058a44136d54bbd7a6a70ac140b72bd23d@157.230.36.36:26656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.initia/config/config.toml

Set custom ports

for app.toml
sed -i.bak -e "s%:1317%:${INITIA_PORT}17%g;
s%:8080%:${INITIA_PORT}80%g;
s%:9090%:${INITIA_PORT}90%g;
s%:9091%:${INITIA_PORT}91%g;
s%:8545%:${INITIA_PORT}45%g;
s%:8546%:${INITIA_PORT}46%g;
s%:6065%:${INITIA_PORT}65%g" $HOME/.initia/config/app.toml
for config.toml
sed -i.bak -e "s%:26658%:${INITIA_PORT}58%g;
s%:26657%:${INITIA_PORT}57%g;
s%:6060%:${INITIA_PORT}60%g;
s%:26656%:${INITIA_PORT}56%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${INITIA_PORT}56\"%;
s%:26660%:${INITIA_PORT}60%g" $HOME/.initia/config/config.toml

Set minimum gas price

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

Configure pruning

sed -i \
  -e 's|^pruning *=.*|pruning = "custom"|' \
  -e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
  -e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
  -e 's|^pruning-interval *=.*|pruning-interval = "50"|' \
  $HOME/.initia/config/app.toml

Create service file

sudo tee /etc/systemd/system/initiad.service > /dev/null <<EOF
[Unit]
Description=Initia Node
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/.initia
ExecStart= $(which initiad) start --home $HOME/.initia
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

Reset node and download snapshot

initiad tendermint unsafe-reset-all --home $HOME/.initia--keep-addr-book
if curl -s --head curl https://krews.xyz/snapshots/initia/latest.tar.lz4 | head -n 1 | grep "200" > /dev/null; then
  curl https://krews.xyz/snapshots/initia/latest.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.initia
    else
  echo snapshot not found
fi

Allow P2P port

sudo ufw allow ${INITIA_PORT}56/tcp

Enable and start node service

sudo systemctl daemon-reload
sudo systemctl enable initiad
sudo systemctl restart initiad && sudo journalctl -fu initiad

Create wallet

initiad keys add ${INITIA_WALLET_NAME}
# import your created wallet to keplr
# then faucet your wallet on this adres
https://faucet.testnet.initia.xyz/

Create validator

# You can set identity, website, details as you wish.
initiad tx mstaking create-validator \
--amount 1000000uinit \
--pubkey $(initiad tendermint show-validator) \
--moniker ${INITIA_MONIKER} \
--identity "your identity" \
--details "your details" \
--website "your website" \
--chain-id initiation-1 \
--commission-rate 0.05 \
--commission-max-rate 0.20 \
--commission-max-change-rate 0.05 \
--from ${INITIA_WALLET_NAME} \
--gas-adjustment 1.4 \
--gas 1000000 \
--gas-prices 0.15uinit \
--node tcp://localhost:${INITIA_PORT}657

Delete node

sudo systemctl stop initiad
sudo systemctl disable initiad
sudo rm -rf /etc/systemd/system/initiad.service
sudo rm $(which initiad)
sudo rm -rf $HOME/.initia
sed -i "/INITIA_/d" $HOME/.bash_profile

Last updated