diff --git a/.github/check_connection.aqua b/.github/check_connection.aqua index 86e0c29..9170fbe 100644 --- a/.github/check_connection.aqua +++ b/.github/check_connection.aqua @@ -1,5 +1,5 @@ -service Op: - noop() -> +service Op("op"): + noop() func check_connection() -> string: on HOST_PEER_ID: diff --git a/.github/workflows/check-connection.yml b/.github/workflows/check-connection.yml index 5400965..9250791 100644 --- a/.github/workflows/check-connection.yml +++ b/.github/workflows/check-connection.yml @@ -64,18 +64,19 @@ jobs: with: node-version: 16 - - run: npm install -g @fluencelabs/aqua + - run: npm install -g @fluencelabs/aqua@0.6.4-283 - name: "Check call_parameters deployment" run: | set -x - NODE="/ip4/127.0.0.1/tcp/4310/ws/p2p/12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3" + NODE=${{ matrix.node }} INPUT=$GITHUB_WORKSPACE/.github/check_connection.aqua - RESULT=$(aqua run --addr ${{ matrix.node }} --sk qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo= -f 'check_connection()' --input $INPUT) - - if [ "$RESULT" -neq "ok" ]; then - echo "Failed to connect to ${{ matrix.node }}" + RESULT=$(aqua run --addr $NODE --sk qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo= -f 'check_connection()' --input $INPUT) + RESULT=$(echo $RESULT | sed -e 's/Your peerId: [a-zA-Z0-9]*//g' | xargs) + + if [ "$RESULT" != "ok" ]; then + echo "Failed to connect to $NODE" exit 1 fi diff --git a/.github/workflows/check-deploy.yml b/.github/workflows/check-deploy.yml index 6de3f40..726cf74 100644 --- a/.github/workflows/check-deploy.yml +++ b/.github/workflows/check-deploy.yml @@ -46,7 +46,7 @@ jobs: with: node-version: 16 - - run: npm install -g @fluencelabs/aqua + - run: npm install -g @fluencelabs/aqua@0.6.4-283 - name: "Check call_parameters deployment" run: | @@ -56,7 +56,8 @@ jobs: INPUT=$GITHUB_WORKSPACE/.github/deploy.aqua RESULT=$(aqua run --addr $NODE --sk qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo= -f 'call(service_id)' -d '{"service_id": "'$SERVICE_ID'"}' --input $INPUT) - + RESULT=$(echo $RESULT | sed -e 's/Your peerId: [a-zA-Z0-9]*//g') + EXPECTED_PEER_ID=$(echo -e "$RESULT" | sed -n '1p' | grep -o '12D3.*') RESULT_PEER_ID=$(echo -e "$RESULT" | sed -n '2p' | tr -d \") if [ "$EXPECTED_PEER_ID" -neq "$RESULT_PEER_ID" ]; then