From 30d4b311e129f4aeaf0e7ac2431754ebda88c827 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Thu, 13 Jun 2024 15:40:47 +0530 Subject: [PATCH] Add v3 watcher stack instructions --- .../stacks/sushiswap-v3/README.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 stacks/stack-orchestrator/stacks/sushiswap-v3/README.md diff --git a/stacks/stack-orchestrator/stacks/sushiswap-v3/README.md b/stacks/stack-orchestrator/stacks/sushiswap-v3/README.md new file mode 100644 index 0000000..db8ffe4 --- /dev/null +++ b/stacks/stack-orchestrator/stacks/sushiswap-v3/README.md @@ -0,0 +1,103 @@ +# SushiSwap v3 Watcher + +## Clone the stack repo + +```bash +laconic-so --stack sushiswap-v3 setup-repositories --git-ssh --pull +``` + +## Build the container image + +```bash +laconic-so --stack sushiswap-v3 build-containers +``` +## Create a spec file for the deployment + +```bash +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: + +```yml +... +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 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_ENDPOINTS=https://example-lotus-endpoint-1/rpc/v1,https://example-lotus-endpoint-2/rpc/v1 +``` + +## Start the deployment + +```bash +laconic-so deployment --dir sushiswap-v3-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-v3 services running in background: + +```bash +# Only stop the docker containers +laconic-so deployment --dir sushiswap-v3-deployment stop + +# Run 'start' to restart the deployment +``` + +To stop all the sushiswap-v3 services and also delete data: + +```bash +# Stop the docker containers +laconic-so deployment --dir sushiswap-v3-deployment stop --delete-volumes + +# Remove deployment directory (deployment will have to be recreated for a re-run) +rm -r sushiswap-v3-deployment +``` \ No newline at end of file