Skip to content

Commit

Permalink
Added check if is Hardhat functional
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszslabon committed Oct 26, 2023
1 parent 213a2a0 commit 73576d3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 73576d3

Please sign in to comment.