KEMBAR78
Allora Worker Node Guide | PDF | Computing | Software
0% found this document useful (0 votes)
63 views7 pages

Allora Worker Node Guide

Uploaded by

tamil0502
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views7 pages

Allora Worker Node Guide

Uploaded by

tamil0502
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Allora Worker Node Guide

1st Command:- Install Packages

sudo apt update & sudo apt upgrade -y

sudo apt install ca-certificates zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev curl git wget
make jq build-essential pkg-config lsb-release libssl-dev libreadline-dev libffi-dev gcc screen
unzip lz4 -y

2nd Command:- Install Python3

sudo apt install python3


python3 --version ( Check Version )

sudo apt install python3-pip


pip3 --version ( Check Version )

3rd Command:- Install Docker

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o


/usr/share/keyrings/docker-archive-keyring.gpg ( Press y )

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-


keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee
/etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io

docker version

4th Command:- Install Docker-Compose

VER=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep tag_name |


cut -d '"' -f 4)

sudo curl -L "https://github.com/docker/compose/releases/download/$VER/docker-compose-$


(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

docker-compose --version ( Check Version )


5th Command:- Docker Permission to user

sudo groupadd docker

sudo usermod -aG docker $USER

6th Command:- Install Go

sudo rm -rf /usr/local/go

curl -L https://go.dev/dl/go1.22.4.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local

echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile


echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> $HOME/.bash_profile

source .bash_profile

go version ( Check Version )

7th Command:- Install Allora Wallet

git clone https://github.com/allora-network/allora-chain.git

cd allora-chain && make all

allorad version ( Check Version )

8th Command:- Create a New Wallet

allorad keys add testkey

9th Step:- Import Wallet & Take Faucet

1. Import your key on keplr then copy your allora address


2. Add chain - https://tinyurl.com/v73c75jw
3. Faucet - https://faucet.edgenet.allora.network/

10th Step:- Install Worker

1. Install

cd $HOME && git clone https://github.com/allora-network/basic-coin-prediction-node


cd basic-coin-prediction-node

mkdir worker-data

mkdir head-data

2. Give Permission

sudo chmod -R 777 worker-data

sudo chmod -R 777 head-data

3. Create head Key

sudo docker run -it --entrypoint=bash -v ./head-data:/data alloranetwork/allora-inference-


base:latest -c "mkdir -p /data/keys && (cd /data/keys && allora-keys)"

4. Create Worker Key

sudo docker run -it --entrypoint=bash -v ./worker-data:/data alloranetwork/allora-inference-


base:latest -c "mkdir -p /data/keys && (cd /data/keys && allora-keys)"

11th Command:- Copy Your Head Id

cat head-data/keys/identity ( Head Id Starts like 12D )

12th Steps:- Connect to allora chain

1. Delete and create new docker-compose.yml file

rm -rf docker-compose.yml && nano docker-compose.yml

2. Copy & Paste The Following Code ( Replace Head-Id & WALLET_SEED_PHRASE )

version: '3'

services:
inference:
container_name: inference-basic-eth-pred
build:
context: .
command: python -u /app/app.py
ports:
- "8000:8000"
networks:
eth-model-local:
aliases:
- inference
ipv4_address: 172.22.0.4
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/inference/ETH"]
interval: 10s
timeout: 5s
retries: 12
volumes:
- ./inference-data:/app/data

updater:
container_name: updater-basic-eth-pred
build: .
environment:
- INFERENCE_API_ADDRESS=http://inference:8000
command: >
sh -c "
while true; do
python -u /app/update_app.py;
sleep 24h;
done
"
depends_on:
inference:
condition: service_healthy
networks:
eth-model-local:
aliases:
- updater
ipv4_address: 172.22.0.5

worker:
container_name: worker-basic-eth-pred
environment:
- INFERENCE_API_ADDRESS=http://inference:8000
- HOME=/data
build:
context: .
dockerfile: Dockerfile_b7s
entrypoint:
- "/bin/bash"
- "-c"
-|
if [ ! -f /data/keys/priv.bin ]; then
echo "Generating new private keys..."
mkdir -p /data/keys
cd /data/keys
allora-keys
fi
# Change boot-nodes below to the key advertised by your head
allora-node --role=worker --peer-db=/data/peerdb --function-db=/data/function-db \
--runtime-path=/app/runtime --runtime-cli=bls-runtime --workspace=/data/workspace \
--private-key=/data/keys/priv.bin --log-level=debug --port=9011 \
--boot-nodes=/ip4/172.22.0.100/tcp/9010/p2p/'head-id' \
--topic=1 \
--allora-chain-key-name=testkey \
--allora-chain-restore-mnemonic='WALLET_SEED_PHRASE' \
--allora-node-rpc-address=https://allora-rpc.edgenet.allora.network/ \
--allora-chain-topic-id=1
volumes:
- ./worker-data:/data
working_dir: /data
depends_on:
- inference
- head
networks:
eth-model-local:
aliases:
- worker
ipv4_address: 172.22.0.10

head:
container_name: head-basic-eth-pred
image: alloranetwork/allora-inference-base-head:latest
environment:
- HOME=/data
entrypoint:
- "/bin/bash"
- "-c"
-|
if [ ! -f /data/keys/priv.bin ]; then
echo "Generating new private keys..."
mkdir -p /data/keys
cd /data/keys
allora-keys
fi
allora-node --role=head --peer-db=/data/peerdb --function-db=/data/function-db \
--runtime-path=/app/runtime --runtime-cli=bls-runtime --workspace=/data/workspace \
--private-key=/data/keys/priv.bin --log-level=debug --port=9010 --rest-api=:6000
ports:
- "6000:6000"
volumes:
- ./head-data:/data
working_dir: /data
networks:
eth-model-local:
aliases:
- head
ipv4_address: 172.22.0.100
networks:
eth-model-local:
driver: bridge
ipam:
config:
- subnet: 172.22.0.0/24

volumes:
inference-data:
worker-data:
head-data:

To Save This:- CTRL+X Then Enter Y Then Click Enter

13th Command:- Run Worker

sudo docker compose build

sudo docker compose up -d

14th Command:- Check Your Node Status & Copy Worker Id

docker ps

15th Command:- Replace CONTAINER_ID With Your Docker Container Id

docker logs -f 3dbcf55a5aeb

Success:- register Node TX hash:= XXXXXXXXX ( Save This )

16th Command:- Check Your status by running the Following Command

cd basic-coin-prediction-node
Restart Node The Next Day

Step 1:- Open docker 1st


Step 2:- cd basic-coin-prediction-node
Step 3:- sudo docker compose up -d
Step 4:- docker ps
Step 5:- docker logs -f 3dbcf55a5aeb

Thanks For Watching

You might also like