From 73576d3c50583f0cc9e36f108751d18047d72533 Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Thu, 26 Oct 2023 12:31:56 +0200 Subject: [PATCH] Added check if is Hardhat functional --- .github/workflows/system-tests.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/system-tests.yml b/.github/workflows/system-tests.yml index 09154584a..2a684ed30 100644 --- a/.github/workflows/system-tests.yml +++ b/.github/workflows/system-tests.yml @@ -31,15 +31,22 @@ jobs: while [[ -z $(lsof -i :8545 -t) ]]; do echo "Waiting for port 8545 to be open..."; sleep 10; done sleep 60 - # Temporary solution - - name: Verify Hardhat Node is Running + # Verify Hardhat Node is Running and Functional + - name: Verify Hardhat Node is Running and Functional working-directory: ./solidity run: | if [[ -z $(lsof -i :8545 -t) ]]; then echo "Hardhat node is not running on port 8545, exiting..." exit 1 else - echo "Hardhat node is running, proceeding to deploy contracts." + echo "Hardhat node is running, verifying its functionality..." + chainId=$(curl -s -X POST --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' http://127.0.0.1:8545 | jq -r '.result') + if [[ ! -z "$chainId" ]]; then + echo "Hardhat node is functional. Chain ID is $chainId." + else + echo "Hardhat node is running but not functional, exiting..." + exit 1 + fi fi - name: Deploy contracts