Initia
Stake with Our Validator
Moniker:
Account Address:
init13v87veezdsuzp7g3w0wxw0xt3u97ayscnfndst
Operator_address:
initvaloper13v87veezdsuzp7g3w0wxw0xt3u97aysc8v257m
Project Information
Initia is a pioneering network for interwoven rollups, revolutionizing blockchain by simplifying complexity and providing a unified platform akin to using your favorite smartphone, inspired by Apple's design philosophy.
Server Requirements
- Memory: 16 GB RAM - CPU: 4 cores - Disk: 1 TB SSD - Bandwidth: 1 Gbps - Linux amd64 arm64 (Ubuntu LTS release)
Installation guide
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.15 make install initiad version
4. Set up variables
replace "My_Node" with the name you would wish to call your node
# Customize if you need echo 'export MONIKER="NodeInt"' >> ~/.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
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 # You can set it to "test" so you will not be asked for a password
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 Peers to the config.toml
# Endpoint URL URL="https://initia-rpc.stake2earn.com/net_info" # Fetch data from the endpoint response=$(curl -s $URL) # Parse JSON and construct PEERS string using jq PEERS=$(echo $response | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):" + (.node_info.listen_addr | capture("(?<ip>.+):(?<port>[0-9]+)quot;).port)' | paste -sd "," -) # Display the PEERS string echo "PEERS=\"$PEERS\"" # Set the peers sed -i 's|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.initia/config/config.toml
Configuration set up
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.initia/config/config.toml sed -i -e "s/^log_level *=.*/log_level = \"main:info,state:info,statesync:info,*:error\"/" $HOME/.initia/config/config.toml sed -i -e "s/^max_num_inbound_peers *=.*/max_num_inbound_peers = 300/" $HOME/.initia/config/config.toml sed -i -e "s/^max_num_outbound_peers *=.*/max_num_outbound_peers = 300/" $HOME/.initia/config/config.toml
8. Change ports (Optional)
# Customize if you need EXTERNAL_IP=$(wget -qO- eth0.me) \ PROXY_APP_PORT=26658 \ P2P_PORT=26656 \ PPROF_PORT=6060 \ API_PORT=1317 \ GRPC_PORT=9090 \ GRPC_WEB_PORT=9091
sed -i \ -e "s/\(proxy_app = \"tcp:\/\/\)\([^:]*\):\([0-9]*\).*/\1\2:$PROXY_APP_PORT\"/" \ -e "s/\(laddr = \"tcp:\/\/\)\([^:]*\):\([0-9]*\).*/\1\2:$RPC_PORT\"/" \ -e "s/\(pprof_laddr = \"\)\([^:]*\):\([0-9]*\).*/\1localhost:$PPROF_PORT\"/" \ -e "/\[p2p\]/,/^\[/{s/\(laddr = \"tcp:\/\/\)\([^:]*\):\([0-9]*\).*/\1\2:$P2P_PORT\"/}" \ -e "/\[p2p\]/,/^\[/{s/\(external_address = \"\)\([^:]*\):\([0-9]*\).*/\1${EXTERNAL_IP}:$P2P_PORT\"/; t; s/\(external_address = \"\).*/\1${EXTERNAL_IP}:$P2P_PORT\"/}" \ $HOME/.initia/config/config.toml
sed -i \ -e "/\[api\]/,/^\[/{s/\(address = \"tcp:\/\/\)\([^:]*\):\([0-9]*\)\(\".*\)/\1\2:$API_PORT\4/}" \ -e "/\[grpc\]/,/^\[/{s/\(address = \"\)\([^:]*\):\([0-9]*\)\(\".*\)/\1\2:$GRPC_PORT\4/}" \ -e "/\[grpc-web\]/,/^\[/{s/\(address = \"\)\([^:]*\):\([0-9]*\)\(\".*\)/\1\2:$GRPC_WEB_PORT\4/}" \ $HOME/.initia/config/app.toml
9. Configure prunning to save storage (Optional)
sed -i \ -e "s/^pruning *=.*/pruning = \"custom\"/" \ -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" \ -e "s/^pruning-interval *=.*/pruning-interval = \"10\"/" \ "$HOME/.initia/config/app.toml"
10. Set min gas price
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.15uinit,0.01uusdc\"/" $HOME/.initia/config/app.toml
11. Enable indexer (Optional)
sed -i "s/^indexer *=.*/indexer = \"kv\"/" $HOME/.initia/config/config.toml
12. 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
13. Start the node
Run tmux to open a virtual space
Then start the daemon to run the node
sudo systemctl daemon-reload && \ sudo systemctl enable initiad && \ sudo systemctl restart initiad && \ sudo journalctl -u initiad -f -o cat
14. Get your public RPC end point on your validator node
Fetch your IP and RPC port (It will print your RPC url)
RPC="http://$(wget -qO- eth0.me)$(grep -A 3 "\[rpc\]" $HOME/.initia/config/config.toml | egrep -o ":[0-9]+")" && echo $RPC
curl $RPC/status
If you are getting Connection refused
, you need to make it accessible to the Internet:
sed -i '/\[rpc\]/,/\[/{s/^laddr = "tcp:\/\/127\.0\.0\.1:/laddr = "tcp:\/\/0.0.0.0:/}' $HOME/.initia/config/config.toml
sudo systemctl restart initiad
sudo journalctl -u initiad -f -o cat --no-hostname
Check if RPC is responding once again
curl $RPC/status
To Output your PUBLIC RPC URL again
echo $RPC
You can also paste this URL into your browser and ensure it works :) ---
If you are still getting Connection refused
and you have ufw firewall you need to open it
Fetch RPC port. Make sure output is not empty
PORT=$(grep -A 3 "\[rpc\]" $HOME/.initia/config/config.toml | egrep -o ":[0-9]+") && \ PORT=${PORT#:} && \ echo $PORT
sudo ufw allow $PORT
sudo ufw reload
15. Ensuring Faster syncing
press ctrl + c to stop the process then do the following
Download latest snapshot and update your peers
wget -O initia_latest.tar.lz4 https://storage.crouton.digital/testnet/initia/snapshots/initia_latest.tar.lz4 sudo systemctl stop initiad cp $HOME/.initia/data/priv_validator_state.json $HOME/.initia/priv_validator_state.json.backup initiad tendermint unsafe-reset-all --home $HOME/.initia --keep-addr-book lz4 -c -d initia_202803.tar.lz4 | tar -x -C $HOME/.initia mv $HOME/.initia/priv_validator_state.json.backup $HOME/.initia/data/priv_validator_state.json sudo systemctl restart initiad && sudo journalctl -u initiad -f -o cat
PEERS=$(curl -s --max-time 3 --retry 2 --retry-connrefused "https://rpc-initia-testnet.trusted-point.com/peers.txt") if [ -z "$PEERS" ]; then echo "No peers were retrieved from the URL." else echo -e "\nPEERS: "$PEERS"" sed -i "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" "$HOME/.initia/config/config.toml" echo -e "\nConfiguration file updated successfully.\n" fi
sudo systemctl stop initiad
Backup priv_validator_state.json
cp $HOME/.initia/data/priv_validator_state.json $HOME/.initia/priv_validator_state.json.backup
initiad tendermint unsafe-reset-all --home $HOME/.initia --keep-addr-book
Extract files fromt the arvhive
lz4 -d -c ./latest_snapshot.tar.lz4 | tar -xf - -C $HOME/.initia
Move priv_validator_state.json back
mv $HOME/.initia/priv_validator_state.json.backup $HOME/.initia/data/priv_validator_state.json
Restart the node
sudo systemctl restart initiad && sudo journalctl -u initiad -f -o cat
Check the synchronization status
initiad status | jq -r .sync_info
16. Run the Oracle
Clone the slinky repository, change into the directory and get the latest version
git clone https://github.com/skip-mev/slinky.git && cd slinky && git checkout v0.4.4
make build
mv build/slinky /usr/local/bin/
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
sudo tee /etc/systemd/system/oracle.service > /dev/null <<EOF cd [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
sudo systemctl daemon-reload sudo systemctl enable oracle.service sudo systemctl restart oracle.service sudo journalctl -u oracle.service -o cat -f
Wallet
initiad keys add $WALLET_NAME
Ensure to save your wallet informations like address, passphrase, public key.
Next, you will need some init token to set up a validator.
Go to the FAUCET site, copy and paste your wallet address and click submit.
To restore your keys you have created, do this
initiad keys add $WALLET_NAME --recover
Save wallet and validator address
WALLET_ADDRESS=$(initiad keys show $WALLET_NAME -a) VALOPER_ADDRESS=$(initiad keys show $WALLET_NAME --bech val -a) echo "export WALLET_ADDRESS="$WALLET_ADDRESS >> $HOME/.bash_profile echo "export VALOPER_ADDRESS="$VALOPER_ADDRESS >> $HOME/.bash_profile source $HOME/.bash_profile
Check sync status, once your node is fully synced, the output from above will print "false"
initiad status 2>&1 | jq
After creating a validator, make sure the fund has been funded sucessfully
initiad query bank balances $WALLET_ADDRESS
Create a validator
Run the command below on a new window.
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
Get the content of the validator private key, ensure to save it in a safe place
cd $HOME/.initia/config/ cat priv_validator_key.json
Check your validator here but it takes some time be appear there
If you can't find your validator. you can check your validator directly on the api
initiad q mstaking validator $(initiad keys show $WALLET_NAME --bech val -a)cd
Upgrading to the latest version
Only do this when a new version is announced and requires validators to upgrade
cd $HOME rm -rf initia git clone https://github.com/initia-labs/initia.git cd initia git checkout #version make install
initiad version
sudo systemctl restart initiad
Useful commands
Check node status
initiad status | jq
Delegate 1 INIT to yourself (change <wallet_name>
):
initiad tx mstaking delegate $(initiad keys show <wallet_name> --bech val -a) 1000000uinit --from <wallet_name> --chain-id initiation-1 --gas-adjustment 1.4 --gas=2000000 --fees=563000move/944f8dd8dc49f96c25fea9849f16436dcfa6d564eec802f3ef7f8b3ea85368ff -y
Delegate 1 INIT to another validator (change <valoper>
):
initiad tx mstaking delegate <valoper> 1000000uinit --from <wallet_name> --chain-id initiation-1 --gas-adjustment 1.4 --gas=2000000 --fees=563000move/944f8dd8dc49f96c25fea9849f16436dcfa6d564eec802f3ef7f8b3ea85368ff -y
Check block Height
llocal_height=$(initiad status | jq -r .sync_info.latest_block_height); network_height=$(curl -s https://initia-testnet-rpc.polkachu.com/status | jq -r .result.sync_info.latest_block_height); blocks_left=$((network_height - local_height)); echo "Your node height: $local_height"; echo "Network height: $network_height"; echo "Blocks left: $blocks_left"
Edit validator information
initiad tx mstaking edit-validator --moniker="<NEW_MONIKER>" --from=wallet_name --gas=2000000 --fees=300000uinit -y
initiad tx mstaking edit-validator --website="<NEW_WEBSITE>" --from=$WALLET_NAME --gas=2000000 --fees=300000uinit --node https://initia-testnet-rpc.kzvn.xyz/ --chain-id initiation-1 -y
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
Get your p2p peer address
initiad status | jq -r '"\(.NodeInfo.id)@\(.NodeInfo.listen_addr)"'
Edit your validator
initiad tx mstaking edit-validator --website="<WEBSITE>" --details="<DESCRIPTION>" --moniker="<NEW_MONIKER>" --from=$WALLET_NAME --gas=2000000 --fees=300000uinit -y
Send tokens between wallets
initiad tx bank send $WALLET_NAME <TO_WALLET> <AMOUNT>uinit --gas=2000000 --fees=300000uinit -y
Query your wallet balance
initiad q bank balances $WALLET_NAME
Monitor server load
sudo apt update sudo apt install htop -y htop
Query active validators
initiad q mstaking validators -o json --limit=1000 \ | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' \ | jq -r '.voting_power + " - " + .description.moniker' \ | sort -gr | nl
Query inactive validators
initiad q mstaking validators -o json --limit=1000 \ | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' \ | jq -r '.voting_power + " - " + .description.moniker' \ | sort -gr | nl
Check logs of the node
sudo journalctl -u initiad -f -o cat
Restart the node
sudo systemctl restart initiad
Stop the node
sudo systemctl stop initiad
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
Example gRPC usage
wget https://github.com/fullstorydev/grpcurl/releases/download/v1.7.0/grpcurl_1.7.0_linux_x86_64.tar.gz tar -xvf grpcurl_1.7.0_linux_x86_64.tar.gz chmod +x grpcurl ./grpcurl -plaintext localhost:$GRPC_PORT list ### MAKE SURE gRPC is enabled in app.toml # grep -A 3 "\[grpc\]" $HOME/.initia/config/app.toml
Example REST API query
curl localhost:$API_PORT/cosmos/mstaking/v1beta1/validators ### MAKE SURE API is enabled in app.toml # grep -A 3 "\[api\]" $HOME/.initia/config/app.toml