From b7bb44fa955ee287e2c22991d88ee1020c7d6542 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Thu, 13 Jun 2024 15:02:23 +0530 Subject: [PATCH] Use sushiswap prefix for stack components --- ...> docker-compose-watcher-sushiswap-v3.yml} | 0 .../start-job-runner.sh | 0 .../start-server.sh | 0 .../watcher-v3/watcher-config-template.toml | 101 ------------------ .../.dockerignore | 0 .../cerc-watcher-sushiswap-v3/Dockerfile | 15 +++ .../cerc-watcher-v3/Dockerfile | 11 -- .../stacks/{v3 => sushiswap-v3}/stack.yml | 0 8 files changed, 15 insertions(+), 112 deletions(-) rename stacks/stack-orchestrator/compose/{docker-compose-watcher-v3.yml => docker-compose-watcher-sushiswap-v3.yml} (100%) rename stacks/stack-orchestrator/config/{watcher-v3 => watcher-sushiswap-v3}/start-job-runner.sh (100%) rename stacks/stack-orchestrator/config/{watcher-v3 => watcher-sushiswap-v3}/start-server.sh (100%) delete mode 100644 stacks/stack-orchestrator/config/watcher-v3/watcher-config-template.toml rename stacks/stack-orchestrator/container-build/{cerc-watcher-v3 => cerc-watcher-sushiswap-v3}/.dockerignore (100%) create mode 100644 stacks/stack-orchestrator/container-build/cerc-watcher-sushiswap-v3/Dockerfile delete mode 100644 stacks/stack-orchestrator/container-build/cerc-watcher-v3/Dockerfile rename stacks/stack-orchestrator/stacks/{v3 => sushiswap-v3}/stack.yml (100%) diff --git a/stacks/stack-orchestrator/compose/docker-compose-watcher-v3.yml b/stacks/stack-orchestrator/compose/docker-compose-watcher-sushiswap-v3.yml similarity index 100% rename from stacks/stack-orchestrator/compose/docker-compose-watcher-v3.yml rename to stacks/stack-orchestrator/compose/docker-compose-watcher-sushiswap-v3.yml diff --git a/stacks/stack-orchestrator/config/watcher-v3/start-job-runner.sh b/stacks/stack-orchestrator/config/watcher-sushiswap-v3/start-job-runner.sh similarity index 100% rename from stacks/stack-orchestrator/config/watcher-v3/start-job-runner.sh rename to stacks/stack-orchestrator/config/watcher-sushiswap-v3/start-job-runner.sh diff --git a/stacks/stack-orchestrator/config/watcher-v3/start-server.sh b/stacks/stack-orchestrator/config/watcher-sushiswap-v3/start-server.sh similarity index 100% rename from stacks/stack-orchestrator/config/watcher-v3/start-server.sh rename to stacks/stack-orchestrator/config/watcher-sushiswap-v3/start-server.sh diff --git a/stacks/stack-orchestrator/config/watcher-v3/watcher-config-template.toml b/stacks/stack-orchestrator/config/watcher-v3/watcher-config-template.toml deleted file mode 100644 index bbc19c2..0000000 --- a/stacks/stack-orchestrator/config/watcher-v3/watcher-config-template.toml +++ /dev/null @@ -1,101 +0,0 @@ -[server] - host = "0.0.0.0" - port = 3008 - kind = "active" - gqlPath = "/" - - # Checkpointing state. - checkpointing = true - - # Checkpoint interval in number of blocks. - checkpointInterval = 2000 - - # Enable state creation - # CAUTION: Disable only if state creation is not desired or can be filled subsequently - enableState = false - - subgraphPath = "./subgraph-build" - - # Interval to restart wasm instance periodically - wasmRestartBlocksInterval = 20 - - # 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 - - # 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" - port = 9000 - [metrics.gql] - port = 9001 - -[database] - type = "postgres" - host = "sushiswap-v3-watcher-db" - port = 5432 - database = "sushiswap-v3-watcher" - username = "vdbm" - password = "password" - synchronize = true - logging = false - -[upstream] - [upstream.ethServer] - rpcProviderEndpoints = REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS - - # Boolean flag to specify if rpc-eth-client should be used for RPC endpoint instead of ipld-eth-client (ipld-eth-server GQL client) - rpcClient = true - - # Boolean flag to specify if rpcProviderEndpoint is an FEVM RPC endpoint - isFEVM = true - - # Boolean flag to filter event logs by contracts - filterLogsByAddresses = true - # Boolean flag to filter event logs by topics - filterLogsByTopics = true - - [upstream.cache] - name = "requests" - enabled = false - deleteOnStart = false - -[jobQueue] - dbConnectionString = "postgres://vdbm:password@sushiswap-v3-watcher-db/sushiswap-v3-watcher-job-queue" - maxCompletionLagInSecs = 300 - jobDelayInMilliSecs = 100 - eventsInBatch = 50 - subgraphEventsOrder = true - # Filecoin block time: https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#blocktime - blockDelayInMilliSecs = 30000 - - # 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). - useBlockRanges = true - - # Block range in which logs are fetched during historical blocks processing - historicalLogsBlockRange = 2000 - - # Max block range of historical processing after which it waits for completion of events processing - # If set to -1 historical processing does not wait for events processing and completes till latest canonical block - historicalMaxFetchAhead = 10000 - - # Max number of retries to fetch new block after which watcher will failover to other RPC endpoints - maxNewBlockRetries = 3 diff --git a/stacks/stack-orchestrator/container-build/cerc-watcher-v3/.dockerignore b/stacks/stack-orchestrator/container-build/cerc-watcher-sushiswap-v3/.dockerignore similarity index 100% rename from stacks/stack-orchestrator/container-build/cerc-watcher-v3/.dockerignore rename to stacks/stack-orchestrator/container-build/cerc-watcher-sushiswap-v3/.dockerignore diff --git a/stacks/stack-orchestrator/container-build/cerc-watcher-sushiswap-v3/Dockerfile b/stacks/stack-orchestrator/container-build/cerc-watcher-sushiswap-v3/Dockerfile new file mode 100644 index 0000000..71aba48 --- /dev/null +++ b/stacks/stack-orchestrator/container-build/cerc-watcher-sushiswap-v3/Dockerfile @@ -0,0 +1,15 @@ +FROM node:18.17.1-alpine3.18 + +RUN apk --update --no-cache add git python3 alpine-sdk bash curl jq + +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 sv3-watcher-ts" && \ + yarn && yarn build diff --git a/stacks/stack-orchestrator/container-build/cerc-watcher-v3/Dockerfile b/stacks/stack-orchestrator/container-build/cerc-watcher-v3/Dockerfile deleted file mode 100644 index 9da5526..0000000 --- a/stacks/stack-orchestrator/container-build/cerc-watcher-v3/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM node:18.17.1-alpine3.18 - -RUN apk --update --no-cache add git python3 alpine-sdk bash curl jq - -WORKDIR /app - -COPY . . - -RUN echo "Installing dependencies and building sv3-watcher-ts" && \ - yarn && yarn build diff --git a/stacks/stack-orchestrator/stacks/v3/stack.yml b/stacks/stack-orchestrator/stacks/sushiswap-v3/stack.yml similarity index 100% rename from stacks/stack-orchestrator/stacks/v3/stack.yml rename to stacks/stack-orchestrator/stacks/sushiswap-v3/stack.yml