Skip to content

Repository files navigation

ALLORA U.S PRESIDENTIAL (TOPIC-11) NODE SETUP

Disclaimer...

This campaign rewards users who run worker nodes providing inferences for the US presidential election party winner once a day. Every inference should be the likelihood of the republican party winning the election. source run-inference-political

1. Components

  • Worker: The node that publishes inferences to the Allora chain.
  • Inference: A container that conducts inferences, maintains the model state, and responds to internal inference requests via a Flask application. This node operates with a basic linear regression model for price predictions.
  • Updater: A cron-like container designed to update the inference node's data by daily fetching the latest market information from the data provider, ensuring the model stays current with new market trends.
  • Topic ID: Running this worker on Topic 11
  • TOKEN= D For have inference D: Democrat
  • TOKEN= R For have inference R: Republic
  • MODEL: 9 Total Models
  • Dataset: polymarket.com
  • Probability: Prediction of % total 0 - 100%

Setup Worker

  1. Clone this repository
git clone https://github.com/0xtnpxsgt/allora-election2024.git
cd allora-election2024
  1. Provided and modify model config environment file

Copy and read the example .env.example for your variables

cp .env.example .env

Edit .env Configuration - Save ctrl X + Y hit Enter

nano .env
  1. **Here are the currently accepted configurations
  • TOKEN= (D or R)

  • MODEL= Choose 1 Model from the LIST

    • SVR
    • RandomForest
    • GradientBoosting
    • LinearRegression
    • DecisionTree
    • KNeighbors
    • MLP
    • ExtraTrees
    • AdaBoost
  • Sample .env file Format

TOKEN=R,D
MODEL=SVR
  1. Edit your config & initialize worker

Edit: WALLET NAME / SEEDPHRASE / RPC

nano config.json

Run the following commands root directory to initialize the worker

chmod +x init.config
./init.config
  1. Start your worker node

Run the following command to start the worker node, inference, and updater nodes:

docker compose up --build -d

Check logs

docker compose logs -f --tail=100

To confirm that the worker successfully sends the inferences to the chain, look for the following log:

{"level":"debug","msg":"Send Worker Data to chain","txHash":<tx-hash>,"time":<timestamp>,"message":"Success"}

Testing Inference Only

Send requests to the inference model. For example, request probability of Democrat(D) or Republic(R) :

curl http://127.0.0.1:8000/inference/R

Troubleshoot Container Error

Screenshot 2024-10-09 110331

To Fix Run Command:

docker compose restart

Expected response of numbering: "value":"xx.xxxx"

THANKS TO ARCXTEAM FOR THE IDEA

About

No description, website, or topics provided.

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages