cic-internal-integration/apps/cic-eth/cic_eth/runnable/daemons/server.py

32 lines
759 B
Python
Raw Normal View History

2022-01-05 10:16:48 +01:00
import cic_eth.cli
from cic_eth.server.app import create_app
from cic_eth.server.config import get_config
2021-10-25 16:51:45 +02:00
2021-11-19 14:50:13 +01:00
2022-01-05 10:16:48 +01:00
config = get_config()
2021-11-18 13:38:20 +01:00
2021-10-25 16:51:45 +02:00
2022-01-05 10:16:48 +01:00
# Setup Celery App
celery_app = cic_eth.cli.CeleryApp.from_config(config)
celery_app.set_default()
2021-12-21 19:15:45 +01:00
2022-01-05 10:16:48 +01:00
chain_spec = config.get('CHAIN_SPEC')
celery_queue = config.get('CELERY_QUEUE')
redis_host = config.get('REDIS_HOST')
redis_port = config.get('REDIS_PORT')
redis_db = config.get('REDIS_DB')
redis_timeout = config.get('REDIS_TIMEOUT')
2021-12-21 19:15:45 +01:00
2022-01-05 10:16:48 +01:00
app = create_app(chain_spec,
celery_queue,
redis_host,
redis_port,
redis_db,
redis_timeout)
2021-12-21 19:15:45 +01:00
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=5000, log_level="info")