Installation

  1. Install packages

sudo apt update 
sudo apt install curl tar wget clang pkg-config protobuf-compiler libssl-dev jq build-essential protobuf-compiler bsdmainutils git make ncdu gcc git jq chrony liblz4-tool -y
  1. Install GO via CLI

  • Remove GO if you have

sudo rm -rf /usr/local/go
sudo rm /etc/paths.d/go
sudo apt-get remove golang-go
sudo apt-get remove --auto-remove golang-go
cd $HOME
rm -rf /go
  • Install GO

ver="1.21.10"
sudo rm -rf /usr/local/go
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" 
rm -rf /usr/local/go
tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
rm -rf "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
  1. Install Airchains via CLI

cd $HOME
wget https://github.com/airchains-network/junction/releases/download/v0.1.0/junctiond
chmod +x junctiond
mkdir -p $HOME/.junction/cosmovisor/genesis/bin
mv junctiond $HOME/go/bin/
cp $HOME/go/bin/junctiond $HOME/.junction/cosmovisor/genesis/bin/
sudo ln -s $HOME/.junction/cosmovisor/genesis $HOME/.junction/cosmovisor/current -f
sudo ln -s $HOME/.junction/cosmovisor/current/bin/junctiond /usr/local/bin/junctiond -f
  1. Install cosmovisor

cd $HOME
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0
  1. Initialize Node

  • Input NODE_NAME with your node name you want

NODE_NAME="Input your nope name"
junctiond config set client chain-id junction
junctiond config set client keyring-backend file
# initialize
junctiond init $NODE_NAME --chain-id junction
  1. Configure Genesis & Seeds

  • Copy the Genesis File

sudo apt install -y unzip wget
rm $HOME/.junction/config/genesis.json
curl -Ls https://snap.aznope.com/downloads/airchains/genesis.json > $HOME/.junction/config/genesis.json
curl -Ls https://snap.aznope.com/downloads/airchains/addrbook.json > $HOME/.junction/config/addrbook.json
  • Add Seed && Peers Node

PEERS=$(curl -s https://snap.aznope.com/downloads/airchains/peers.txt)
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.junction/config/config.toml
SEEDS="df949a46ae6529ae1e09b034b49716468d5cc7e9@testnet-seeds.stakerhouse.com:13756" && \
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.junction/config/config.toml
  • Configure setting

# Setting Pruning 
sed -i -e 's|^pruning *=.*|pruning = "custom"|' $HOME/.junction/config/app.toml
sed -i -e 's|^pruning-keep-recent  *=.*|pruning-keep-recent = "100"|' $HOME/.junction/config/app.toml
sed -i -e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' $HOME/.junction/config/app.toml
sed -i -e 's|^pruning-interval *=.*|pruning-interval = "10"|' $HOME/.junction/config/app.toml
# Enabling Prometheus
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.junction/config/config.toml

# Set up the minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.001amf\"|" $HOME/.junction/config/app.toml
  1. Custom port (Optional)

  • You can ignore it

echo 'export poort="101"' >> ~/.bash_profile
source $HOME/.bash_profile
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://0.0.0.0:${poort}58\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://0.0.0.0:${poort}57\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${poort}60\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${poort}56\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${poort}60\"%" $HOME/.junction/config/config.toml
sed -i -e "s%^address = \"tcp://localhost:1317\"%address = \"tcp://0.0.0.0:${poort}17\"%; s%^address = \":8080\"%address = \":${poort}80\"%; s%^address = \"localhost:9090\"%address = \"0.0.0.0:${poort}90\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${poort}91\"%; s%:8545%:${poort}45%; s%:8546%:${poort}46%; s%:6065%:${poort}65%" $HOME/.junction/config/app.toml
junctiond config set client node tcp://localhost:${poort}57
  1. Create Service File

sudo tee /etc/systemd/system/junction.service > /dev/null << EOF
[Unit]
Description=Airchains node service
After=network-online.target
 
[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.junction"
Environment="DAEMON_NAME=junctiond"
 
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable junction
  • Start node service

sudo systemctl daemon-reload
sudo systemctl restart junction
  • Check logs node

# ctrl-c to turn off follow log
sudo journalctl -u junction -f --no-hostname -o cat
  1. Create Wallet

  • Create new wallet

echo "export AIR_WALLET=wallet" >> $HOME/.bash_profile
source $HOME/.bash_profile
junctiond keys add $AIR_WALLET
  • Restore wallet

junctiond keys add $AIR_WALLET --recover
  1. Create Validator

  • Check pubkey

junctiond comet show-validator
#copy your pubkey here
#"pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"xxxxx="}
cd $HOME/.junction/config
nano validator.json
  • Import your pubkey to 'validator.json' file

{
  "pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":" import your pubkey here="},
  "amount": "1000000amf",
  "moniker": "YOUR_MONIKER_NAME",
  "identity": "YOUR_KEYBASE_ID",
  "details": "YOUR_DETAILS",
  "website": "YOUR_WEBSITE_URL",
  "security": "YOUR_EMAIL_ADDRESS",
  "commission-rate": "0.10",
  "commission-max-rate": "0.20",
  "commission-max-change-rate": "0.01",
  "min-self-delegation": "1"
}
  • Start create validator

junctiond tx staking create-validator $HOME/.junction/config/validator.json \
  --from $AIR_WALLET \
  --chain-id junction \
  --fees 500amf \
  -y

Delete node

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 $(which junctiond)
sudo rm -rf $HOME/.junction

Last updated