🔌 Installation

1️⃣ Installation packages and dependencies

sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y

➡️ Go Installation

cd $HOME
VER="1.23.4"
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

➡️ Cargo Installation

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env

2️⃣ Install node

Reminder

You can change the port and wallet name.
echo "export AIR_WALLET="mictowallet"" >> $HOME/.bash_profile
echo "export AIR_PORT="60"" >> $HOME/.bash_profile
source $HOME/.bash_profile
cd $HOME
wget https://github.com/airchains-network/junction/releases/download/v0.3.2/junctiond-linux-amd64
chmod +x junctiond-linux-amd64 
mkdir -p $HOME/.junctiond/cosmovisor/upgrades/jip-2/bin
mv $HOME/junctiond-linux-amd64 $HOME/.junctiond/cosmovisor/upgrades/jip-2/bin/junctiond
sudo ln -sfn $HOME/.junctiond/cosmovisor/upgrades/jip-2 $HOME/.junctiond/cosmovisor/current
sudo ln -sfn $HOME/.junctiond/cosmovisor/current/bin/junctiond /usr/local/bin/junctiond
go install cosmossdk.io/tools/cosmovisor/cmd/[email protected]

➡️ Create a service

sudo tee /etc/systemd/system/junctiond.service > /dev/null << EOF
[Unit]
Description=junction node service
After=network-online.target

[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.junctiond"
Environment="DAEMON_NAME=junctiond"
Environment="UNSAFE_SKIP_BACKUP=true"
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$HOME/.junctiond/cosmovisor/current/bin"

[Install]
WantedBy=multi-user.target
EOF

➡️ Let’s activate it

sudo systemctl daemon-reload
sudo systemctl enable junctiond

➡️ Initialize the node & other

junctiond init "Moniker-Name" --chain-id varanasi-1
sed -i -e '/^chain-id = /c\chain-id = "varanasi-1"' $HOME/.junctiond/config/client.toml
sed -i -e "s|^node *=.*|node = \"tcp://localhost:${AIR_PORT}657\"|" $HOME/.junctiond/config/client.toml
sed -i -e '/^keyring-backend = /c\keyring-backend = "test"' $HOME/.junctiond/config/client.toml

➡️ Genesis addrbook

curl https://files.mictonode.com/airchains/genesis/genesis.json -o $HOME/.junctiond/config/genesis.json
curl https://files.mictonode.com/airchains/addrbook/addrbook.json -o $HOME/.junctiond/config/addrbook.json

➡️ Port

sed -i.bak -e "s%:26658%:${AIR_PORT}658%g;
s%:26657%:${AIR_PORT}657%g;
s%:6060%:${AIR_PORT}060%g;
s%:26656%:${AIR_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${AIR_PORT}656\"%;
s%:26660%:${AIR_PORT}660%g" $HOME/.junctiond/config/config.toml
sed -i.bak -e "s%:1317%:${AIR_PORT}317%g;
s%:8080%:${AIR_PORT}080%g;
s%:9090%:${AIR_PORT}090%g;
s%:9091%:${AIR_PORT}091%g;
s%:8545%:${AIR_PORT}545%g;
s%:8546%:${AIR_PORT}546%g;
s%:6065%:${AIR_PORT}065%g" $HOME/.junctiond/config/app.toml

➡️ Peers and Seeds

peers="[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26756,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:28656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:56256,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656"
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.junctiond/config/config.toml
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.junctiond/config/config.toml
seeds=""
sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.junctiond/config/config.toml

➡️ Pruning

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

➡️ Indexer & Other

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

➡️ Gas Settings

sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0uamf"|g' $HOME/.junctiond/config/app.toml

➡️ Prometheus

sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.junctiond/config/config.toml

➡️ Starter Snap (Thx Itrocket)

junctiond tendermint unsafe-reset-all --home $HOME/.junctiond --keep-addr-book

SNAPSHOT_URL="https://server-3.itrocket.net/testnet/airchains/"
LATEST_SNAPSHOT=$(curl -s $SNAPSHOT_URL | grep -oP 'airchains_\d{4}-\d{2}-\d{2}_\d+_snap\.tar\.lz4' | sort | tail -n 1)

if [ -n "$LATEST_SNAPSHOT" ]; then
  FULL_URL="${SNAPSHOT_URL}${LATEST_SNAPSHOT}"
  if curl -s --head "$FULL_URL" | head -n 1 | grep "200" > /dev/null; then
    curl "$FULL_URL" | lz4 -dc - | tar -xf - -C $HOME/.junctiond
  else
    echo "Snapshot URL not accessible"
  fi
else
  echo "No snapshot found"
fi

➡️ Let’s get started

sudo systemctl restart junctiond
sudo journalctl -fu junctiond -o cat

➡️ Log Command

sudo journalctl -fu junctiond -o cat

➡️ Create wallet

junctiond keys add $AIR_WALLET

➡️ Import wallet

junctiond keys add $AIR_WALLET --recover

➡️ Create Validator

rm -rf /root/validator.json
cat > ./validator.json << EOF
{
	"pubkey": $(junctiond tendermint show-validator),
	"amount": "1000000uamf",
	"moniker": "Moniker-Name",
	"identity": "optional identity signature (ex. UPort or Keybase)",
	"website": "validator's (optional) website",
	"security": "validator's (optional) security contact email",
	"details": "validator's (optional) details",
	"commission-rate": "0.1",
	"commission-max-rate": "0.15",
	"commission-max-change-rate": "0.05",
	"min-self-delegation": "1"
}
EOF
junctiond tx staking create-validator $HOME//validator.json --chain-id varanasi-1 --fees 5000uamf --from=$AIR_WALLET -y

➡️ Delegate to Yourself

junctiond tx staking delegate $(junctiond keys show $AIR_WALLET --bech val -a) 1000000uamf --from $AIR_WALLET --chain-id varanasi-1 --fees 5000uamf -y 

➡️ Edit Validator

junctiond tx staking edit-validator \
--chain-id varanasi-1 \
--commission-rate 0.05 \
--new-moniker "validator-name" \
--identity "" \
--details "" \
--website "" \
--security-contact "" \
--from $AIR_WALLET \
--node http://localhost:${AIR_PORT}657 \
--fees 5000uamf \
-y

➡️ Complete deletion

cd $HOME
sudo systemctl stop junctiond
sudo systemctl disable junctiond
sudo rm -rf /etc/systemd/system/junctiond.service
sudo systemctl daemon-reload
sudo rm -f /usr/local/bin/junctiond
sudo rm -f $(which junctiond)
sudo rm -rf $HOME/.junctiond
sed -i "/AIR_PORT_/d" $HOME/.bash_profile

➡️ Block check

local_height=$(junctiond status | jq -r .sync_info.latest_block_height); network_height=$(curl -s https://airchains-testnet-rpc.mictonode.com/status | jq -r .result.sync_info.latest_block_height); blocks_left=$((network_height - local_height)); echo "Your node height: $local_height"; echo "MictoNode height: $network_height"; echo "Blocks left: $blocks_left"
  • Your node height - the current block of your node
  • Network height - the last block of the network
  • Blocks left - how many blocks your node has left to sync.