From aedecdd074334d51b2ab1eb5fc3be66041404c44 Mon Sep 17 00:00:00 2001 From: Nabarun Date: Thu, 31 Aug 2023 15:34:41 +0530 Subject: [PATCH 1/2] Add steps to set environment variable in deployed stack --- app/data/stacks/sushiswap-subgraph/README.md | 42 ++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/app/data/stacks/sushiswap-subgraph/README.md b/app/data/stacks/sushiswap-subgraph/README.md index 8dda9d26..52433a9c 100644 --- a/app/data/stacks/sushiswap-subgraph/README.md +++ b/app/data/stacks/sushiswap-subgraph/README.md @@ -113,6 +113,48 @@ http://127.0.0.1:8000/subgraphs/name/sushiswap/blocks/graphql http://127.0.0.1:8000/subgraphs/name/sushiswap/v3-filecoin/graphql ``` +## Set environment variables + +* The graph-node environment variable `ETHEREUM_REORG_THRESHOLD` can be set in the deployment compose file + ```bash + $ cat sushiswap-subgraph-deployment/compose/docker-compose-graph-node.yml + services: + graph-node: + image: cerc/graph-node:local + ... + environment: + ... + GRAPH_LOG: debug + ETHEREUM_REORG_THRESHOLD: 16 + ``` + Change `ETHEREUM_REORG_THRESHOLD` to desired value + + * To restart graph-node with updated values, we need to restart only graph-node compose services + * Comment `sushiswap-subgraph-v3` pod in stack.yml so that subgraphs are not deployed again + ```bash + $ cat sushiswap-subgraph-deployment/stack.yml + version: "1.0" + name: sushiswap-subgraph + ... + pods: + - graph-node + # - sushiswap-subgraph-v3 + ``` + * Stop the stack first + ```bash + laconic-so deployment --dir sushiswap-subgraph-deployment stop + ``` + * Start the stack again (will not start `sushiswap-subgraph-v3` pod) + ``` + laconic-so deployment --dir sushiswap-subgraph-deployment start + ``` + * To check if environment variable has been updated in graph-node container + ```bash + $ laconic-so deployment --dir sushiswap-subgraph-deployment exec graph-node bash + root@dc4d3abe1615:/# echo $ETHEREUM_REORG_THRESHOLD + 16 + ``` + ## Clean up Stop all the services running in background run: -- 2.45.2 From 0e23c0b27f4ec790a2b7a4ef211f1d3c80719c04 Mon Sep 17 00:00:00 2001 From: Nabarun Date: Thu, 31 Aug 2023 17:58:12 +0530 Subject: [PATCH 2/2] Change ETHEREUM_REORG_THRESHOLD value to 3 --- app/data/compose/docker-compose-graph-node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/data/compose/docker-compose-graph-node.yml b/app/data/compose/docker-compose-graph-node.yml index 3dd0705c..278af02a 100644 --- a/app/data/compose/docker-compose-graph-node.yml +++ b/app/data/compose/docker-compose-graph-node.yml @@ -20,7 +20,7 @@ services: postgres_db: graph-node ethereum: ${NETWORK:-filecoin}:${ETH_RPC_ENDPOINT:-https://archive.lotus.vdb.to/rpc/v1} GRAPH_LOG: debug - ETHEREUM_REORG_THRESHOLD: 16 + ETHEREUM_REORG_THRESHOLD: 3 ports: - "8000" - "8001" -- 2.45.2