Skip to content

Commit

Permalink
fix: add GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
druiz0992 committed Oct 13, 2022
1 parent fe72daa commit 4cc82db
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 6 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/check-PRs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -486,3 +486,60 @@ jobs:
with:
name: test-apps-logs
path: ./test-apps.log

test-client:
name: check client for liveliness
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
with:
node-version: '16.17.0'

- name: Create env file
run: |
echo "ETH_NETWORK=goerli" > ./nightfall-client/client.env
echo "BLOCKCHAIN_WS_HOST=${GOERLI_ALCHEMY}" >> ./nightfall-client/client.env
cat ./nightfall-client/client.env
- name: Start client
run: |
cd nightfall-client && ./start-client -g -d &> test-client.log &disown
- name: Debug logs - after container startup
if: always()
run: cat test-client.log

- name: 'Check client liveliness'

uses: Wandalen/wretry.action@v1.0.11
with:
command: |
curl -i http://localhost:8080/healthcheck
attempt_limit: 100
attempt_delay: 20000

- name: 'Check access to contracts'

uses: Wandalen/wretry.action@v1.0.11
with:
command: |
curl -i http://localhost:8080/contract-address/Shield
attempt_limit: 100
attempt_delay: 20000

- name: Debug logs - after integration test run
if: always()
run: cat test-client.log

- name: If integration test failed, shutdown the Containers
if: failure()
run: docker-compose -f docker/docker-compose.client.yml -f docker/docker-compose.client.dev.yml -p nightfall_3 down -v

- name: If integration test failed, upload logs files as artifacts
if: failure()
uses: actions/upload-artifact@master
with:
name: test-client-logs
path: ./test-client.log

2 changes: 1 addition & 1 deletion docker/docker-compose.client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
RABBITMQ_PORT: ${RABBITMQ_PORT:-5672}
ENABLE_QUEUE: ${ENABLE_QUEUE:-1}
USE_STUBS: ${USE_STUBS:-false} # make sure this flag is the same as in deployer service
BLOCKCHAIN_URL: ${BLOCKCHAIN_URL}
BLOCKCHAIN_URL: wss://${BLOCKCHAIN_WS_HOST}
USE_EXTERNAL_NODE: 'true'
AUTOSTART_RETRIES: 600
ETH_NETWORK: ${ETH_NETWORK}
Expand Down
6 changes: 3 additions & 3 deletions nightfall-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ run the client.

```
ETH_NETWORK=goerli or mainnet
BLOCKCHAIN_URL=your web3 url provider to access the blockchain
BLOCKCHAIN_WS_HOST=your web3 host to access the blockchain
```

Example of `client.env`:

```
ETH_NETWORK=goerli
BLOCKCHAIN_URL=wss://eth-goerli.alchemyapi.io/v2/xxxxxxxxxxxxxxxxxxxxxxxxxxxxs
BLOCKCHAIN_WS_HOST=eth-goerli.alchemyapi.io/v2/xxxxxxxxxxxxxxxxxxxxxxxxxxxxs
```

To run the script with existing images of the different services based on the
Expand All @@ -68,6 +68,6 @@ This will run a docker-compose with the needed components:

### Localhost deployment

If you just want to run Polygon Nightfall in localhost then use `start-nightfall` script with all
If you just want to run Polygon Nightfall in localhost then use `./bin/start-nightfall` script with all
necessary services conteainerised in localhost. See the README in the
[Polygon Nightfall](https://github.com/EYBlockchain/nightfall_3) repository
2 changes: 1 addition & 1 deletion nightfall-client/client-example.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ETH_NETWORK=goerli
BLOCKCHAIN_URL=your web3 url provider to access the blockchain
BLOCKCHAIN_WS_HOST=your web3 host provider to access the blockchain
3 changes: 2 additions & 1 deletion zokrates-worker/src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ const checkCircuitsOutput = async () => {
files.map(async f => {
if (f) {
const filename = f.split(' ')[1];
const circuit = circuits.find(c => filename.includes(c));
const _circuit = circuits.find(c => filename.includes(c));
const circuit = typeof _circuit === 'undefined' ? '.' : _circuit;

if (!fs.existsSync(`${outputPath}/${circuit}`)) {
fs.mkdirSync(`${outputPath}/${circuit}`);
Expand Down

0 comments on commit 4cc82db

Please sign in to comment.