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