deep-ink-ventures / elio-dao-service

Apache License 2.0
0 stars 0 forks source link

Elio Dao Service

Installation

Setup

cp .env.example .env

Adjust the .env values according to your needs, source it, so it is available in your current environment.

source .env

If using zsh (for example, on macOS), you may need to mark variables for export, before calling any make target:

set -a; source .env; set +a

Quickstart using Docker

docker compose build
docker compose up

Development Setup

Prerequisites

Create and activate Python venv

make venv

Activate this virtual environment:

source venv/bin/activate

Execute deactivate to exit out of the virtual environment.

Get and Build Python Requirements

Then use the build Make target to get all requirements fetched and compiled:

make build

Start databases

Make sure you have:

  1. Docker running
  2. and the environment is loaded

The following starts the data stores used by this project: PostgreSQL.

make start-postgres

The following starts the data stores used by this project: Redis.

make start-redis

Both together:

make start-databases

To stop the data stores, use Docker Compose:

docker-compose down postgres
docker-compose down redis

Start App

make start-dev

Some make commands can be used w/ or w/o docker for the app container:

Syncing the Database with the Blockchain

If your blockchain is running and setup in .env under BLOCKCHAIN_URL you can start the event listener by running:

make start-listener

It will sync the database with the chain and try to fetch a new block every BLOCK_CREATION_INTERVAL seconds.

Documentation

API documentation: /redoc/

Environments Variables

Base Setup