From 5c5072d40a2e5b184b04c614c9794eb86015861c Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 14:30:54 +0300 Subject: [PATCH 01/19] workflow: tweak test-local-subgraph --- .github/workflows/call.test-local-subgraph.yml | 8 -------- packages/subgraph/.gitignore | 1 + packages/subgraph/docker-compose.yml | 2 -- packages/subgraph/tasks/setup-graph-node.sh | 0 4 files changed, 1 insertion(+), 10 deletions(-) mode change 100644 => 100755 packages/subgraph/tasks/setup-graph-node.sh diff --git a/.github/workflows/call.test-local-subgraph.yml b/.github/workflows/call.test-local-subgraph.yml index eea711bd78..59968fa40a 100644 --- a/.github/workflows/call.test-local-subgraph.yml +++ b/.github/workflows/call.test-local-subgraph.yml @@ -103,17 +103,9 @@ jobs: run: yarn prepare-local working-directory: ${{ env.subgraph-working-directory }} - - name: Run setup-graph-node - if: steps.base.outputs.cache-hit != 'true' - run: | - chmod +x ./tasks/setup-graph-node.sh - ./tasks/setup-graph-node.sh - working-directory: ${{ env.subgraph-working-directory }} - - name: Docker compose if: steps.base.outputs.cache-hit != 'true' run: | - docker rm subgraph_graph-node_1 || true docker compose up & working-directory: ${{ env.subgraph-working-directory }} diff --git a/packages/subgraph/.gitignore b/packages/subgraph/.gitignore index 07d42023ea..0bb119fd75 100644 --- a/packages/subgraph/.gitignore +++ b/packages/subgraph/.gitignore @@ -1,3 +1,4 @@ +/data /cache/ build/ generated/ diff --git a/packages/subgraph/docker-compose.yml b/packages/subgraph/docker-compose.yml index 7848978088..87ef676f04 100644 --- a/packages/subgraph/docker-compose.yml +++ b/packages/subgraph/docker-compose.yml @@ -11,8 +11,6 @@ services: depends_on: - ipfs - postgres - extra_hosts: - - host.docker.internal:host-gateway environment: postgres_host: postgres postgres_user: graph-node diff --git a/packages/subgraph/tasks/setup-graph-node.sh b/packages/subgraph/tasks/setup-graph-node.sh old mode 100644 new mode 100755 From fada7ee408169b72a466b4809dedc20d05a1cc0e Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 14:36:52 +0300 Subject: [PATCH 02/19] make some changes to subgraph package --- .github/workflows/call.test-sdk-core.yml | 1 - .../call.test-subgraph-on-previous-sdk-core-versions.yml | 1 - packages/subgraph/default.nix | 4 +++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/call.test-sdk-core.yml b/.github/workflows/call.test-sdk-core.yml index b6ffed2ffb..8a97a704d0 100644 --- a/.github/workflows/call.test-sdk-core.yml +++ b/.github/workflows/call.test-sdk-core.yml @@ -121,7 +121,6 @@ jobs: - name: Run setup-graph-node if: steps.base.outputs.cache-hit != 'true' run: | - chmod +x ./tasks/setup-graph-node.sh ./tasks/setup-graph-node.sh working-directory: ${{ env.subgraph-working-directory }} diff --git a/.github/workflows/call.test-subgraph-on-previous-sdk-core-versions.yml b/.github/workflows/call.test-subgraph-on-previous-sdk-core-versions.yml index e13da59427..332a52f23c 100644 --- a/.github/workflows/call.test-subgraph-on-previous-sdk-core-versions.yml +++ b/.github/workflows/call.test-subgraph-on-previous-sdk-core-versions.yml @@ -64,7 +64,6 @@ jobs: - name: "Run setup-graph-node" run: | - chmod +x ./tasks/setup-graph-node.sh ./tasks/setup-graph-node.sh working-directory: ./packages/subgraph diff --git a/packages/subgraph/default.nix b/packages/subgraph/default.nix index aa4a2cc1c1..63115212ce 100644 --- a/packages/subgraph/default.nix +++ b/packages/subgraph/default.nix @@ -11,12 +11,14 @@ includedFiles = [ ./package.json ./config - ./matchstick.yaml ./schema.graphql ./tsconfig.json ./types ./src ./scripts + # for testing + ./docker-compose.yml + ./matchstick.yaml ./tests ]; }; From 33c6d67f90e941af160720ac138a7f2288bbc5c7 Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 14:44:46 +0300 Subject: [PATCH 03/19] fix build --- .github/workflows/call.test-local-subgraph.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/call.test-local-subgraph.yml b/.github/workflows/call.test-local-subgraph.yml index 59968fa40a..3c69428ebd 100644 --- a/.github/workflows/call.test-local-subgraph.yml +++ b/.github/workflows/call.test-local-subgraph.yml @@ -103,10 +103,16 @@ jobs: run: yarn prepare-local working-directory: ${{ env.subgraph-working-directory }} + - name: Run setup-graph-node + if: steps.base.outputs.cache-hit != 'true' + run: | + ./tasks/setup-graph-node.sh + working-directory: ${{ env.subgraph-working-directory }} + - name: Docker compose if: steps.base.outputs.cache-hit != 'true' run: | - docker compose up & + docker compose up --force-recreate & working-directory: ${{ env.subgraph-working-directory }} - name: Run subgraph integration test suite From b38cae3ecd5b2c1f3b4b2bd20e2066aa7c31b577 Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 14:55:49 +0300 Subject: [PATCH 04/19] push a little --- packages/subgraph/default.nix | 1 + packages/subgraph/tasks/setup-graph-node.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/subgraph/default.nix b/packages/subgraph/default.nix index 63115212ce..9e528f88da 100644 --- a/packages/subgraph/default.nix +++ b/packages/subgraph/default.nix @@ -20,6 +20,7 @@ ./docker-compose.yml ./matchstick.yaml ./tests + ./tasks ]; }; } diff --git a/packages/subgraph/tasks/setup-graph-node.sh b/packages/subgraph/tasks/setup-graph-node.sh index f7758a3d98..9e1f1e91f0 100755 --- a/packages/subgraph/tasks/setup-graph-node.sh +++ b/packages/subgraph/tasks/setup-graph-node.sh @@ -32,7 +32,7 @@ HOST_IP=$(docker inspect "$CONTAINER_ID" | jq -r .[0].NetworkSettings.Networks[] echo "Host IP: $HOST_IP" # Inject the host IP into docker-compose.yml -sed -i -e "s/host.docker.internal/$HOST_IP/g" docker-compose.yml +#sed -i -e "s/host.docker.internal/$HOST_IP/g" docker-compose.yml function stop_graph_node { # Ensure graph-node is stopped From 3a53184e6dcc8198bd588afbfdb80d1660576c94 Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 16:15:51 +0300 Subject: [PATCH 05/19] fix build --- .github/workflows/call.test-local-subgraph.yml | 10 +++++----- packages/subgraph/.gitignore | 1 - packages/subgraph/docker-compose.yml | 9 ++++++++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/call.test-local-subgraph.yml b/.github/workflows/call.test-local-subgraph.yml index 3c69428ebd..5b7fd3a5dc 100644 --- a/.github/workflows/call.test-local-subgraph.yml +++ b/.github/workflows/call.test-local-subgraph.yml @@ -82,17 +82,17 @@ jobs: run: yarn build working-directory: ./packages/ethereum-contracts - - name: Start hardhat node - if: steps.base.outputs.cache-hit != 'true' - run: ./tasks/startHardhatNode.sh start - working-directory: ${{ env.sdk-core-working-directory }} - - name: Build SDK core if: steps.base.outputs.cache-hit != 'true' # build sdk-core because subgraph tests use sdk-core run: yarn build working-directory: ${{ env.sdk-core-working-directory }} + - name: Start hardhat node + if: steps.base.outputs.cache-hit != 'true' + run: ./tasks/startHardhatNode.sh start + working-directory: ${{ env.sdk-core-working-directory }} + - name: Deploy framework and tokens if: steps.base.outputs.cache-hit != 'true' run: npx hardhat run dev-scripts/run-deploy-contracts-and-token.js --network localhost diff --git a/packages/subgraph/.gitignore b/packages/subgraph/.gitignore index 0bb119fd75..07d42023ea 100644 --- a/packages/subgraph/.gitignore +++ b/packages/subgraph/.gitignore @@ -1,4 +1,3 @@ -/data /cache/ build/ generated/ diff --git a/packages/subgraph/docker-compose.yml b/packages/subgraph/docker-compose.yml index 87ef676f04..0e5c5f6e70 100644 --- a/packages/subgraph/docker-compose.yml +++ b/packages/subgraph/docker-compose.yml @@ -1,5 +1,11 @@ version: "3" services: + docker-host: + image: qoomon/docker-host + cap_add: [ 'NET_ADMIN', 'NET_RAW' ] + restart: on-failure + environment: + - PORTS=8545 graph-node: image: graphprotocol/graph-node:v0.35.0 ports: @@ -9,6 +15,7 @@ services: - "8030:8030" - "8040:8040" depends_on: + - docker-host - ipfs - postgres environment: @@ -17,7 +24,7 @@ services: postgres_pass: let-me-in postgres_db: graph-node ipfs: "ipfs:5001" - ethereum: "mainnet:http://host.docker.internal:8545" + ethereum: "mainnet:http://docker-host:8545" GRAPH_LOG: info ipfs: image: ipfs/go-ipfs:v0.4.23 From a1e3bff3ca160e85f26a93746ad3903d03fedf28 Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 16:44:14 +0300 Subject: [PATCH 06/19] fix build --- packages/subgraph/docker-compose.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/subgraph/docker-compose.yml b/packages/subgraph/docker-compose.yml index 0e5c5f6e70..fe1c1f4912 100644 --- a/packages/subgraph/docker-compose.yml +++ b/packages/subgraph/docker-compose.yml @@ -1,11 +1,7 @@ -version: "3" services: docker-host: image: qoomon/docker-host cap_add: [ 'NET_ADMIN', 'NET_RAW' ] - restart: on-failure - environment: - - PORTS=8545 graph-node: image: graphprotocol/graph-node:v0.35.0 ports: From 8d793f6b4f12a1b73abca969134c2cc62f4538f0 Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 16:55:12 +0300 Subject: [PATCH 07/19] fix build --- .github/workflows/call.test-local-subgraph.yml | 10 +++++----- packages/subgraph/docker-compose.yml | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/call.test-local-subgraph.yml b/.github/workflows/call.test-local-subgraph.yml index 5b7fd3a5dc..117d6f36c5 100644 --- a/.github/workflows/call.test-local-subgraph.yml +++ b/.github/workflows/call.test-local-subgraph.yml @@ -103,11 +103,11 @@ jobs: run: yarn prepare-local working-directory: ${{ env.subgraph-working-directory }} - - name: Run setup-graph-node - if: steps.base.outputs.cache-hit != 'true' - run: | - ./tasks/setup-graph-node.sh - working-directory: ${{ env.subgraph-working-directory }} + # - name: Run setup-graph-node + # if: steps.base.outputs.cache-hit != 'true' + # run: | + # ./tasks/setup-graph-node.sh + # working-directory: ${{ env.subgraph-working-directory }} - name: Docker compose if: steps.base.outputs.cache-hit != 'true' diff --git a/packages/subgraph/docker-compose.yml b/packages/subgraph/docker-compose.yml index fe1c1f4912..ae595ddef6 100644 --- a/packages/subgraph/docker-compose.yml +++ b/packages/subgraph/docker-compose.yml @@ -1,7 +1,4 @@ services: - docker-host: - image: qoomon/docker-host - cap_add: [ 'NET_ADMIN', 'NET_RAW' ] graph-node: image: graphprotocol/graph-node:v0.35.0 ports: @@ -14,13 +11,15 @@ services: - docker-host - ipfs - postgres + extra_hosts: + - host.docker.internal:host-gateway environment: postgres_host: postgres postgres_user: graph-node postgres_pass: let-me-in postgres_db: graph-node ipfs: "ipfs:5001" - ethereum: "mainnet:http://docker-host:8545" + ethereum: "mainnet:http://host.docker.internal:8545" GRAPH_LOG: info ipfs: image: ipfs/go-ipfs:v0.4.23 From 872f98dc86fe826dbf04b156f0ede1ca97b98b9e Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 17:43:04 +0300 Subject: [PATCH 08/19] fix build --- .github/workflows/call.test-local-subgraph.yml | 6 ++++-- packages/subgraph/docker-compose.yml | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/call.test-local-subgraph.yml b/.github/workflows/call.test-local-subgraph.yml index 117d6f36c5..e578711070 100644 --- a/.github/workflows/call.test-local-subgraph.yml +++ b/.github/workflows/call.test-local-subgraph.yml @@ -112,10 +112,12 @@ jobs: - name: Docker compose if: steps.base.outputs.cache-hit != 'true' run: | - docker compose up --force-recreate & + docker compose up --force-recreate --detach working-directory: ${{ env.subgraph-working-directory }} - name: Run subgraph integration test suite if: steps.base.outputs.cache-hit != 'true' - run: yarn test --network localhost + run: | + export DOCKER_HOST_GATEWAY_IP=$(docker network inspect bridge | jq -r '.[0].IPAM.Config[].Gateway) + yarn test --network localhost working-directory: ${{ env.subgraph-working-directory }} diff --git a/packages/subgraph/docker-compose.yml b/packages/subgraph/docker-compose.yml index ae595ddef6..770592d18d 100644 --- a/packages/subgraph/docker-compose.yml +++ b/packages/subgraph/docker-compose.yml @@ -8,7 +8,6 @@ services: - "8030:8030" - "8040:8040" depends_on: - - docker-host - ipfs - postgres extra_hosts: @@ -19,7 +18,7 @@ services: postgres_pass: let-me-in postgres_db: graph-node ipfs: "ipfs:5001" - ethereum: "mainnet:http://host.docker.internal:8545" + ethereum: "mainnet:http://${DOCKER_HOST_GATEWAY_IP}:8545" GRAPH_LOG: info ipfs: image: ipfs/go-ipfs:v0.4.23 From ef93b2cfe7bd75ee348fdd42f43c5690a7b2e320 Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 17:50:47 +0300 Subject: [PATCH 09/19] fix build --- .github/workflows/call.test-local-subgraph.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/call.test-local-subgraph.yml b/.github/workflows/call.test-local-subgraph.yml index e578711070..d6b7554324 100644 --- a/.github/workflows/call.test-local-subgraph.yml +++ b/.github/workflows/call.test-local-subgraph.yml @@ -118,6 +118,6 @@ jobs: - name: Run subgraph integration test suite if: steps.base.outputs.cache-hit != 'true' run: | - export DOCKER_HOST_GATEWAY_IP=$(docker network inspect bridge | jq -r '.[0].IPAM.Config[].Gateway) + export DOCKER_HOST_GATEWAY_IP=$(docker network inspect bridge | jq -r '.[0].IPAM.Config[].Gateway') yarn test --network localhost working-directory: ${{ env.subgraph-working-directory }} From 500d5670723e13787f52aa9991444b873e8146e9 Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 18:01:36 +0300 Subject: [PATCH 10/19] fix build --- .github/workflows/call.test-local-subgraph.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/call.test-local-subgraph.yml b/.github/workflows/call.test-local-subgraph.yml index d6b7554324..467f502b33 100644 --- a/.github/workflows/call.test-local-subgraph.yml +++ b/.github/workflows/call.test-local-subgraph.yml @@ -103,11 +103,11 @@ jobs: run: yarn prepare-local working-directory: ${{ env.subgraph-working-directory }} - # - name: Run setup-graph-node - # if: steps.base.outputs.cache-hit != 'true' - # run: | - # ./tasks/setup-graph-node.sh - # working-directory: ${{ env.subgraph-working-directory }} + - name: Run setup-graph-node + if: steps.base.outputs.cache-hit != 'true' + run: | + ./tasks/setup-graph-node.sh + working-directory: ${{ env.subgraph-working-directory }} - name: Docker compose if: steps.base.outputs.cache-hit != 'true' From c816dadcfdbd5fb720693b98b51137b5db7999c1 Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 18:19:42 +0300 Subject: [PATCH 11/19] fix build --- .github/workflows/call.test-local-subgraph.yml | 8 ++++---- packages/subgraph/docker-compose.yml | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/call.test-local-subgraph.yml b/.github/workflows/call.test-local-subgraph.yml index 467f502b33..5514819277 100644 --- a/.github/workflows/call.test-local-subgraph.yml +++ b/.github/workflows/call.test-local-subgraph.yml @@ -112,12 +112,12 @@ jobs: - name: Docker compose if: steps.base.outputs.cache-hit != 'true' run: | - docker compose up --force-recreate --detach + export DOCKER_HOST_GATEWAY_IP=$(docker network inspect subgraph_default | jq -r '.[0].IPAM.Config[].Gateway') + docker compose up & + sleep 5 working-directory: ${{ env.subgraph-working-directory }} - name: Run subgraph integration test suite if: steps.base.outputs.cache-hit != 'true' - run: | - export DOCKER_HOST_GATEWAY_IP=$(docker network inspect bridge | jq -r '.[0].IPAM.Config[].Gateway') - yarn test --network localhost + run: yarn test --network localhost working-directory: ${{ env.subgraph-working-directory }} diff --git a/packages/subgraph/docker-compose.yml b/packages/subgraph/docker-compose.yml index 770592d18d..3c96686641 100644 --- a/packages/subgraph/docker-compose.yml +++ b/packages/subgraph/docker-compose.yml @@ -10,8 +10,6 @@ services: depends_on: - ipfs - postgres - extra_hosts: - - host.docker.internal:host-gateway environment: postgres_host: postgres postgres_user: graph-node From 8141e12019fc3ba6e2e4f99cecf0ac39f3866da3 Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 19:46:00 +0300 Subject: [PATCH 12/19] fix build --- .../workflows/call.test-local-subgraph.yml | 8 +----- packages/subgraph/docker-compose.yml | 2 +- packages/subgraph/tasks/setup-graph-node.sh | 26 +++---------------- 3 files changed, 5 insertions(+), 31 deletions(-) mode change 100755 => 100644 packages/subgraph/tasks/setup-graph-node.sh diff --git a/.github/workflows/call.test-local-subgraph.yml b/.github/workflows/call.test-local-subgraph.yml index 5514819277..3395a111cb 100644 --- a/.github/workflows/call.test-local-subgraph.yml +++ b/.github/workflows/call.test-local-subgraph.yml @@ -103,16 +103,10 @@ jobs: run: yarn prepare-local working-directory: ${{ env.subgraph-working-directory }} - - name: Run setup-graph-node - if: steps.base.outputs.cache-hit != 'true' - run: | - ./tasks/setup-graph-node.sh - working-directory: ${{ env.subgraph-working-directory }} - - name: Docker compose if: steps.base.outputs.cache-hit != 'true' run: | - export DOCKER_HOST_GATEWAY_IP=$(docker network inspect subgraph_default | jq -r '.[0].IPAM.Config[].Gateway') + source ./tasks/setup-graph-node.sh docker compose up & sleep 5 working-directory: ${{ env.subgraph-working-directory }} diff --git a/packages/subgraph/docker-compose.yml b/packages/subgraph/docker-compose.yml index 3c96686641..2950fc4e79 100644 --- a/packages/subgraph/docker-compose.yml +++ b/packages/subgraph/docker-compose.yml @@ -16,7 +16,7 @@ services: postgres_pass: let-me-in postgres_db: graph-node ipfs: "ipfs:5001" - ethereum: "mainnet:http://${DOCKER_HOST_GATEWAY_IP}:8545" + ethereum: "mainnet:http://${DOCKER_HOST_IP}:8545" GRAPH_LOG: info ipfs: image: ipfs/go-ipfs:v0.4.23 diff --git a/packages/subgraph/tasks/setup-graph-node.sh b/packages/subgraph/tasks/setup-graph-node.sh old mode 100755 new mode 100644 index 9e1f1e91f0..fa9a87065b --- a/packages/subgraph/tasks/setup-graph-node.sh +++ b/packages/subgraph/tasks/setup-graph-node.sh @@ -17,26 +17,6 @@ if ! which jq >/dev/null 2>&1; then exit 1 fi -# Create the graph-node container -docker compose up --no-start graph-node - -# Start graph-node so we can inspect it -docker compose start graph-node - -# Identify the container ID -CONTAINER_ID=$(docker container ls | grep graph-node | cut -d' ' -f1) - -# Inspect the container to identify the host IP address -HOST_IP=$(docker inspect "$CONTAINER_ID" | jq -r .[0].NetworkSettings.Networks[].Gateway) - -echo "Host IP: $HOST_IP" - -# Inject the host IP into docker-compose.yml -#sed -i -e "s/host.docker.internal/$HOST_IP/g" docker-compose.yml - -function stop_graph_node { - # Ensure graph-node is stopped - docker compose stop graph-node -} - -trap stop_graph_node EXIT +docker compose up --no-start +DOCKER_HOST_IP=$(docker network inspect subgraph_default | jq -r '.[0].IPAM.Config[].Gateway') +export DOCKER_HOST_IP From 05428e375f3a6537ba744842d981623962be4ffd Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 20:09:58 +0300 Subject: [PATCH 13/19] try node20 --- .github/workflows/call.test-local-subgraph.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/call.test-local-subgraph.yml b/.github/workflows/call.test-local-subgraph.yml index 3395a111cb..cf79dafe69 100644 --- a/.github/workflows/call.test-local-subgraph.yml +++ b/.github/workflows/call.test-local-subgraph.yml @@ -5,7 +5,7 @@ on: env: # FIXME: subgraph test fails with node20 - DEV_SHELL_NAME: ci-node18 + DEV_SHELL_NAME: ci-node20 jobs: subgraph-unit-tests: From 94e970ffd9d042432c90f2ade75850f1e213d868 Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 20:12:23 +0300 Subject: [PATCH 14/19] try node20 --- .github/workflows/call.test-local-subgraph.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/call.test-local-subgraph.yml b/.github/workflows/call.test-local-subgraph.yml index cf79dafe69..95f0c202c5 100644 --- a/.github/workflows/call.test-local-subgraph.yml +++ b/.github/workflows/call.test-local-subgraph.yml @@ -27,7 +27,7 @@ jobs: uses: ./.github/actions/setup-workflow-base with: package-name: subgraph - cache-key-prefix: subgraph-unit-tests- + cache-key-prefix: subgraph-unit-tests-${{ env.DEV_SHELL_NAME }}- dev-shell-name: ${{ env.DEV_SHELL_NAME }} - name: Install dependencies @@ -70,7 +70,7 @@ jobs: uses: ./.github/actions/setup-workflow-base with: package-name: subgraph - cache-key-prefix: subgraph-integration-tests- + cache-key-prefix: subgraph-integration-tests-${{ env.DEV_SHELL_NAME }}- dev-shell-name: ${{ env.DEV_SHELL_NAME }} - name: Install dependencies From c587f661aefcb5faf8f66e9d10d14614a2c10ba6 Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 20:23:06 +0300 Subject: [PATCH 15/19] resolve cross-fetch to ^4.0.0 to support node 20+ --- package.json | 3 ++- yarn.lock | 53 ++++------------------------------------------------ 2 files changed, 6 insertions(+), 50 deletions(-) diff --git a/package.json b/package.json index 4fa3381846..427e96d9d2 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,8 @@ "web3": "^1.10.4" }, "resolutions": { - "mocha": "^10.2.0" + "mocha": "^10.2.0", + "cross-fetch": "^4.0.0" }, "workspaces": { "packages": [ diff --git a/yarn.lock b/yarn.lock index 5eea612513..1b89030f9c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7578,22 +7578,7 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -cross-fetch@^2.1.0: - version "2.2.6" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.6.tgz#2ef0bb39a24ac034787965c457368a28730e220a" - integrity sha512-9JZz+vXCmfKUZ68zAptS7k4Nu8e2qcibe7WVZYps7sAgk5R8GYTc+T1WR0v1rlP9HxgARmOX1UTIJZFytajpNA== - dependencies: - node-fetch "^2.6.7" - whatwg-fetch "^2.0.4" - -cross-fetch@^3.1.4, cross-fetch@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" - integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== - dependencies: - node-fetch "2.6.7" - -cross-fetch@^4.0.0: +cross-fetch@^2.1.0, cross-fetch@^3.1.4, cross-fetch@^3.1.5, cross-fetch@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-4.0.0.tgz#f037aef1580bb3a1a35164ea2a848ba81b445983" integrity sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g== @@ -17264,7 +17249,7 @@ string-format@^2.0.0: resolved "https://registry.yarnpkg.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b" integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA== -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -17282,15 +17267,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -17382,7 +17358,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -17410,13 +17386,6 @@ strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -19954,11 +19923,6 @@ websocket@^1.0.32: utf-8-validate "^5.0.2" yaeti "^0.0.6" -whatwg-fetch@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" - integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== - whatwg-mimetype@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz#5fa1a7623867ff1af6ca3dc72ad6b8a4208beba7" @@ -20084,7 +20048,7 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -20110,15 +20074,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From ed9ff5db72ee2aeee85e028f2a0c7a2dae8e3fe6 Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 20:35:03 +0300 Subject: [PATCH 16/19] use node20 for sdk-core testing --- .github/workflows/call.test-sdk-core.yml | 13 +++---------- ....test-subgraph-on-previous-sdk-core-versions.yml | 7 +------ 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/call.test-sdk-core.yml b/.github/workflows/call.test-sdk-core.yml index 8a97a704d0..df087f624b 100644 --- a/.github/workflows/call.test-sdk-core.yml +++ b/.github/workflows/call.test-sdk-core.yml @@ -29,10 +29,9 @@ jobs: id: set-matrix run: | if [ "${{ inputs.run-coverage-tests }}" == "true" ];then - echo "matrix={\"node-version\": [18]}" >> "$GITHUB_OUTPUT" + echo "matrix={\"node-version\": [20]}" >> "$GITHUB_OUTPUT" else - # FIXME: subgraph test fails with node20 - echo "matrix={\"node-version\": [18]}" >> "$GITHUB_OUTPUT" + echo "matrix={\"node-version\": [18, 20]}" >> "$GITHUB_OUTPUT" fi test-sdk-core: @@ -118,16 +117,10 @@ jobs: run: yarn prepare-local working-directory: ${{ env.subgraph-working-directory }} - - name: Run setup-graph-node - if: steps.base.outputs.cache-hit != 'true' - run: | - ./tasks/setup-graph-node.sh - working-directory: ${{ env.subgraph-working-directory }} - - name: Docker compose if: steps.base.outputs.cache-hit != 'true' run: | - docker rm subgraph_graph-node_1 || true + source ./tasks/setup-graph-node.sh docker compose up & working-directory: ${{ env.subgraph-working-directory }} diff --git a/.github/workflows/call.test-subgraph-on-previous-sdk-core-versions.yml b/.github/workflows/call.test-subgraph-on-previous-sdk-core-versions.yml index 332a52f23c..a1a62f0896 100644 --- a/.github/workflows/call.test-subgraph-on-previous-sdk-core-versions.yml +++ b/.github/workflows/call.test-subgraph-on-previous-sdk-core-versions.yml @@ -62,14 +62,9 @@ jobs: run: yarn prepare-local working-directory: ./packages/subgraph - - name: "Run setup-graph-node" - run: | - ./tasks/setup-graph-node.sh - working-directory: ./packages/subgraph - - name: "Docker compose" run: | - docker rm subgraph_graph-node_1 || true + source ./tasks/setup-graph-node.sh docker compose up & working-directory: ./packages/subgraph From 3c858dc3d89e4523fbdf8eac45ec8e9dcafc6f57 Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 20:52:21 +0300 Subject: [PATCH 17/19] clean up --- .github/workflows/call.test-ethereum-contracts.yml | 5 ++--- .github/workflows/call.test-local-subgraph.yml | 9 ++++----- .github/workflows/call.test-sdk-core.yml | 12 ++++++------ ...l.test-subgraph-on-previous-sdk-core-versions.yml | 5 +++-- packages/subgraph/tasks/setup-graph-node.sh | 6 +++++- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/call.test-ethereum-contracts.yml b/.github/workflows/call.test-ethereum-contracts.yml index 7b3a5f2627..64d8b0b2dc 100644 --- a/.github/workflows/call.test-ethereum-contracts.yml +++ b/.github/workflows/call.test-ethereum-contracts.yml @@ -56,11 +56,10 @@ jobs: - name: Set cache key prefix id: set-cache-key-prefix run: | - node_version=${{ matrix.node-version }} if [ "${{ inputs.run-coverage-tests }}" == false ]; then - v=ethereum-contracts-test-${node_version}- + v=ethereum-contracts-${{ env.DEV_SHELL_NAME }}-test- else - v=ethereum-contracts-coverage-${node_version}- + v=ethereum-contracts-${{ env.DEV_SHELL_NAME }}-coverage- fi echo "cache_key_prefix=$v" >> "$GITHUB_OUTPUT" shell: bash diff --git a/.github/workflows/call.test-local-subgraph.yml b/.github/workflows/call.test-local-subgraph.yml index 95f0c202c5..8e369dc5f9 100644 --- a/.github/workflows/call.test-local-subgraph.yml +++ b/.github/workflows/call.test-local-subgraph.yml @@ -4,7 +4,6 @@ on: workflow_call: env: - # FIXME: subgraph test fails with node20 DEV_SHELL_NAME: ci-node20 jobs: @@ -27,7 +26,7 @@ jobs: uses: ./.github/actions/setup-workflow-base with: package-name: subgraph - cache-key-prefix: subgraph-unit-tests-${{ env.DEV_SHELL_NAME }}- + cache-key-prefix: subgraph-${{ env.DEV_SHELL_NAME }}-unit-tests- dev-shell-name: ${{ env.DEV_SHELL_NAME }} - name: Install dependencies @@ -70,7 +69,7 @@ jobs: uses: ./.github/actions/setup-workflow-base with: package-name: subgraph - cache-key-prefix: subgraph-integration-tests-${{ env.DEV_SHELL_NAME }}- + cache-key-prefix: subgraph-${{ env.DEV_SHELL_NAME }}-integration-tests- dev-shell-name: ${{ env.DEV_SHELL_NAME }} - name: Install dependencies @@ -106,8 +105,8 @@ jobs: - name: Docker compose if: steps.base.outputs.cache-hit != 'true' run: | - source ./tasks/setup-graph-node.sh - docker compose up & + ./tasks/setup-graph-node.sh & + # wait 5 seconds for it to warm up sleep 5 working-directory: ${{ env.subgraph-working-directory }} diff --git a/.github/workflows/call.test-sdk-core.yml b/.github/workflows/call.test-sdk-core.yml index df087f624b..c60993f373 100644 --- a/.github/workflows/call.test-sdk-core.yml +++ b/.github/workflows/call.test-sdk-core.yml @@ -31,7 +31,7 @@ jobs: if [ "${{ inputs.run-coverage-tests }}" == "true" ];then echo "matrix={\"node-version\": [20]}" >> "$GITHUB_OUTPUT" else - echo "matrix={\"node-version\": [18, 20]}" >> "$GITHUB_OUTPUT" + echo "matrix={\"node-version\": [uu18, 20]}" >> "$GITHUB_OUTPUT" fi test-sdk-core: @@ -62,11 +62,10 @@ jobs: - name: Set cache key prefix id: set-cache-key-prefix run: | - node_version=${{ matrix.node-version }} if [ "${{ inputs.run-coverage-tests }}" == false ]; then - v=sdk-core-test-${node_version}- + v=sdk-core-${{ env.DEV_SHELL_NAME }}-test- else - v=sdk-core-coverage-${node_version}- + v=sdk-core-${{ env.DEV_SHELL_NAME }}-coverage- fi echo "cache_key_prefix=$v" >> "$GITHUB_OUTPUT" shell: bash @@ -120,8 +119,9 @@ jobs: - name: Docker compose if: steps.base.outputs.cache-hit != 'true' run: | - source ./tasks/setup-graph-node.sh - docker compose up & + ./tasks/setup-graph-node.sh & + # wait 5 seconds for it to warm up + sleep 5 working-directory: ${{ env.subgraph-working-directory }} - name: Build and deploy local subgraph diff --git a/.github/workflows/call.test-subgraph-on-previous-sdk-core-versions.yml b/.github/workflows/call.test-subgraph-on-previous-sdk-core-versions.yml index a1a62f0896..f1fd34b8af 100644 --- a/.github/workflows/call.test-subgraph-on-previous-sdk-core-versions.yml +++ b/.github/workflows/call.test-subgraph-on-previous-sdk-core-versions.yml @@ -64,8 +64,9 @@ jobs: - name: "Docker compose" run: | - source ./tasks/setup-graph-node.sh - docker compose up & + ./tasks/setup-graph-node.sh & + # wait 5 seconds for it to warm up + sleep 5 working-directory: ./packages/subgraph - name: "Prepare and Deploy Local Subgraph" diff --git a/packages/subgraph/tasks/setup-graph-node.sh b/packages/subgraph/tasks/setup-graph-node.sh index fa9a87065b..e20c0e7c3e 100644 --- a/packages/subgraph/tasks/setup-graph-node.sh +++ b/packages/subgraph/tasks/setup-graph-node.sh @@ -17,6 +17,10 @@ if ! which jq >/dev/null 2>&1; then exit 1 fi +# this creates the bridged network for the composed ervices (network id: subgraph_default) docker compose up --no-start +# we then extract the gateway ip address and export it DOCKER_HOST_IP=$(docker network inspect subgraph_default | jq -r '.[0].IPAM.Config[].Gateway') -export DOCKER_HOST_IP + +# docker compose with required variables +DOCKER_HOST_IP=$DOCKER_HOST_IP docker compose up From 3b4e6527cd6d5f48df39447cb9410b5010dd6c40 Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 21:03:06 +0300 Subject: [PATCH 18/19] clean up --- .github/workflows/call.test-sdk-core.yml | 2 +- packages/subgraph/tasks/setup-graph-node.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 packages/subgraph/tasks/setup-graph-node.sh diff --git a/.github/workflows/call.test-sdk-core.yml b/.github/workflows/call.test-sdk-core.yml index c60993f373..1eea588fcf 100644 --- a/.github/workflows/call.test-sdk-core.yml +++ b/.github/workflows/call.test-sdk-core.yml @@ -31,7 +31,7 @@ jobs: if [ "${{ inputs.run-coverage-tests }}" == "true" ];then echo "matrix={\"node-version\": [20]}" >> "$GITHUB_OUTPUT" else - echo "matrix={\"node-version\": [uu18, 20]}" >> "$GITHUB_OUTPUT" + echo "matrix={\"node-version\": [18, 20]}" >> "$GITHUB_OUTPUT" fi test-sdk-core: diff --git a/packages/subgraph/tasks/setup-graph-node.sh b/packages/subgraph/tasks/setup-graph-node.sh old mode 100644 new mode 100755 index e20c0e7c3e..bb9a699b69 --- a/packages/subgraph/tasks/setup-graph-node.sh +++ b/packages/subgraph/tasks/setup-graph-node.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set -ex if ! which docker >/dev/null 2>&1 ; then echo "Please install 'docker' first" From fbd7cf43a81b808e3b6fe025caa56eccc05dcfba Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Wed, 28 Aug 2024 21:32:22 +0300 Subject: [PATCH 19/19] clean up --- .../workflows/call.test-local-subgraph.yml | 22 +++++++---------- .github/workflows/call.test-sdk-core.yml | 24 ++++++++----------- 2 files changed, 19 insertions(+), 27 deletions(-) diff --git a/.github/workflows/call.test-local-subgraph.yml b/.github/workflows/call.test-local-subgraph.yml index 8e369dc5f9..cb05a6a288 100644 --- a/.github/workflows/call.test-local-subgraph.yml +++ b/.github/workflows/call.test-local-subgraph.yml @@ -5,15 +5,15 @@ on: env: DEV_SHELL_NAME: ci-node20 + ethereum-contracts-working-directory: ./packages/ethereum-contracts + sdk-core-working-directory: ./packages/sdk-core + subgraph-working-directory: ./packages/subgraph jobs: subgraph-unit-tests: name: Run subgraph unit tests runs-on: ubuntu-latest - env: - subgraph-working-directory: ./packages/subgraph - defaults: run: shell: nix develop .#${{ env.DEV_SHELL_NAME }} -c bash -xe {0} @@ -41,7 +41,7 @@ jobs: run: | yarn lint yarn build - working-directory: ./packages/ethereum-contracts + working-directory: ${{ env.ethereum-contracts-working-directory }} - name: Run unit tests if: steps.base.outputs.cache-hit != 'true' @@ -53,10 +53,6 @@ jobs: runs-on: ubuntu-latest - env: - subgraph-working-directory: ./packages/subgraph - sdk-core-working-directory: ./packages/sdk-core - defaults: run: shell: nix develop .#${{ env.DEV_SHELL_NAME }} -c bash -xe {0} @@ -79,7 +75,7 @@ jobs: - name: Build contracts if: steps.base.outputs.cache-hit != 'true' run: yarn build - working-directory: ./packages/ethereum-contracts + working-directory: ${{ env.ethereum-contracts-working-directory }} - name: Build SDK core if: steps.base.outputs.cache-hit != 'true' @@ -95,19 +91,19 @@ jobs: - name: Deploy framework and tokens if: steps.base.outputs.cache-hit != 'true' run: npx hardhat run dev-scripts/run-deploy-contracts-and-token.js --network localhost - working-directory: ./packages/ethereum-contracts + working-directory: ${{ env.ethereum-contracts-working-directory }} - name: Prepare files for local testing if: steps.base.outputs.cache-hit != 'true' run: yarn prepare-local working-directory: ${{ env.subgraph-working-directory }} - - name: Docker compose + - name: Setup graph node if: steps.base.outputs.cache-hit != 'true' run: | ./tasks/setup-graph-node.sh & - # wait 5 seconds for it to warm up - sleep 5 + # wait for it to warm up + sleep 30 working-directory: ${{ env.subgraph-working-directory }} - name: Run subgraph integration test suite diff --git a/.github/workflows/call.test-sdk-core.yml b/.github/workflows/call.test-sdk-core.yml index 1eea588fcf..d6341c3e2b 100644 --- a/.github/workflows/call.test-sdk-core.yml +++ b/.github/workflows/call.test-sdk-core.yml @@ -85,19 +85,12 @@ jobs: npx tsc --version npx hardhat --version - - name: Lint and build essentials + - name: Build contracts if: steps.base.outputs.cache-hit != 'true' run: | - yarn lint yarn build working-directory: ${{ env.ethereum-contracts-working-directory }} - - name: Start hardhat node - if: steps.base.outputs.cache-hit != 'true' - run: | - ./tasks/startHardhatNode.sh start - working-directory: ${{ env.sdk-core-working-directory }} - - name: Build SDK Core if: steps.base.outputs.cache-hit != 'true' # build sdk-core because of auto linking to dependency @@ -106,7 +99,12 @@ jobs: yarn build working-directory: ${{ env.sdk-core-working-directory }} - - name: Deploy Framework and Tokens + - name: Start hardhat node + if: steps.base.outputs.cache-hit != 'true' + run: ./tasks/startHardhatNode.sh start + working-directory: ${{ env.sdk-core-working-directory }} + + - name: Deploy framework and tokens if: steps.base.outputs.cache-hit != 'true' run: npx hardhat run dev-scripts/run-deploy-contracts-and-token.js --network localhost working-directory: ${{ env.ethereum-contracts-working-directory }} @@ -116,20 +114,18 @@ jobs: run: yarn prepare-local working-directory: ${{ env.subgraph-working-directory }} - - name: Docker compose + - name: Setup graph node if: steps.base.outputs.cache-hit != 'true' run: | ./tasks/setup-graph-node.sh & - # wait 5 seconds for it to warm up - sleep 5 + # wait for it to warm up + sleep 30 working-directory: ${{ env.subgraph-working-directory }} - name: Build and deploy local subgraph if: steps.base.outputs.cache-hit != 'true' run: | yarn build-and-deploy-local - # artificial slow down to give the subgraph time to sync - sleep 30 working-directory: ${{ env.subgraph-working-directory }} - name: Run test suite