Compare commits

..

13 Commits

Author SHA1 Message Date
Clement
ef4b04b30b
Merge pull request #17 from dhairya1008/fix-FromAsCasing-warning
Dockerfile: fix FromAsCasing warning
2024-09-05 18:37:42 +02:00
Clement
79d23dd10a
Merge branch 'main' into fix-FromAsCasing-warning 2024-09-05 18:28:10 +02:00
Clement
820bfcc479
Merge pull request #21 from Radovenchyk/patch-1
Fix typo update README
2024-09-05 18:21:17 +02:00
Clement
6af36f417b
Merge pull request #22 from Olexandr88/patch-1
Update README
2024-09-05 18:20:38 +02:00
Clement
e97d8e0162
Merge pull request #19 from allora-network/kush-alloralabs-patch-1
Update README.md
2024-09-05 18:17:05 +02:00
Clement
5807ebbeff Update region in Readme 2024-09-05 18:14:10 +02:00
kush-alloralabs
1f2e49f948
Merge pull request #23 from allora-network/clement/fix-healthcheck
Fix healthcheck missing curl dependency
2024-09-05 09:43:45 -04:00
Clement
3b3644b470 Fix healthcheck 2024-09-05 15:41:27 +02:00
Clement
233393fc63 Update README.md 2024-09-05 15:41:10 +02:00
Olexandr Radovenchyk
f5f3ea8364
Update README 2024-09-05 13:32:20 +03:00
Oleh
a2af3605c3
Fix typo update README 2024-09-05 13:10:48 +03:00
kush-alloralabs
5cbbeeedc2
Update README.md 2024-09-04 16:33:40 -04:00
dhairya1899
4d95ca5fbd Dockerfile: fix FromAsCasing warning
Some recent versions of Docker require the FromAsCasing keyword to be in
uppercase

Signed-off-by: dhairya1899 <17itdhairya.parmar@gmail.com>
2024-08-15 01:18:24 +05:30
3 changed files with 13 additions and 10 deletions

View File

@ -1,4 +1,7 @@
FROM python:3.11-slim as project_env FROM python:3.11-slim AS project_env
# Install curl
RUN apt-get update && apt-get install -y curl
# Set the working directory in the container # Set the working directory in the container
WORKDIR /app WORKDIR /app

View File

@ -1,6 +1,6 @@
# Basic Price Prediction Node # Basic Price Prediction Node
This repository provides an example Allora network worker node, designed to offer price predictions. The primary objective is to demonstrate the use of a basic inference model running within a dedicated container, showcasing its integration with the Allora network infrastructure to contribute valuable inferences. This repository provides an example [Allora network](https://docs.allora.network/) worker node, designed to offer price predictions. The primary objective is to demonstrate the use of a basic inference model running within a dedicated container, showcasing its integration with the Allora network infrastructure to contribute valuable inferences.
## Components ## Components
@ -26,25 +26,25 @@ A complete working example is provided in the `docker-compose.yml` file.
Here are the currently accepted configurations: Here are the currently accepted configurations:
- TOKEN - TOKEN
Must be one in ['ETH','SOL','BTC','BNB','ARB']. Must be one in ('ETH','SOL','BTC','BNB','ARB').
Note: if you are using `Binance` as the data provider, any token could be used. Note: if you are using `Binance` as the data provider, any token could be used.
If you are using Coingecko, you should add its `coin_id` in the [token_map here](https://github.com/allora-network/basic-coin-prediction-node/blob/main/updater.py#L107). Find [more info here](https://docs.coingecko.com/reference/simple-price) and the [list here](https://docs.google.com/spreadsheets/d/1wTTuxXt8n9q7C4NDXqQpI3wpKu1_5bGVmP9Xz0XGSyU/edit?usp=sharing). If you are using Coingecko, you should add its `coin_id` in the [token_map here](https://github.com/allora-network/basic-coin-prediction-node/blob/main/updater.py#L107). Find [more info here](https://docs.coingecko.com/reference/simple-price) and the [list here](https://docs.google.com/spreadsheets/d/1wTTuxXt8n9q7C4NDXqQpI3wpKu1_5bGVmP9Xz0XGSyU/edit?usp=sharing).
- TRAINING_DAYS - TRAINING_DAYS
Must be an `int` >= 1. Must be an `int` >= 1.
Represents how many days of historical data to use. Represents how many days of historical data to use.
- TIMEFRAME - TIMEFRAME
This should be in this form: `10m`, `1h`, `1d`, etc. This should be in this form: `10min`, `1h`, `1d`, `1m`, etc.
Note: For Coingecko, Data granularity (candle's body) is automatic - [see here](https://docs.coingecko.com/reference/coins-id-ohlc). To avoid downsampling, it is recommanded to use with Coingecko: Note: For Coingecko, Data granularity (candle's body) is automatic - [see here](https://docs.coingecko.com/reference/coins-id-ohlc). To avoid downsampling, it is recommanded to use with Coingecko:
- TIMEFRAME >= 30m if TRAINING_DAYS <= 2 - TIMEFRAME >= 30m if TRAINING_DAYS <= 2
- TIMEFRAME >= 4h if TRAINING_DAYS <= 30 - TIMEFRAME >= 4h if TRAINING_DAYS <= 30
- TIMEFRAME >= 4d if TRAINING_DAYS >= 31 - TIMEFRAME >= 4d if TRAINING_DAYS >= 31
- MODEL - MODEL
Must be one in ['LinearRegression','SVR','KernelRidge','BayesianRidge']. Must be one in ('LinearRegression','SVR','KernelRidge','BayesianRidge').
You can easily add support for any other models by [adding it here](https://github.com/allora-network/basic-coin-prediction-node/blob/main/model.py#L133). You can easily add support for any other models by [adding it here](https://github.com/allora-network/basic-coin-prediction-node/blob/main/model.py#L133).
- REGION - REGION
Must be `EU` or `US` - it is used for the Binance API. Used for the Binance API. This should be in this form: `US`, `EU`, etc.
- DATA_PROVIDER - DATA_PROVIDER
Must be `Binance` or `Coingecko`. Feel free to add support for other data providers to personalize your model! Must be `binance` or `coingecko`. Feel free to add support for other data providers to personalize your model!
- CG_API_KEY - CG_API_KEY
This is your `Coingecko` API key, if you've set `DATA_PROVIDER=coingecko`. This is your `Coingecko` API key, if you've set `DATA_PROVIDER=coingecko`.

View File

@ -1,6 +1,6 @@
services: services:
inference: inference:
container_name: inference-basic-eth-pred container_name: inference
env_file: env_file:
- .env - .env
build: . build: .
@ -8,7 +8,7 @@ services:
ports: ports:
- "8000:8000" - "8000:8000"
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/inference/${TOKEN}"] test: ["CMD", "curl", "-f", "http://inference:8000/inference/${TOKEN}"]
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 12 retries: 12
@ -16,7 +16,7 @@ services:
- ./inference-data:/app/data - ./inference-data:/app/data
updater: updater:
container_name: updater-basic-eth-pred container_name: updater
build: . build: .
environment: environment:
- INFERENCE_API_ADDRESS=http://inference:8000 - INFERENCE_API_ADDRESS=http://inference:8000