MONIKER="YOUR_MONIKER_GOES_HERE"
sudo apt update
sudo apt-get install git curl build-essential make jq gcc snapd chrony lz4 tmux unzip bc -y
rm -rf $HOME/go
sudo rm -rf /usr/local/go
cd $HOME
curl https://dl.google.com/go/go1.22.2.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf -
cat <<'EOF' >>$HOME/.profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF
source $HOME/.profile
go version
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/
junctiond init $MONIKER --chain-id $AIRCHAIN_CHAIN_ID
Download genesis and addrbook
curl -Ls https://snapshots.aknodes.net/snapshots/airchains/genesis.json > $HOME/.junction/config/genesis.json
curl -Ls https://snapshots.aknodes.net/snapshots/airchains/addrbook.json > $HOME/.junction/config/addrbook.json
tee /etc/systemd/system/junctiond.service > /dev/null <<EOF
[Unit]
Description=junctiond
After=network-online.target
[Service]
User=$USER
ExecStart=$(which junctiond) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
junctiond tendermint unsafe-reset-all --home $HOME/.junction --keep-addr-book
curl https://snapshots.aknodes.net/snapshots/airchains/snapshot-airchains.AKNodes.lz4 | lz4 -dc - | tar -xf - -C $HOME/.junction
sudo systemctl restart junctiond
journalctl -u junctiond -f