From a01b188ad42199a1ff67abb612f189928d56b295 Mon Sep 17 00:00:00 2001 From: Nabarun Date: Wed, 22 Nov 2023 19:35:27 +0530 Subject: [PATCH] Run azimuth watcher in active mode --- .../compose/docker-compose-watcher-azimuth.yml | 17 +++++++++++++++-- .../config/watcher-azimuth/start-job-runner.sh | 8 ++++---- .../watcher-config-template.toml | 1 - 3 files changed, 19 insertions(+), 7 deletions(-) mode change 100644 => 100755 stack_orchestrator/data/config/watcher-azimuth/start-job-runner.sh diff --git a/stack_orchestrator/data/compose/docker-compose-watcher-azimuth.yml b/stack_orchestrator/data/compose/docker-compose-watcher-azimuth.yml index b218908d..ca666f51 100644 --- a/stack_orchestrator/data/compose/docker-compose-watcher-azimuth.yml +++ b/stack_orchestrator/data/compose/docker-compose-watcher-azimuth.yml @@ -29,16 +29,29 @@ services: depends_on: watcher-db: condition: service_healthy + env_file: + - ../config/watcher-azimuth/watcher-params.env environment: CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC} CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL} + CONTRACT_ADDRESS: 0x223c067F8CF28ae173EE5CafEa60cA44C335fecB + CONTRACT_NAME: Azimuth + STARTING_BLOCK: 6784880 working_dir: /app/packages/azimuth-watcher command: "./start-job-runner.sh" volumes: - ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/azimuth-watcher/environments/watcher-config-template.toml - ../config/watcher-azimuth/merge-toml.js:/app/packages/azimuth-watcher/merge-toml.js - ../config/watcher-azimuth/start-job-runner.sh:/app/packages/azimuth-watcher/start-job-runner.sh + healthcheck: + test: ["CMD", "nc", "-vz", "localhost", "9000"] + interval: 20s + timeout: 5s + retries: 15 + start_period: 5s + extra_hosts: + - "host.docker.internal:host-gateway" # Starts the azimuth-watcher server azimuth-watcher-server: @@ -47,8 +60,8 @@ services: depends_on: watcher-db: condition: service_healthy - env_file: - - ../config/watcher-azimuth/watcher-params.env + azimuth-watcher-job-runner: + condition: service_healthy environment: CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC} diff --git a/stack_orchestrator/data/config/watcher-azimuth/start-job-runner.sh b/stack_orchestrator/data/config/watcher-azimuth/start-job-runner.sh old mode 100644 new mode 100755 index c0a6a94f..4ecd0fc7 --- a/stack_orchestrator/data/config/watcher-azimuth/start-job-runner.sh +++ b/stack_orchestrator/data/config/watcher-azimuth/start-job-runner.sh @@ -1,3 +1,4 @@ +#!/bin/sh set -e if [ -n "$CERC_SCRIPT_DEBUG" ]; then set -x @@ -19,8 +20,7 @@ echo "$WATCHER_CONFIG" > environments/watcher-config.toml # Merge SO watcher config with existing config file node merge-toml.js +yarn watch:contract --address $CONTRACT_ADDRESS --kind $CONTRACT_NAME --checkpoint true --starting-block $STARTING_BLOCK + echo 'yarn job-runner' - -yarn watch:contract --address 0x223c067F8CF28ae173EE5CafEa60cA44C335fecB --kind Azimuth --checkpoint true --starting-block 6784880 -yarn yarn job-runner - +yarn job-runner diff --git a/stack_orchestrator/data/config/watcher-azimuth/watcher-config-template.toml b/stack_orchestrator/data/config/watcher-azimuth/watcher-config-template.toml index 512f6242..1a4616fc 100644 --- a/stack_orchestrator/data/config/watcher-azimuth/watcher-config-template.toml +++ b/stack_orchestrator/data/config/watcher-azimuth/watcher-config-template.toml @@ -12,4 +12,3 @@ [upstream.ethServer] gqlApiEndpoint = "REPLACE_WITH_CERC_IPLD_ETH_GQL" rpcProviderEndpoint = "REPLACE_WITH_CERC_IPLD_ETH_RPC" - rpcClient = true \ No newline at end of file