32 lines
759 B
Python
32 lines
759 B
Python
import cic_eth.cli
|
|
from cic_eth.server.app import create_app
|
|
from cic_eth.server.config import get_config
|
|
|
|
|
|
config = get_config()
|
|
|
|
|
|
# Setup Celery App
|
|
celery_app = cic_eth.cli.CeleryApp.from_config(config)
|
|
celery_app.set_default()
|
|
|
|
|
|
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')
|
|
|
|
|
|
app = create_app(chain_spec,
|
|
celery_queue,
|
|
redis_host,
|
|
redis_port,
|
|
redis_db,
|
|
redis_timeout)
|
|
|
|
if __name__ == "__main__":
|
|
import uvicorn
|
|
uvicorn.run(app, host="0.0.0.0", port=5000, log_level="info")
|