Network
Cosmos
Initia
Installation

Initia

ℹ️

Recommended Hardware: 4 Cores, 16GB RAM, 1TB of storage (NVME)

Install Dependencies

# install dependencies, if needed
sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y
# install go, if needed
cd $HOME
VER="1.21.3"
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 vars
echo "export WALLET="wallet"" >> $HOME/.bash_profile
echo "export MONIKER="test"" >> $HOME/.bash_profile
echo "export INITIA_CHAIN_ID="initiation-1"" >> $HOME/.bash_profile
echo "export INITIA_PORT="18"" >> $HOME/.bash_profile
echo "export INITIA_PATH=".initia"" >> $HOME/.bash_profile
echo "export INITIA_TAG="v0.2.15"" >> $HOME/.bash_profile
source $HOME/.bash_profile
 
# download binary
git clone https://github.com/initia-labs/initia.git
cd initia
git checkout $INITIA_TAG
make build
sudo cp $HOME/initia/build/initiad /usr/local/bin/
 
# config and init app
initiad init $MONIKER --chain-id=$INITIA_CHAIN_ID
sed -i -e "s|^node *=.*|node = \"tcp://localhost:${INITIA_PORT}657\"|" $HOME/$INITIA_PATH/config/client.toml
 
# download genesis and addrbook
wget -O $HOME/$INITIA_PATH/config/genesis.json https://snapshot.dashnode.org/initia-testnet/genesis.json
wget -O $HOME/$INITIA_PATH/config/addrbook.json https://snapshot.dashnode.org/initia-testnet/addrbook.json
 
# set seeds and peers
SEEDS="5f934bd7a9d60919ee67968d72405573b7b14ed0@t-seed-initia.dashnode.org:29656"
PEERS="5f934bd7a9d60919ee67968d72405573b7b14ed0@t-seed-initia.dashnode.org:29656,e3b22ed3046af612cb88140017cb1ac1ea881254@initia-testnet-peer.cryptonode.id:28656,2404b2606d2b6d745b3923dd4dd5993b8f567363@initia-testnet-seed.cryptonode.id:28656,5e3d8e15692bad4dd30ad85ef0116ecf3483de88@initia-testnet-peer.nodem0rt.xyz:19656,a63a6f6eae66b5dce57f5c568cdb0a79923a4e18@peer-initia-testnet.trusted-point.com:26628,aee7083ab11910ba3f1b8126d1b3728f13f54943@initia-testnet-peer.itrocket.net:11656,cd69bcb00a6ecc1ba2b4a3465de4d4dd3e0a3db1@initia-testnet-seed.itrocket.net:51656,[email protected]:24510,bbf8ef70a32c3248a30ab10b2bff399e73c6e03c@initia-testnet.rpc.nodex.one:24556"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/$INITIA_PATH/config/config.toml
 
# set custom ports in app.toml
sed -i.bak -e "s|:1317|:${INITIA_PORT}317|g;
s|:8080|:${INITIA_PORT}080|g;
s|:9090|:${INITIA_PORT}090|g;
s|:9091|:${INITIA_PORT}091|g;
s|:8545|:${INITIA_PORT}545|g;
s|:8546|:${INITIA_PORT}546|g;
s|:6065|:${INITIA_PORT}065|g" $HOME/$INITIA_PATH/config/app.toml
 
# set custom ports in config.toml file
sed -i.bak -e "s|:26658|:${INITIA_PORT}658|g;
s|:26657|:${INITIA_PORT}657|g;
s|:6060|:${INITIA_PORT}060|g;
s|:26656|:${INITIA_PORT}656|g;
s|^external_address = \"\"|external_address = \"$(wget -qO- eth0.me):${INITIA_PORT}656\"|;
s|:26660|:${INITIA_PORT}660|g" $HOME/$INITIA_PATH/config/config.toml
 
# config pruning
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/$INITIA_PATH/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/$INITIA_PATH/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"50\"/" $HOME/$INITIA_PATH/config/app.toml
 
# set minimum gas price, enable prometheus and disable indexing
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0.15uinit,0.01uusdc"|g' $HOME/$INITIA_PATH/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/$INITIA_PATH/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/$INITIA_PATH/config/config.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_PATH
ExecStart=$(which initiad) start
Restart=on-abort
RestartSec=5
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=initiad
LimitNOFILE=65535
 
[Install]
WantedBy=multi-user.target
EOF
 
# reset and download snapshot
initiad tendermint unsafe-reset-all --home $HOME/$INITIA_PATH
 
# enable and start service
sudo systemctl daemon-reload
sudo systemctl enable initiad
sudo systemctl restart initiad && sudo journalctl -u initiad -f