From 7601e3eeff82a07175d7e1de20101048e291002c Mon Sep 17 00:00:00 2001 From: PhilipWafula Date: Mon, 18 Oct 2021 15:19:32 +0300 Subject: [PATCH] Corrects breakages in cic-ussd --- .../cic_ussd/runnable/daemons/cic_user_tasker.py | 7 ++----- .../runnable/daemons/cic_user_ussd_server.py | 6 +----- docker-compose_local.yml | 12 +++++++++--- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/apps/cic-ussd/cic_ussd/runnable/daemons/cic_user_tasker.py b/apps/cic-ussd/cic_ussd/runnable/daemons/cic_user_tasker.py index 81856585..14c577c1 100644 --- a/apps/cic-ussd/cic_ussd/runnable/daemons/cic_user_tasker.py +++ b/apps/cic-ussd/cic_ussd/runnable/daemons/cic_user_tasker.py @@ -87,11 +87,8 @@ Signer.key_file_path = key_file_path i18n.load_path.append(config.get('LOCALE_PATH')) i18n.set('fallback', config.get('LOCALE_FALLBACK')) -chain_spec = ChainSpec( - common_name=config.get('CIC_COMMON_NAME'), - engine=config.get('CIC_ENGINE'), - network_id=config.get('CIC_NETWORK_ID') -) +chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC')) + Chain.spec = chain_spec Support.phone_number = config.get('OFFICE_SUPPORT_PHONE') diff --git a/apps/cic-ussd/cic_ussd/runnable/daemons/cic_user_ussd_server.py b/apps/cic-ussd/cic_ussd/runnable/daemons/cic_user_ussd_server.py index 0bbf67db..f54f3d2f 100644 --- a/apps/cic-ussd/cic_ussd/runnable/daemons/cic_user_ussd_server.py +++ b/apps/cic-ussd/cic_ussd/runnable/daemons/cic_user_ussd_server.py @@ -96,11 +96,7 @@ celery.Celery(backend=config.get('CELERY_RESULT_URL'), broker=config.get('CELERY states = json_file_parser(filepath=config.get('MACHINE_STATES')) transitions = json_file_parser(filepath=config.get('MACHINE_TRANSITIONS')) -chain_spec = ChainSpec( - common_name=config.get('CIC_COMMON_NAME'), - engine=config.get('CIC_ENGINE'), - network_id=config.get('CIC_NETWORK_ID') -) +chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC')) Chain.spec = chain_spec UssdStateMachine.states = states diff --git a/docker-compose_local.yml b/docker-compose_local.yml index 4a0fbde6..a547b55d 100644 --- a/docker-compose_local.yml +++ b/docker-compose_local.yml @@ -498,6 +498,9 @@ services: DATABASE_POOL_SIZE: 0 CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis} CELERY_RESULT_URL: ${CELERY_BROKER_URL:-redis://redis} + CHAIN_SPEC: ${CHAIN_SPEC:-"evm:byzantium:8996:bloxberg"} + REDIS_PORT: 6379 + REDIS_HOST: redis PGP_PASSPHRASE: merman CIC_META_URL: ${CIC_META_URL:-http://meta:8000} restart: unless-stopped @@ -561,9 +564,12 @@ services: DATABASE_DRIVER: ${DATABASE_DRIVER:-psycopg2} DATABASE_DEBUG: ${DATABASE_DEBUG:-0} DATABASE_POOL_SIZE: 0 - restart: on-failure - ports: - - ${DEV_CIC_USER_SERVER_PORT:-63415}:9500 + CHAIN_SPEC: ${CHAIN_SPEC:-"evm:byzantium:8996:bloxberg"} + CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis} + CELERY_RESULT_URL: ${CELERY_RESULT_URL:-redis://redis} + REDIS_PORT: 6379 + REDIS_HOST: redis + restart: on-failure depends_on: - postgres - redis