Install Dependencies

# Update system package and install build tools

sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential fail2ban ufw
sudo apt -qy upgrade

Configure Moniker

# Replace <your-moniker-name> with your own validator name

MONIKER="<your-moniker-name>"

Install Go

sudo rm -rf /usr/local/go
curl -Ls <https://go.dev/dl/go1.21.1.linux-amd64.tar.gz> | sudo tar -xzf - -C /usr/local
eval $(echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/golang.sh)
eval $(echo 'export PATH=$PATH:$HOME/go/bin' | tee -a $HOME/.profile)

Build Binaries

# Cloning project repository & Compile binaries

cd $HOME
git clone <https://github.com/allora-network/allora-chain> allora
cd alloragit
checkout v0.0.10
make build

# Prepare binaries for cosmovisor

mkdir -p $HOME/.allorad/cosmovisor/genesis/bin
mv build/allorad $HOME/.allorad/cosmovisor/genesis/bin/
rm -rf build

# Create symlinks

sudo ln -s $HOME/.allorad/cosmovisor/genesis $HOME/.allorad/cosmovisor/current -f
sudo ln -s $HOME/.allorad/cosmovisor/current/bin/allorad /usr/local/bin/allorad -f

Cosmovisor Setup

# Install cosmovisor

go install cosmossdk.io/tools/cosmovisor/cmd/[email protected]

Create Service

# Create a systemd service

sudo tee /etc/systemd/system/allora.service > /dev/null << EOF
[Unit]
Description=allora 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/.allorad"
Environment="DAEMON_NAME=allorad"
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/.allorad/cosmovisor/current/bin"

[Install]
WantedBy=multi-user.target
EOF

Enable Service

# Enable allora systemd service

sudo systemctl daemon-reload
sudo systemctl enable allora

Initialize Node

# Setting node configuration

allorad config set client chain-id testnet
allorad config set client keyring-backend test
allorad config set client node tcp://localhost:24657

# Initialize node

allorad init $MONIKER --chain-id testnet