Testnet
Airchains
How To Install Full Node Airchain Testnet
Setting up vars
Your Nodename (validator) that will shows in explorer
NODENAME=<Your_Nodename_Moniker>
Save variables to system
echo "export NODENAME=$NODENAME" >> $HOME/.bash_profile
if [ ! $WALLET ]; then
echo "export WALLET=wallet" >> $HOME/.bash_profile
fi
echo "export AIRCHAINS_CHAIN_ID=junction" >> $HOME/.bash_profile
source $HOME/.bash_profile
Update packages
sudo apt update && sudo apt upgrade -y
Install dependencies
sudo apt install curl build-essential git wget jq make gcc tmux net-tools ccze -y
Install go
if ! [ -x "$(command -v go)" ]; then
ver="1.20.2"
cd $HOME
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" >> ~/.bash_profile
source ~/.bash_profile
fi
Download and build binaries
cd $HOME
wget -O junctiond https://github.com/airchains-network/junction/releases/download/v0.1.0/junctiond
chmod +x junctiond
mv junctiond $HOME/go/bin/
Init app
junctiond init $NODENAME --chain-id $AIRCHAINS_CHAIN_ID
Download configuration
cd $HOME
wget -O $HOME/.junction/config/genesis.json https://snap1.konsortech.xyz/airchains/genesis.json
wget -O $HOME/.junction/config/addrbook.json https://snap1.konsortech.xyz/airchains/addrbook.json
Disable indexing
indexer="null"
sed -i -e "s/^indexer *=.*/indexer = \"$indexer\"/" $HOME/.junction/config/config.toml
Config pruning
sed -i 's|pruning = "default"|pruning = "custom"|g' $HOME/.junction/config/app.toml
sed -i 's|pruning-keep-recent = "0"|pruning-keep-recent = "100"|g' $HOME/.junction/config/app.toml
sed -i 's|pruning-interval = "0"|pruning-interval = "19"|g' $HOME/.junction/config/app.toml
Set minimum gas price
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0.001amf"|g' $HOME/.junction/config/app.toml
Create service
sudo tee /etc/systemd/system/junctiond.service > /dev/null << EOF
[Unit]
Description=Airchains Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which junctiond) start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
Register and start service
sudo systemctl daemon-reload
sudo systemctl enable junctiond
sudo systemctl restart junctiond && sudo journalctl -u junctiond -f -o cat
Guide for Validator CLI
Create wallet
To create new wallet you can use command below. Don’t forget to save the mnemonic
junctiond keys add $WALLET
To recover your wallet using seed phrase
junctiond keys add $WALLET --recover
Show your wallet list
junctiond keys list
Save wallet info
Add wallet and validator address into variables
AIRCHAINS_WALLET_ADDRESS=$(junctiond keys show $WALLET -a)
AIRCHAINS_VALOPER_ADDRESS=$(junctiond keys show $WALLET --bech val -a)
echo 'export AIRCHAINS_WALLET_ADDRESS='${AIRCHAINS_WALLET_ADDRESS} >> $HOME/.bash_profile
echo 'export AIRCHAINS_VALOPER_ADDRESS='${AIRCHAINS_VALOPER_ADDRESS} >> $HOME/.bash_profile
source $HOME/.bash_profile
Fund your wallet
Faucet available on discord #switchyard-faucet-bot
$faucet airxxxxx
Create validator
To create your validator run command below
junctiond comet show-validator
The output will be similar to this (with a different key) “pubkey”:
{"@type":"/cosmos.crypto.ed25519.PubKey","key":"xxxxxxxx"}
Then, create a file named validator.json with the following content:
{
"pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"xxxxxxx"},
"amount": "1000000amf",
"moniker": "your-node-moniker",
"identity": "airchain testnet validator",
"website": "optional website for your validator",
"security": "optional security contact for your validator",
"details": "optional details for your validator",
"commission-rate": "0.1",
"commission-max-rate": "0.2",
"commission-max-change-rate": "0.01",
"min-self-delegation": "1"
}
Finally, we’re ready to submit the transaction to create the validator:
junctiond tx staking create-validator validator.json \
--from=$WALLET \
--chain-id=$AIRCHAINS_CHAIN_ID \
--fees=200amf
Check your validator key
[[ $(junctiond q staking validator $AIRCHAINS_VALOPER_ADDRESS -oj | jq -r .consensus_pubkey.key) = $(junctiond status | jq -r .validator_info.PubKey.value) ]] && echo -e "\n\e[1m\e[32mTrue\e[0m\n" || echo -e "\n\e[1m\e[31mFalse\e[0m\n"
Get list of validators
junctiond q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
Usefull commands
Service management
Check logs
journalctl -fu junctiond -o cat
Start service
sudo systemctl start junctiond
Stop service
sudo systemctl stop junctiond
Restart service
sudo systemctl restart junctiond
Node info
Synchronization info
junctiond status 2>&1 | jq .sync_info
Validator info
junctiond status 2>&1 | jq .validator_info
Node info
junctiond status 2>&1 | jq .node_info
Show node id
junctiond tendermint show-node-id
Wallet operations
List of wallets
junctiond keys list
Recover wallet
junctiond keys add $WALLET --recover
Delete wallet
junctiond keys delete $WALLET
Get wallet balance
junctiond query bank balances $AIRCHAINS_WALLET_ADDRESS
Transfer funds
junctiond tx bank send $AIRCHAINS_WALLET_ADDRESS <TO_AIRCHAINS_WALLET_ADDRESS> 1000000amf
Voting
junctiond tx gov vote 1 yes --from $WALLET --chain-id=$AIRCHAINS_CHAIN_ID
Staking, Delegation and Rewards
Delegate stake
junctiond tx staking delegate $AIRCHAINS_VALOPER_ADDRESS 1000000amf --from=$WALLET --chain-id=$AIRCHAINS_CHAIN_ID --gas=auto
Redelegate stake from validator to another validator
junctiond tx staking redelegate <srcValidatorAddress> <destValidatorAddress> 1000000amf --from=$WALLET --chain-id=$AIRCHAINS_CHAIN_ID --gas=auto
Withdraw all rewards
junctiond tx distribution withdraw-all-rewards --from=$WALLET --chain-id=$AIRCHAINS_CHAIN_ID --gas=auto
Withdraw rewards with commision
junctiond tx distribution withdraw-rewards $AIRCHAINS_VALOPER_ADDRESS --from=$WALLET --commission --chain-id=$AIRCHAINS_CHAIN_ID
Validator management
Edit validator
junctiond tx staking edit-validator \
--moniker=$NODENAME \
--identity=<your_keybase_id> \
--website="<your_website>" \
--details="<your_validator_description>" \
--chain-id=$AIRCHAINS_CHAIN_ID \
--from=$WALLET
Unjail validator
junctiond tx slashing unjail \
--broadcast-mode=block \
--from=$WALLET \
--chain-id=$AIRCHAINS_CHAIN_ID \
--gas=auto
Custom Explorers
https://testnet-explorer.konsortech.xyz/airchains
Public Endpoints
RPC
https://testnet-airchains-rpc.konsortech.xyz
API
https://testnet-airchains-api.konsortech.xyz
gRPC
testnet-airchains.konsortech.xyz:24090
Persistence Peers
fa66d9933c74918be38948f9027239663ad8bca6@testnet-airchains.konsortech.xyz:24656
Seeds
3c98ee0685ebf8fc5df17614f7445bd9cda81e1d@testnet-seed.konsortech.xyz:24165
Mirroring Genesis
https://snap1.konsortech.xyz/airchains/genesis.json
Address Book
https://snap1.konsortech.xyz/airchains/addrbook.json
State Sync
sudo systemctl stop junctiond
cp $HOME/.junction/data/priv_validator_state.json $HOME/.junction/priv_validator_state.json.backup
junctiond tendermint unsafe-reset-all --home $HOME/.junction --keep-addr-book
SNAP_RPC="https://testnet-airchains-rpc.konsortech.xyz:443"
LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)
echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH
peers="fa66d9933c74918be38948f9027239663ad8bca6@testnet-airchains.konsortech.xyz:24656"
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$peers'"|' $HOME/.junction/config/config.toml
sed -i -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.junction/config/config.toml
mv $HOME/.junction/priv_validator_state.json.backup $HOME/.junction/data/priv_validator_state.json
sudo systemctl restart junctiond
sudo journalctl -u junctiond -f --no-hostname -o cat
Snapshot
sudo systemctl stop junctiond
cp $HOME/.junction/data/priv_validator_state.json $HOME/.junction/priv_validator_state.json.backup
rm -rf $HOME/.junction/data
SNAP_NAME=$(curl -s https://snap1.konsortech.xyz/airchains/ | egrep -o ">airchains-snapshot.*\.tar.lz4" | tr -d ">")
curl https://snap1.konsortech.xyz/airchains/${SNAP_NAME} | lz4 -dc - | tar -xf - -C $HOME/.junction
mv $HOME/.junction/priv_validator_state.json.backup $HOME/.junction/data/priv_validator_state.json
sudo systemctl restart junctiond && journalctl -u junctiond -f --no-hostname -o cat