From 25987b581e0c2a9ba894e8b55ed8015a43b64d2f Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 13 Jun 2024 14:44:09 +0530 Subject: [PATCH] Update watcher stack for latest watcher changes --- ...docker-compose-watcher-secured-finance.yml | 2 ++ .../watcher-config-template.toml | 35 ++++++++++++------- .../cerc-watcher-secured-finance/Dockerfile | 5 +++ .../stacks/secured-finance/stack.yml | 2 +- 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/stack-orchestrator/compose/docker-compose-watcher-secured-finance.yml b/stack-orchestrator/compose/docker-compose-watcher-secured-finance.yml index fc0cd2b..ff30b2f 100644 --- a/stack-orchestrator/compose/docker-compose-watcher-secured-finance.yml +++ b/stack-orchestrator/compose/docker-compose-watcher-secured-finance.yml @@ -60,6 +60,7 @@ services: volumes: - ../config/watcher-secured-finance/watcher-config-template.toml:/app/environments/watcher-config-template.toml - ../config/watcher-secured-finance/start-server.sh:/app/start-server.sh + - secured_finance_watcher_gql_logs_data:/app/gql-logs ports: - "3008" - "9001" @@ -74,3 +75,4 @@ services: volumes: secured_finance_watcher_db_data: + secured_finance_watcher_gql_logs_data: diff --git a/stack-orchestrator/config/watcher-secured-finance/watcher-config-template.toml b/stack-orchestrator/config/watcher-secured-finance/watcher-config-template.toml index 069d610..044dc00 100644 --- a/stack-orchestrator/config/watcher-secured-finance/watcher-config-template.toml +++ b/stack-orchestrator/config/watcher-secured-finance/watcher-config-template.toml @@ -2,7 +2,6 @@ host = "0.0.0.0" port = 3008 kind = "active" - gqlPath = "/" # Checkpointing state. checkpointing = true @@ -22,23 +21,30 @@ # Interval in number of blocks at which to clear entities cache. clearEntitiesCacheInterval = 1000 - # Max block range for which to return events in eventsInRange GQL query. - # Use -1 for skipping check on block range. - maxEventsBlockRange = 1000 - # Flag to specify whether RPC endpoint supports block hash as block tag parameter rpcSupportsBlockHashParam = false - # GQL cache settings - [server.gqlCache] - enabled = true + # Server GQL config + [server.gql] + path = "/" - # Max in-memory cache size (in bytes) (default 8 MB) - # maxCacheSize + # Max block range for which to return events in eventsInRange GQL query. + # Use -1 for skipping check on block range. + maxEventsBlockRange = 1000 - # GQL cache-control max-age settings (in seconds) - maxAge = 15 - timeTravelMaxAge = 86400 # 1 day + # Log directory for GQL requests + logDir = "./gql-logs" + + # GQL cache settings + [server.gql.cache] + enabled = true + + # Max in-memory cache size (in bytes) (default 8 MB) + # maxCacheSize + + # GQL cache-control max-age settings (in seconds) + maxAge = 15 + timeTravelMaxAge = 86400 # 1 day [metrics] host = "0.0.0.0" @@ -85,6 +91,9 @@ # Filecoin block time: https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#blocktime blockDelayInMilliSecs = 30000 + # Number of blocks by which block processing lags behind head + blockProcessingOffset = 0 + # Boolean to switch between modes of processing events when starting the server. # Setting to true will fetch filtered events and required blocks in a range of blocks and then process them. # Setting to false will fetch blocks consecutively with its events and then process them (Behaviour is followed in realtime processing near head). diff --git a/stack-orchestrator/container-build/cerc-watcher-secured-finance/Dockerfile b/stack-orchestrator/container-build/cerc-watcher-secured-finance/Dockerfile index 592d58f..d60f21e 100644 --- a/stack-orchestrator/container-build/cerc-watcher-secured-finance/Dockerfile +++ b/stack-orchestrator/container-build/cerc-watcher-secured-finance/Dockerfile @@ -6,5 +6,10 @@ WORKDIR /app COPY . . +# Get the latest Git commit hash and set in package.json +RUN COMMIT_HASH=$(git rev-parse HEAD) && \ + jq --arg commitHash "$COMMIT_HASH" '.commitHash = $commitHash' package.json > tmp.json && \ + mv tmp.json package.json + RUN echo "Installing dependencies and building secured-finance-watcher-ts" && \ yarn && yarn build diff --git a/stack-orchestrator/stacks/secured-finance/stack.yml b/stack-orchestrator/stacks/secured-finance/stack.yml index 4773c06..03c143b 100644 --- a/stack-orchestrator/stacks/secured-finance/stack.yml +++ b/stack-orchestrator/stacks/secured-finance/stack.yml @@ -2,7 +2,7 @@ version: "1.0" name: secured-finance description: "Secured finance watcher stack" repos: - - git.vdb.to/cerc-io/secured-finance-watcher-ts@v0.1.0 + - git.vdb.to/cerc-io/secured-finance-watcher-ts@v0.1.1 containers: - cerc/watcher-secured-finance pods: -- 2.45.2