From a8b164dffed7580aed346b6c7e6ba450107facbe Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Thu, 13 Jun 2024 18:36:59 +0530 Subject: [PATCH 1/6] Update port mapping and stack path in readme --- stacks/stack-orchestrator/stacks/sushiswap-v3/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stacks/stack-orchestrator/stacks/sushiswap-v3/README.md b/stacks/stack-orchestrator/stacks/sushiswap-v3/README.md index e27e95f..b7dd20b 100644 --- a/stacks/stack-orchestrator/stacks/sushiswap-v3/README.md +++ b/stacks/stack-orchestrator/stacks/sushiswap-v3/README.md @@ -3,7 +3,7 @@ ## Clone the stack repo ```bash -laconic-so fetch-stack git.vdb.to/cerc-io/sushiswap-watcher-ts +laconic-so fetch-stack ~/cerc/sushiswap-watcher-ts/stack-orchestrator/stacks/sushiswap-v3 ``` ## Build the container image -- 2.45.2 From 50f9f578d47f5bfc1cb811643609254432a5debe Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Fri, 14 Jun 2024 10:47:14 +0530 Subject: [PATCH 2/6] Fix mount paths for mounted files --- stacks/stack-orchestrator/stacks/sushiswap-v3/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stacks/stack-orchestrator/stacks/sushiswap-v3/README.md b/stacks/stack-orchestrator/stacks/sushiswap-v3/README.md index b7dd20b..e27e95f 100644 --- a/stacks/stack-orchestrator/stacks/sushiswap-v3/README.md +++ b/stacks/stack-orchestrator/stacks/sushiswap-v3/README.md @@ -3,7 +3,7 @@ ## Clone the stack repo ```bash -laconic-so fetch-stack ~/cerc/sushiswap-watcher-ts/stack-orchestrator/stacks/sushiswap-v3 +laconic-so fetch-stack git.vdb.to/cerc-io/sushiswap-watcher-ts ``` ## Build the container image -- 2.45.2 From 1cebe7733670b204ed29c94fbe77c106deb719c9 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Fri, 14 Jun 2024 11:00:59 +0530 Subject: [PATCH 3/6] Add docker compose file for v2 --- .../docker-compose-watcher-sushiswap-v2.yml | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 stacks/stack-orchestrator/compose/docker-compose-watcher-sushiswap-v2.yml diff --git a/stacks/stack-orchestrator/compose/docker-compose-watcher-sushiswap-v2.yml b/stacks/stack-orchestrator/compose/docker-compose-watcher-sushiswap-v2.yml new file mode 100644 index 0000000..05122e2 --- /dev/null +++ b/stacks/stack-orchestrator/compose/docker-compose-watcher-sushiswap-v2.yml @@ -0,0 +1,80 @@ +version: '3.2' + +services: + sushiswap-v2-watcher-db: + restart: unless-stopped + image: postgres:14-alpine + environment: + - POSTGRES_USER=vdbm + - POSTGRES_MULTIPLE_DATABASES=sushiswap-v2-watcher,sushiswap-v2-watcher-job-queue + - POSTGRES_EXTENSION=sushiswap-v2-watcher-job-queue:pgcrypto + - POSTGRES_PASSWORD=password + volumes: + - ../config/postgresql/multiple-postgressql-databases.sh:/docker-entrypoint-initdb.d/multiple-postgressql-databases.sh + - sushiswap_v2_watcher_db_data:/var/lib/postgresql/data + ports: + - "5432" + healthcheck: + test: ["CMD", "nc", "-v", "localhost", "5432"] + interval: 20s + timeout: 5s + retries: 15 + start_period: 10s + + sushiswap-v2-watcher-job-runner: + restart: unless-stopped + depends_on: + sushiswap-v2-watcher-db: + condition: service_healthy + image: cerc/watcher-sushiswap:local + environment: + CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} + CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS} + working_dir: /app/packages/v2-watcher + command: ["bash", "./start-job-runner.sh"] + volumes: + - ../config/watcher-sushiswap-v2/watcher-config-template.toml:/app/packages/v2-watcher/environments/watcher-config-template.toml + - ../config/watcher-sushiswap-v2/start-job-runner.sh:/app/packages/v2-watcher/start-job-runner.sh + ports: + - "9000:9000" + healthcheck: + test: ["CMD", "nc", "-vz", "127.0.0.1", "9000"] + interval: 20s + timeout: 5s + retries: 15 + start_period: 5s + extra_hosts: + - "host.docker.internal:host-gateway" + + sushiswap-v2-watcher-server: + restart: unless-stopped + depends_on: + sushiswap-v2-watcher-db: + condition: service_healthy + sushiswap-v2-watcher-job-runner: + condition: service_healthy + image: cerc/watcher-sushiswap:local + environment: + CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG} + CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS} + working_dir: /app/packages/v2-watcher + command: ["bash", "./start-server.sh"] + volumes: + - ../config/watcher-sushiswap-v2/watcher-config-template.toml:/app/packages/v2-watcher/environments/watcher-config-template.toml + - ../config/watcher-sushiswap-v2/start-server.sh:/app/packages/v2-watcher/start-server.sh + - sushiswap_v2_watcher_gql_logs_data:/app/packages/v2-watcher/gql-logs + ports: + - "3008" + - "9001" + healthcheck: + test: ["CMD", "nc", "-vz", "127.0.0.1", "3008"] + interval: 20s + timeout: 5s + retries: 15 + start_period: 5s + extra_hosts: + - "host.docker.internal:host-gateway" + +volumes: + sushiswap_v2_watcher_db_data: + sushiswap_v2_watcher_gql_logs_data: -- 2.45.2 From b71ac9968c537ec2b622e0a8568b01ba83b0e5f1 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Fri, 14 Jun 2024 11:06:43 +0530 Subject: [PATCH 4/6] Add config template and scripts for v3 watcher --- .../watcher-sushiswap-v2/start-job-runner.sh | 24 ++++ .../watcher-sushiswap-v2/start-server.sh | 24 ++++ .../watcher-config-template.toml | 110 ++++++++++++++++++ 3 files changed, 158 insertions(+) create mode 100755 stacks/stack-orchestrator/config/watcher-sushiswap-v2/start-job-runner.sh create mode 100755 stacks/stack-orchestrator/config/watcher-sushiswap-v2/start-server.sh create mode 100644 stacks/stack-orchestrator/config/watcher-sushiswap-v2/watcher-config-template.toml diff --git a/stacks/stack-orchestrator/config/watcher-sushiswap-v2/start-job-runner.sh b/stacks/stack-orchestrator/config/watcher-sushiswap-v2/start-job-runner.sh new file mode 100755 index 0000000..7a7a83b --- /dev/null +++ b/stacks/stack-orchestrator/config/watcher-sushiswap-v2/start-job-runner.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e +if [ -n "$CERC_SCRIPT_DEBUG" ]; then + set -x +fi +set -u + +echo "Using ETH RPC endpoints ${CERC_ETH_RPC_ENDPOINTS}" + +# Read in the config template TOML file and modify it +WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml) + +# Convert the comma-separated list in CERC_ETH_RPC_ENDPOINTS to a JSON array +RPC_ENDPOINTS_ARRAY=$(echo "$CERC_ETH_RPC_ENDPOINTS" | tr ',' '\n' | awk '{print "\"" $0 "\""}' | paste -sd, - | sed 's/^/[/; s/$/]/') + +WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \ + sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS|${RPC_ENDPOINTS_ARRAY}| ") + +# Write the modified content to a new file +echo "$WATCHER_CONFIG" > environments/local.toml + +echo "Running job-runner..." +DEBUG=vulcanize:* exec node --enable-source-maps dist/job-runner.js diff --git a/stacks/stack-orchestrator/config/watcher-sushiswap-v2/start-server.sh b/stacks/stack-orchestrator/config/watcher-sushiswap-v2/start-server.sh new file mode 100755 index 0000000..9aaa77e --- /dev/null +++ b/stacks/stack-orchestrator/config/watcher-sushiswap-v2/start-server.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e +if [ -n "$CERC_SCRIPT_DEBUG" ]; then + set -x +fi +set -u + +echo "Using ETH RPC endpoints ${CERC_ETH_RPC_ENDPOINTS}" + +# Read in the config template TOML file and modify it +WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml) + +# Convert the comma-separated list in CERC_ETH_RPC_ENDPOINTS to a JSON array +RPC_ENDPOINTS_ARRAY=$(echo "$CERC_ETH_RPC_ENDPOINTS" | tr ',' '\n' | awk '{print "\"" $0 "\""}' | paste -sd, - | sed 's/^/[/; s/$/]/') + +WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \ + sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS|${RPC_ENDPOINTS_ARRAY}| ") + +# Write the modified content to a new file +echo "$WATCHER_CONFIG" > environments/local.toml + +echo "Running server..." +DEBUG=vulcanize:* exec node --enable-source-maps dist/server.js diff --git a/stacks/stack-orchestrator/config/watcher-sushiswap-v2/watcher-config-template.toml b/stacks/stack-orchestrator/config/watcher-sushiswap-v2/watcher-config-template.toml new file mode 100644 index 0000000..fec02a9 --- /dev/null +++ b/stacks/stack-orchestrator/config/watcher-sushiswap-v2/watcher-config-template.toml @@ -0,0 +1,110 @@ +[server] + host = "0.0.0.0" + port = 3008 + kind = "active" + + # 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 + + # Flag to specify whether RPC endpoint supports block hash as block tag parameter + rpcSupportsBlockHashParam = false + + # Server GQL config + [server.gql] + path = "/graphql" + + # Max block range for which to return events in eventsInRange GQL query. + # Use -1 for skipping check on block range. + maxEventsBlockRange = 1000 + + # 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" + port = 9000 + [metrics.gql] + port = 9001 + +[database] + type = "postgres" + host = "sushiswap-v2-watcher-db" + port = 5432 + database = "sushiswap-v2-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-v2-watcher-db/sushiswap-v2-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 + + # 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). + 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 -- 2.45.2 From 2686905a983152badc8d74dec94dced4240e7474 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Fri, 14 Jun 2024 11:13:32 +0530 Subject: [PATCH 5/6] Add v2 watcher stack instructions --- .../stacks/sushiswap-v2/README.md | 104 ++++++++++++++++++ .../stacks/sushiswap-v2/stack.yml | 8 ++ 2 files changed, 112 insertions(+) create mode 100644 stacks/stack-orchestrator/stacks/sushiswap-v2/README.md create mode 100644 stacks/stack-orchestrator/stacks/sushiswap-v2/stack.yml diff --git a/stacks/stack-orchestrator/stacks/sushiswap-v2/README.md b/stacks/stack-orchestrator/stacks/sushiswap-v2/README.md new file mode 100644 index 0000000..93c58e1 --- /dev/null +++ b/stacks/stack-orchestrator/stacks/sushiswap-v2/README.md @@ -0,0 +1,104 @@ +# SushiSwap v2 Watcher + +## Clone the stack repo + +```bash +laconic-so fetch-stack git.vdb.to/deep-stack/sushiswap-watcher-ts +``` + +## Build the container image + +```bash +laconic-so --stack ~/cerc/sushiswap-watcher-ts/stacks/stack-orchestrator/stacks/sushiswap-v2 build-containers +``` + +## Create a spec file for the deployment + +```bash +laconic-so --stack ~/cerc/sushiswap-watcher-ts/stacks/stack-orchestrator/stacks/sushiswap-v2 deploy init --output sushiswap-v2-spec.yml +``` + +### Ports + +Edit `network` in the spec file to map container ports to host ports as required: + +```yml +... +network: + ports: + sushiswap-v2-watcher-db: + - 15432:5432 + sushiswap-v2-watcher-job-runner: + - 9000:9000 + sushiswap-v2-watcher-server: + - 3008:3008 + - 9001:9001 +``` + +## Create a deployment from the spec file + +```bash +laconic-so --stack ~/cerc/sushiswap-watcher-ts/stacks/stack-orchestrator/stacks/sushiswap-v2 deploy create --spec-file sushiswap-v2-spec.yml --deployment-dir sushiswap-v2-deployment +``` + +### Configuration + +Inside deployment directory, open the `config.env` file and set following env variables: + +```bash +# External Filecoin (ETH RPC) endpoint to point the watcher to +CERC_ETH_RPC_ENDPOINTS=https://example-lotus-endpoint-1/rpc/v1,https://example-lotus-endpoint-2/rpc/v1 +``` + +## Start the deployment + +```bash +laconic-so deployment --dir sushiswap-v2-deployment start +``` + +* To list down and monitor the running containers: + + ```bash + # With status + docker ps -a + + # Check logs for a container + docker logs -f + ``` + +* Open the GQL playground at + + ```graphql + # Example query + query { + _meta { + block { + hash + number + timestamp + } + deployment + hasIndexingErrors + } + ``` + +## Clean up + +Stop all the sushiswap-v2 services running in background: + +```bash +# Only stop the docker containers +laconic-so deployment --dir sushiswap-v2-deployment stop + +# Run 'start' to restart the deployment +``` + +To stop all the sushiswap-v2 services and also delete data: + +```bash +# Stop the docker containers +laconic-so deployment --dir sushiswap-v2-deployment stop --delete-volumes + +# Remove deployment directory (deployment will have to be recreated for a re-run) +rm -r sushiswap-v2-deployment +``` diff --git a/stacks/stack-orchestrator/stacks/sushiswap-v2/stack.yml b/stacks/stack-orchestrator/stacks/sushiswap-v2/stack.yml new file mode 100644 index 0000000..8ed7246 --- /dev/null +++ b/stacks/stack-orchestrator/stacks/sushiswap-v2/stack.yml @@ -0,0 +1,8 @@ +version: "1.0" +name: sushiswap-v2 +description: "SushiSwap v2 watcher stack" +repos: +containers: + - cerc/watcher-sushiswap +pods: + - watcher-sushiswap-v2 -- 2.45.2 From dfa5c764815b7201efd2117f0e1975d3d2944390 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Fri, 14 Jun 2024 11:57:24 +0530 Subject: [PATCH 6/6] Add job runner and server scripts in common folder --- .../docker-compose-watcher-sushiswap-v2.yml | 6 ++--- .../docker-compose-watcher-sushiswap-v3.yml | 6 ++--- .../start-job-runner.sh | 0 .../start-server.sh | 0 .../watcher-sushiswap-v3/start-job-runner.sh | 24 ------------------- .../watcher-sushiswap-v3/start-server.sh | 24 ------------------- .../stacks/sushiswap-v2/README.md | 2 +- 7 files changed, 7 insertions(+), 55 deletions(-) rename stacks/stack-orchestrator/config/{watcher-sushiswap-v2 => common}/start-job-runner.sh (100%) rename stacks/stack-orchestrator/config/{watcher-sushiswap-v2 => common}/start-server.sh (100%) delete mode 100755 stacks/stack-orchestrator/config/watcher-sushiswap-v3/start-job-runner.sh delete mode 100755 stacks/stack-orchestrator/config/watcher-sushiswap-v3/start-server.sh diff --git a/stacks/stack-orchestrator/compose/docker-compose-watcher-sushiswap-v2.yml b/stacks/stack-orchestrator/compose/docker-compose-watcher-sushiswap-v2.yml index 05122e2..2762498 100644 --- a/stacks/stack-orchestrator/compose/docker-compose-watcher-sushiswap-v2.yml +++ b/stacks/stack-orchestrator/compose/docker-compose-watcher-sushiswap-v2.yml @@ -34,9 +34,9 @@ services: command: ["bash", "./start-job-runner.sh"] volumes: - ../config/watcher-sushiswap-v2/watcher-config-template.toml:/app/packages/v2-watcher/environments/watcher-config-template.toml - - ../config/watcher-sushiswap-v2/start-job-runner.sh:/app/packages/v2-watcher/start-job-runner.sh + - ../config/common/start-job-runner.sh:/app/packages/v2-watcher/start-job-runner.sh ports: - - "9000:9000" + - "9000" healthcheck: test: ["CMD", "nc", "-vz", "127.0.0.1", "9000"] interval: 20s @@ -61,7 +61,7 @@ services: command: ["bash", "./start-server.sh"] volumes: - ../config/watcher-sushiswap-v2/watcher-config-template.toml:/app/packages/v2-watcher/environments/watcher-config-template.toml - - ../config/watcher-sushiswap-v2/start-server.sh:/app/packages/v2-watcher/start-server.sh + - ../config/common/start-server.sh:/app/packages/v2-watcher/start-server.sh - sushiswap_v2_watcher_gql_logs_data:/app/packages/v2-watcher/gql-logs ports: - "3008" diff --git a/stacks/stack-orchestrator/compose/docker-compose-watcher-sushiswap-v3.yml b/stacks/stack-orchestrator/compose/docker-compose-watcher-sushiswap-v3.yml index b1f99bf..a36cf94 100644 --- a/stacks/stack-orchestrator/compose/docker-compose-watcher-sushiswap-v3.yml +++ b/stacks/stack-orchestrator/compose/docker-compose-watcher-sushiswap-v3.yml @@ -34,9 +34,9 @@ services: command: ["bash", "./start-job-runner.sh"] volumes: - ../config/watcher-sushiswap-v3/watcher-config-template.toml:/app/packages/v3-watcher/environments/watcher-config-template.toml - - ../config/watcher-sushiswap-v3/start-job-runner.sh:/app/packages/v3-watcher/start-job-runner.sh + - ../config/common/start-job-runner.sh:/app/packages/v3-watcher/start-job-runner.sh ports: - - "9000:9000" + - "9000" healthcheck: test: ["CMD", "nc", "-vz", "127.0.0.1", "9000"] interval: 20s @@ -61,7 +61,7 @@ services: command: ["bash", "./start-server.sh"] volumes: - ../config/watcher-sushiswap-v3/watcher-config-template.toml:/app/packages/v3-watcher/environments/watcher-config-template.toml - - ../config/watcher-sushiswap-v3/start-server.sh:/app/packages/v3-watcher/start-server.sh + - ../config/common/start-server.sh:/app/packages/v3-watcher/start-server.sh - sushiswap_v3_watcher_gql_logs_data:/app/packages/v3-watcher/gql-logs ports: - "3008" diff --git a/stacks/stack-orchestrator/config/watcher-sushiswap-v2/start-job-runner.sh b/stacks/stack-orchestrator/config/common/start-job-runner.sh similarity index 100% rename from stacks/stack-orchestrator/config/watcher-sushiswap-v2/start-job-runner.sh rename to stacks/stack-orchestrator/config/common/start-job-runner.sh diff --git a/stacks/stack-orchestrator/config/watcher-sushiswap-v2/start-server.sh b/stacks/stack-orchestrator/config/common/start-server.sh similarity index 100% rename from stacks/stack-orchestrator/config/watcher-sushiswap-v2/start-server.sh rename to stacks/stack-orchestrator/config/common/start-server.sh diff --git a/stacks/stack-orchestrator/config/watcher-sushiswap-v3/start-job-runner.sh b/stacks/stack-orchestrator/config/watcher-sushiswap-v3/start-job-runner.sh deleted file mode 100755 index 7a7a83b..0000000 --- a/stacks/stack-orchestrator/config/watcher-sushiswap-v3/start-job-runner.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -set -e -if [ -n "$CERC_SCRIPT_DEBUG" ]; then - set -x -fi -set -u - -echo "Using ETH RPC endpoints ${CERC_ETH_RPC_ENDPOINTS}" - -# Read in the config template TOML file and modify it -WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml) - -# Convert the comma-separated list in CERC_ETH_RPC_ENDPOINTS to a JSON array -RPC_ENDPOINTS_ARRAY=$(echo "$CERC_ETH_RPC_ENDPOINTS" | tr ',' '\n' | awk '{print "\"" $0 "\""}' | paste -sd, - | sed 's/^/[/; s/$/]/') - -WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \ - sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS|${RPC_ENDPOINTS_ARRAY}| ") - -# Write the modified content to a new file -echo "$WATCHER_CONFIG" > environments/local.toml - -echo "Running job-runner..." -DEBUG=vulcanize:* exec node --enable-source-maps dist/job-runner.js diff --git a/stacks/stack-orchestrator/config/watcher-sushiswap-v3/start-server.sh b/stacks/stack-orchestrator/config/watcher-sushiswap-v3/start-server.sh deleted file mode 100755 index 9aaa77e..0000000 --- a/stacks/stack-orchestrator/config/watcher-sushiswap-v3/start-server.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -set -e -if [ -n "$CERC_SCRIPT_DEBUG" ]; then - set -x -fi -set -u - -echo "Using ETH RPC endpoints ${CERC_ETH_RPC_ENDPOINTS}" - -# Read in the config template TOML file and modify it -WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml) - -# Convert the comma-separated list in CERC_ETH_RPC_ENDPOINTS to a JSON array -RPC_ENDPOINTS_ARRAY=$(echo "$CERC_ETH_RPC_ENDPOINTS" | tr ',' '\n' | awk '{print "\"" $0 "\""}' | paste -sd, - | sed 's/^/[/; s/$/]/') - -WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \ - sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS|${RPC_ENDPOINTS_ARRAY}| ") - -# Write the modified content to a new file -echo "$WATCHER_CONFIG" > environments/local.toml - -echo "Running server..." -DEBUG=vulcanize:* exec node --enable-source-maps dist/server.js diff --git a/stacks/stack-orchestrator/stacks/sushiswap-v2/README.md b/stacks/stack-orchestrator/stacks/sushiswap-v2/README.md index 93c58e1..c8acfdc 100644 --- a/stacks/stack-orchestrator/stacks/sushiswap-v2/README.md +++ b/stacks/stack-orchestrator/stacks/sushiswap-v2/README.md @@ -3,7 +3,7 @@ ## Clone the stack repo ```bash -laconic-so fetch-stack git.vdb.to/deep-stack/sushiswap-watcher-ts +laconic-so fetch-stack git.vdb.to/cerc-io/sushiswap-watcher-ts ``` ## Build the container image -- 2.45.2