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
- 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
%total0 - 100%
- Clone this repository
git clone https://github.com/0xtnpxsgt/allora-election2024.git
cd allora-election2024- Provided and modify model config environment file
Copy and read the example .env.example for your variables
cp .env.example .envEdit .env Configuration - Save ctrl X + Y hit Enter
nano .env- **Here are the currently accepted configurations
-
TOKEN= (
DorR) -
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- Edit your config & initialize worker
Edit: WALLET NAME / SEEDPHRASE / RPC
nano config.jsonRun the following commands root directory to initialize the worker
chmod +x init.config
./init.config- Start your worker node
Run the following command to start the worker node, inference, and updater nodes:
docker compose up --build -dCheck logs
docker compose logs -f --tail=100To 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"}Send requests to the inference model. For example, request probability of Democrat(D) or Republic(R) :
curl http://127.0.0.1:8000/inference/RTo Fix Run Command:
docker compose restartExpected response of numbering:
"value":"xx.xxxx"
