Initia – Testnet – Node Deployment Guide

Chain: initiation-1

The guide is updated on 2024/05/17.

System requirements: 4 CPU, 16GB RAM, 1TB SSD

Update server:

sudo apt update && sudo apt upgrade -y

Install additional packages:

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

Install GO and check version:

ver="1.22.2" && \
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

Clone repository, build and move binary:

cd $HOME
git clone https://github.com/initia-labs/initia
cd initia
git checkout v0.2.14
make install
mv ~/go/bin/initiad  /usr/local/bin/

Set variables (choose your node and wallet name):

INITIA_CHAIN="initiation-1"
INITIA_MONIKER="your_name"
INITIA_WALLET="your_name"

Add variables to bash profile:

echo 'export INITIA_CHAIN='${INITIA_CHAIN} >> $HOME/.bash_profile
echo 'export INITIA_MONIKER='${INITIA_MONIKER} >> $HOME/.bash_profile
echo 'export INITIA_WALLET='${INITIA_WALLET} >> $HOME/.bash_profile
source $HOME/.bash_profile

Initialize the node:

initiad init $INITIA_MONIKER --chain-id $INITIA_CHAIN

Download genesis:

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

Set up pruning (optionally):

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

Turn off indexer (optionally):

indexer="null"
sed -i -e "s/^indexer *=.*/indexer = \"$indexer\"/" $HOME/.initia/config/config.toml

Add seeds and peers:

peers="[email protected]:26656,[email protected]:26656,[email protected]:13656,[email protected]:26656,[email protected]:15656,[email protected]:26686"
sed -i -e "s|^persistent_peers *=.*|persistent_peers = \"$peers\"|" $HOME/.initia/config/config.toml
seeds="ade4d8bc8cbe014af6ebdf3cb7b1e9ad36f412c0@testnet-seeds.polkachu.com:25756"
sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $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

Create service:

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

[Service]
User=$USER
ExecStart=$(which initiad) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

Start service:

systemctl daemon-reload && \
systemctl enable initiad && \
systemctl restart initiad

Check logs (node should start syncing):

journalctl -fu initiad -o cat

Check status (wait catching_up: false):

curl localhost:26657/status

Create new wallet (save mnemonic in a safe place):

initiad keys add $INITIA_WALLET

Recover old wallet (if exists):

initiad keys add $INITIA_WALLET --recover

Add address to bash profile:

INITIA_ADDR=$(initiad keys show $INITIA_WALLET -a)
echo 'export INITIA_ADDR='${INITIA_ADDR} >> $HOME/.bash_profile
source $HOME/.bash_profile

Ask tokens from faucet and check balance:

initiad query bank balances $INITIA_ADDR

Create validator:

initiad tx mstaking create-validator \
 --amount 29000000uinit \
 --from $INITIA_WALLET \
 --commission-max-change-rate "0.05" \
 --commission-max-rate "0.2" \
 --commission-rate "0.1" \
 --pubkey $(initiad tendermint show-validator) \
 --moniker $INITIA_MONIKER \
 --identity "your_identity" \
 --security-contact="your_contact" \
 --chain-id initiation-1 \
 --gas=2000000 \
 --fees=300000uinit

Add validator address to bash profile:

INITIA_VALOPER=$(initiad keys show $INITIA_WALLET --bech val -a)
echo 'export INITIA_VALOPER='${INITIA_VALOPER} >> $HOME/.bash_profile
source $HOME/.bash_profile

Clone oracle repository, build and move binary:

git clone https://github.com/skip-mev/slinky.git
cd slinky
git checkout v0.4.3
make build && \
mv build/slinky /usr/local/bin/

Change oracle configuration in app.toml:

sed -i '/^\[oracle\]/,/^$/ s/^enabled = ".*"/enabled = "true"/' $HOME/.initia/config/app.toml
sed -i 's|^oracle_address = ".*"|oracle_address = "0.0.0.0:8080"|g' $HOME/.initia/config/app.toml
sed -i 's/^client_timeout = ".*"/client_timeout = "500ms"/' $HOME/.initia/config/app.toml
sed -i 's/^metrics_enabled = ".*"/metrics_enabled = "true"/' $HOME/.initia/config/app.toml

Create oracle service

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

[Service]
User=$USER
Type=simple
ExecStart=$(which slinky) --oracle-config-path root/slinky/config/core/oracle.json
Restart=on-failure
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

Start oracle service and check logs:

sudo systemctl daemon-reload && \
sudo systemctl enable oracle.service && \
sudo systemctl restart oracle.service && \
sudo journalctl -u oracle.service -f -o cat

Share post: