From 8b0936957d248d8b9f0dd27bbc49d3f527a5c876 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Mon, 4 Mar 2024 10:45:20 +0530 Subject: [PATCH 1/4] Update sushiswap-v3 stack instructions to use deployments --- .../data/stacks/sushiswap-v3/README.md | 72 +++++++++++++------ 1 file changed, 52 insertions(+), 20 deletions(-) diff --git a/stack_orchestrator/data/stacks/sushiswap-v3/README.md b/stack_orchestrator/data/stacks/sushiswap-v3/README.md index 7116a6d9..a95eba84 100644 --- a/stack_orchestrator/data/stacks/sushiswap-v3/README.md +++ b/stack_orchestrator/data/stacks/sushiswap-v3/README.md @@ -16,26 +16,55 @@ laconic-so --stack sushiswap-v3 build-containers ## Deploy -### Configuration - -Create and update an env file to be used in the next step: - - ```bash - # External Filecoin (ETH RPC) endpoint to point the watcher - CERC_ETH_RPC_ENDPOINT= - ``` - -### Deploy the stack +Create a spec file for the deployment: ```bash -laconic-so --stack sushiswap-v3 deploy --cluster sushiswap_v3 --env-file up +laconic-so --stack sushiswap-v3 deploy init --output sushiswap-v3-spec.yml +``` + +### Ports + +Edit `network` in the spec file to map container ports to host ports as required: + +``` +... +network: + ports: + sushiswap-v3-watcher-db: + - '5432' + sushiswap-v3-watcher-job-runner: + - 9000:9000 + sushiswap-v3-watcher-server: + - 127.0.0.1:3008:3008 + - 9001:9001 +``` + +### Create a deployment + +Create a deployment from the spec file: + +```bash +laconic-so --stack sushiswap-v3 deploy create --spec-file sushiswap-v3-spec.yml --deployment-dir sushiswap-v3-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_ENDPOINT=https://example-lotus-endpoint/rpc/v1 +``` + +### Start the deployment + +```bash +laconic-so deployment --dir sushiswap-v3-deployment start ``` * To list down and monitor the running containers: ```bash - laconic-so --stack sushiswap-v3 deploy --cluster sushiswap_v3 ps - # With status docker ps -a @@ -45,18 +74,21 @@ laconic-so --stack sushiswap-v3 deploy --cluster sushiswap_v3 --env-file Date: Mon, 4 Mar 2024 10:58:48 +0530 Subject: [PATCH 2/4] Update merkl-sushiswap-v3 stack instructions to use deployments --- .../data/stacks/merkl-sushiswap-v3/README.md | 91 +++++++++++-------- 1 file changed, 52 insertions(+), 39 deletions(-) diff --git a/stack_orchestrator/data/stacks/merkl-sushiswap-v3/README.md b/stack_orchestrator/data/stacks/merkl-sushiswap-v3/README.md index 4284c2ad..1ba69445 100644 --- a/stack_orchestrator/data/stacks/merkl-sushiswap-v3/README.md +++ b/stack_orchestrator/data/stacks/merkl-sushiswap-v3/README.md @@ -16,26 +16,55 @@ laconic-so --stack merkl-sushiswap-v3 build-containers ## Deploy -### Configuration - -Create and update an env file to be used in the next step: - - ```bash - # External Filecoin (ETH RPC) endpoint to point the watcher - CERC_ETH_RPC_ENDPOINT= - ``` - -### Deploy the stack +Create a spec file for the deployment: ```bash -laconic-so --stack merkl-sushiswap-v3 deploy --cluster merkl_sushiswap_v3 --env-file up +laconic-so --stack merkl-sushiswap-v3 deploy init --output merkl-sushiswap-v3-spec.yml +``` + +### Ports + +Edit `network` in the spec file to map container ports to host ports as required: + +``` +... +network: + ports: + merkl-sushiswap-v3-watcher-db: + - '5432' + merkl-sushiswap-v3-watcher-job-runner: + - 9002:9000 + merkl-sushiswap-v3-watcher-server: + - 127.0.0.1:3007:3008 + - 9003:9001 +``` + +### Create a deployment + +Create a deployment from the spec file: + +```bash +laconic-so --stack merkl-sushiswap-v3 deploy create --spec-file merkl-sushiswap-v3-spec.yml --deployment-dir merkl-sushiswap-v3-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_ENDPOINT=https://example-lotus-endpoint/rpc/v1 +``` + +### Start the deployment + +```bash +laconic-so deployment --dir merkl-sushiswap-v3-deployment start ``` * To list down and monitor the running containers: ```bash - laconic-so --stack merkl-sushiswap-v3 deploy --cluster merkl_sushiswap_v3 ps - # With status docker ps -a @@ -43,39 +72,23 @@ laconic-so --stack merkl-sushiswap-v3 deploy --cluster merkl_sushiswap_v3 --env- docker logs -f ``` -* Open the GQL playground at http://localhost:3007/graphql - - ```graphql - { - _meta { - block { - number - timestamp - } - hasIndexingErrors - } - - factories { - id - poolCount - } - } - ``` - ## Clean up -Stop all the services running in background: +Stop all the merkl-sushiswap-v3 services running in background: ```bash -laconic-so --stack merkl-sushiswap-v3 deploy --cluster merkl_sushiswap_v3 down +# Only stop the docker containers +laconic-so deployment --dir merkl-sushiswap-v3-deployment stop + +# Run 'start' to restart the deployment ``` -Clear volumes created by this stack: +To stop all the merkl-sushiswap-v3 services and also delete data: ```bash -# List all relevant volumes -docker volume ls -q --filter "name=merkl_sushiswap_v3" +# Stop the docker containers +laconic-so deployment --dir merkl-sushiswap-v3-deployment stop --delete-volumes -# Remove all the listed volumes -docker volume rm $(docker volume ls -q --filter "name=merkl_sushiswap_v3") +# Remove deployment directory (deployment will have to be recreated for a re-run) +rm -r merkl-sushiswap-v3-deployment ``` -- 2.45.2 From 14be98f93496aba682633db69d8fb49fa3aa4117 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 6 Mar 2024 10:54:51 +0530 Subject: [PATCH 3/4] Use latest watcher releases --- stack_orchestrator/data/stacks/merkl-sushiswap-v3/stack.yml | 2 +- stack_orchestrator/data/stacks/sushiswap-subgraph/README.md | 2 +- stack_orchestrator/data/stacks/sushiswap-v3/stack.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stack_orchestrator/data/stacks/merkl-sushiswap-v3/stack.yml b/stack_orchestrator/data/stacks/merkl-sushiswap-v3/stack.yml index 847df33c..c080d324 100644 --- a/stack_orchestrator/data/stacks/merkl-sushiswap-v3/stack.yml +++ b/stack_orchestrator/data/stacks/merkl-sushiswap-v3/stack.yml @@ -2,7 +2,7 @@ version: "1.0" name: merkl-sushiswap-v3 description: "SushiSwap v3 watcher stack" repos: - - github.com/cerc-io/merkl-sushiswap-v3-watcher-ts@v0.1.6 + - github.com/cerc-io/merkl-sushiswap-v3-watcher-ts@v0.1.7 containers: - cerc/watcher-merkl-sushiswap-v3 pods: diff --git a/stack_orchestrator/data/stacks/sushiswap-subgraph/README.md b/stack_orchestrator/data/stacks/sushiswap-subgraph/README.md index 52433a9c..fbbd3215 100644 --- a/stack_orchestrator/data/stacks/sushiswap-subgraph/README.md +++ b/stack_orchestrator/data/stacks/sushiswap-subgraph/README.md @@ -55,7 +55,7 @@ ports: Create deployment: ```bash -laconic-so deploy create --spec-file sushiswap-subgraph-spec.yml --deployment-dir sushiswap-subgraph-deployment +laconic-so --stack sushiswap-subgraph deploy create --spec-file sushiswap-subgraph-spec.yml --deployment-dir sushiswap-subgraph-deployment ``` ## Start the stack diff --git a/stack_orchestrator/data/stacks/sushiswap-v3/stack.yml b/stack_orchestrator/data/stacks/sushiswap-v3/stack.yml index 12103d62..248cb381 100644 --- a/stack_orchestrator/data/stacks/sushiswap-v3/stack.yml +++ b/stack_orchestrator/data/stacks/sushiswap-v3/stack.yml @@ -2,7 +2,7 @@ version: "1.0" name: sushiswap-v3 description: "SushiSwap v3 watcher stack" repos: - - github.com/cerc-io/sushiswap-v3-watcher-ts@v0.1.6 + - github.com/cerc-io/sushiswap-v3-watcher-ts@v0.1.7 containers: - cerc/watcher-sushiswap-v3 pods: -- 2.45.2 From 36e67c64e650368104fa59d7c26e79034b749f7a Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 6 Mar 2024 11:53:57 +0530 Subject: [PATCH 4/4] Add example GQL queries --- .../data/stacks/merkl-sushiswap-v3/README.md | 20 +++++++++++++++++++ .../data/stacks/sushiswap-v3/README.md | 20 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/stack_orchestrator/data/stacks/merkl-sushiswap-v3/README.md b/stack_orchestrator/data/stacks/merkl-sushiswap-v3/README.md index 1ba69445..ddd8ecf6 100644 --- a/stack_orchestrator/data/stacks/merkl-sushiswap-v3/README.md +++ b/stack_orchestrator/data/stacks/merkl-sushiswap-v3/README.md @@ -72,6 +72,26 @@ laconic-so deployment --dir merkl-sushiswap-v3-deployment start docker logs -f ``` +* Open the GQL playground at http://localhost:3007/graphql + + ```graphql + # Example query + { + _meta { + block { + number + timestamp + } + hasIndexingErrors + } + + factories { + id + poolCount + } + } + ``` + ## Clean up Stop all the merkl-sushiswap-v3 services running in background: diff --git a/stack_orchestrator/data/stacks/sushiswap-v3/README.md b/stack_orchestrator/data/stacks/sushiswap-v3/README.md index a95eba84..6bcbb54c 100644 --- a/stack_orchestrator/data/stacks/sushiswap-v3/README.md +++ b/stack_orchestrator/data/stacks/sushiswap-v3/README.md @@ -72,6 +72,26 @@ laconic-so deployment --dir sushiswap-v3-deployment start docker logs -f ``` +* Open the GQL playground at http://localhost:3008/graphql + + ```graphql + # Example query + { + _meta { + block { + number + timestamp + } + hasIndexingErrors + } + + factories { + id + poolCount + } + } + ``` + ## Clean up Stop all the sushiswap-v3 services running in background: -- 2.45.2