Skip to content

Allora

Installation

Terminal window
# install dependencies, if needed
sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y
Terminal window
# install go, if needed
cd $HOME
VER="1.22.3"
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
# set vars
echo "export WALLET="wallet"" >> $HOME/.bash_profile
echo "export MONIKER="test"" >> $HOME/.bash_profile
echo "export ALLORA_CHAIN_ID="allora-testnet-1"" >> $HOME/.bash_profile
echo "export ALLORA_PORT="27"" >> $HOME/.bash_profile
source $HOME/.bash_profile
# download binary
cd $HOME
rm -rf allora-chain
git clone https://github.com/allora-network/allora-chain
cd allora-chain
git checkout v0.3.0
make install
# config and init app
allorad config keyring-backend os
allorad config chain-id allora-testnet-1
allorad init $MONIKER --chain-id $ALLORA_CHAIN_ID
sed -i -e "s|^node *=.*|node = \"tcp://localhost:${ALLORA_PORT}657\"|" $HOME/.allorad/config/client.toml
# download genesis and addrbook
wget -O $HOME/.allorad/config/genesis.json https://server-3.itrocket.net/testnet/allora/genesis.json
wget -O $HOME/.allorad/config/addrbook.json https://server-3.itrocket.net/testnet/allora/addrbook.json
# set seeds and peers
SEEDS="720d83b52611c64d119adfc4d08d2e85885d8c74@allora-testnet-seed.itrocket.net:27656"
PEERS="a8cde2de31410d896668e53446495a4a68c4c24f@allora-testnet-peer.itrocket.net:27656,6f98707b7cf8e03ceff83ed5343a0aec74b57aed@37.27.53.176:26756,8ba42dc9488a33ca1d709bc4fe8b8662854a695b@65.108.134.47:26756,debfed1b60f8639959a317939f56bd2a5ddae358@185.132.177.83:26656,18fbf5f16f73e216f93304d94e8b79bf5acd7578@15.204.101.152:26656,0f6b64fcd38872d18a78d89e090a5e6928883d52@8.209.116.116:26656,7d548f78f0c67d391279c36fa9e127c52ce8b14c@65.108.225.207:55656,2eb9f5f80d721be2d37ab72c10a7be6aaf7897a4@15.204.101.92:26656,1ec4d1954ce3631274d57a9b60f5ffb5f9e4d841@66.70.177.125:27656,d3c79122924ff477e941ec0ca1ed775cfb01ca20@66.35.84.140:26656,79af04335a0ac10073ef9342edba78e8fb08f9fc@89.58.0.245:37778"
sed -i -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*seeds *=.*/seeds = \"$SEEDS\"/}" \
-e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*persistent_peers *=.*/persistent_peers = \"$PEERS\"/}" $HOME/.allorad/config/config.toml
# set custom ports in app.toml
sed -i.bak -e "s%:1317%:${ALLORA_PORT}317%g;
s%:8080%:${ALLORA_PORT}080%g;
s%:9090%:${ALLORA_PORT}090%g;
s%:9091%:${ALLORA_PORT}091%g;
s%:8545%:${ALLORA_PORT}545%g;
s%:8546%:${ALLORA_PORT}546%g;
s%:6065%:${ALLORA_PORT}065%g" $HOME/.allorad/config/app.toml
# set custom ports in config.toml file
sed -i.bak -e "s%:26658%:${ALLORA_PORT}658%g;
s%:26657%:${ALLORA_PORT}657%g;
s%:6060%:${ALLORA_PORT}060%g;
s%:26656%:${ALLORA_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${ALLORA_PORT}656\"%;
s%:26660%:${ALLORA_PORT}660%g" $HOME/.allorad/config/config.toml
# config pruning
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.allorad/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.allorad/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"50\"/" $HOME/.allorad/config/app.toml
# set minimum gas price, enable prometheus and disable indexing
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0uallo"|g' $HOME/.allorad/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.allorad/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.allorad/config/config.toml
# create service file
sudo tee /etc/systemd/system/allorad.service > /dev/null <<EOF
[Unit]
Description=Allora node
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/.allorad
ExecStart=$(which allorad) start --home $HOME/.allorad
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
# reset and download snapshot
allorad tendermint unsafe-reset-all --home $HOME/.allorad
curl https://server-3.itrocket.net/testnet/allora/allora_2024-09-02_966455_snap.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.allorad
# enable and start service
sudo systemctl daemon-reload
sudo systemctl enable allorad
sudo systemctl restart allorad && sudo journalctl -u allorad -f

Create Wallet

Terminal window
# to create a new wallet, use the following command. don’t forget to save the mnemonic
allorad keys add $WALLET
# to restore exexuting wallet, use the following command
allorad keys add $WALLET --recover
# save wallet and validator address
WALLET_ADDRESS=$(allorad keys show $WALLET -a)
VALOPER_ADDRESS=$(allorad keys show $WALLET --bech val -a)
echo "export WALLET_ADDRESS="$WALLET_ADDRESS >> $HOME/.bash_profile
echo "export VALOPER_ADDRESS="$VALOPER_ADDRESS >> $HOME/.bash_profile
source $HOME/.bash_profile
# check sync status, once your node is fully synced, the output from above will print "false"
allorad status 2>&1 | jq
# before creating a validator, you need to fund your wallet and check balance
allorad query bank balances $WALLET_ADDRESS

Create Validator

Terminal window
cd $HOME
# Create validator.json file
echo "{\"pubkey\":{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"$(allorad comet show-validator | grep -Po '\"key\":\s*\"\K[^"]*')\"},
\"amount\": \"1000000uallo\",
\"moniker\": \"test\",
\"identity\": \"\",
\"website\": \"\",
\"security\": \"\",
\"details\": \"\",
\"commission-rate\": \"0.1\",
\"commission-max-rate\": \"0.2\",
\"commission-max-change-rate\": \"0.01\",
\"min-self-delegation\": \"1\"
}" > validator.json
# Create a validator using the JSON configuration
allorad tx staking create-validator validator.json \
--from $WALLET \
--chain-id allora-testnet-1 \
--gas auto --gas-adjustment 1.5 \