From 4ddd3a6d2523a0a45fb3b9cad803e2983affc3dd Mon Sep 17 00:00:00 2001 From: Juraj Piar Date: Wed, 8 May 2024 11:45:06 +0100 Subject: [PATCH] removes port verification --- .github/workflows/build_and_test.yml | 137 ++++++++++-------- .../bitcoind01/bitcoind.conf | 0 .../bitcoind02/bitcoind.conf | 0 {.github/mining-test => mining-test}/run.sh | 0 4 files changed, 73 insertions(+), 64 deletions(-) rename {.github/mining-test => mining-test}/bitcoind01/bitcoind.conf (100%) rename {.github/mining-test => mining-test}/bitcoind02/bitcoind.conf (100%) rename {.github/mining-test => mining-test}/run.sh (100%) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 961bfb0bc8c..5c9a049def9 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -157,8 +157,8 @@ jobs: mining-tests: # needs: build runs-on: ubuntu-latest - container: - image: openjdk:8-jdk +# container: +# image: openjdk:8-jdk defaults: run: working-directory: . @@ -167,12 +167,12 @@ jobs: bitcoind01: image: kylemanna/bitcoind:latest volumes: - - ${{ github.workspace }}/.github/mining-test/bitcoind01:/bitcoin/.bitcoin/ + - ${{ github.workspace }}/mining-test/bitcoind01:/bitcoin/.bitcoin/ env: DISABLEWALLET: "0" ports: - 31591:31591 -# - 32591:32591 + - 32591:32591 options: >- --entrypoint "/usr/local/bin/bitcoind" --name bitcoind01 @@ -181,7 +181,7 @@ jobs: # bitcoind02: # image: kylemanna/bitcoind:latest # volumes: -# - ${{ github.workspace }}/.github/mining-test/bitcoind02:/bitcoin/.bitcoin/ +# - ${{ github.workspace }}/mining-test/bitcoind02:/bitcoin/.bitcoin/ # env: # DISABLEWALLET: "0" # ports: @@ -217,82 +217,91 @@ jobs: # done # echo "Success: All specified ports are being listened to." - - name: bitcoind01 logs - uses: docker://docker +# - name: bitcoind01 logs +# uses: docker://docker +# with: +# args: | +# docker logs bitcoind01 + + - name: Checkout + uses: actions/checkout@v2 with: - args: | - docker logs bitcoind01 + path: rskj + + - name: Move bitcoin conf + run: | + cp -R rskj/mining-test/bitcoind01/* mining-test/bitcoind01 - name: Restart bitcoin nodes uses: docker://docker with: args: docker restart bitcoind01 #bitcoind02 - - name: Attach bitcoind01 container to the network - uses: docker://docker - with: - args: docker network connect bridge bitcoind01 +# - name: Attach bitcoind01 container to the network +# uses: docker://docker +# with: +# args: docker network connect bridge bitcoind01 # - name: Attach bitcoind02 container to the network # uses: docker://docker # with: # args: docker network connect bridge bitcoind02 - - name: Check that bitcoind01 and bitcoind02 are attached to the network - uses: docker://docker - with: - args: | - docker network inspect bridge - - - name: Verify bitcoind01 and bitcoind02 are running - uses: docker://docker - with: - args: | - docker ps -all - - - name: Print content of /bitcoin/.bitcoin/ - uses: docker://docker - with: - args: | - docker exec bitcoind01 ls -la /bitcoin/.bitcoin - - - name: Print content of /bitcoin/.bitcoin/ - run: | - ls -la .github/mining-test/bitcoind01 - - - name: Print content of /bitcoin/.bitcoin/bitcoin.conf - uses: docker://docker - with: - args: | - docker exec bitcoind01 cat /bitcoin/.bitcoin/bitcoind.conf - - - name: bitcoind01 logs - uses: docker://docker - with: - args: | - docker logs bitcoind01 +# - name: Check that bitcoind01 and bitcoind02 are attached to the network +# uses: docker://docker +# with: +# args: | +# docker network inspect bridge +# +# - name: Verify bitcoind01 and bitcoind02 are running +# uses: docker://docker +# with: +# args: | +# docker ps -all - - name: Wait for Bitcoin nodes to initialize - run: sleep 30 +# - name: Print content of /bitcoin/.bitcoin/ +# uses: docker://docker +# with: +# args: | +# docker exec bitcoind01 ls -la /bitcoin/.bitcoin +# +# - name: Print content of /bitcoin/.bitcoin/ +# run: | +# ls -la mining-test/bitcoind01 +# +# - name: Print content of /bitcoin/.bitcoin/bitcoin.conf +# uses: docker://docker +# with: +# args: | +# docker exec bitcoind01 cat /bitcoin/.bitcoin/bitcoind.conf - - name: Verify all required ports are used by bitcoind01 and bitcoind02 - shell: bash - run: | - ports=(31591 32591 31592 32592) - for port in "${ports[@]}"; do - if ! lsof -i:$port -sTCP:LISTEN > /dev/null; then - echo "Error: No process is listening on port $port" - exit 1 - fi - done - echo "Success: All specified ports are being listened to." +# - name: bitcoind01 logs +# uses: docker://docker +# with: +# args: | +# docker logs bitcoind01 +# +# - name: Wait for Bitcoin nodes to initialize +# run: sleep 30 +# +# - name: Verify all required ports are used by bitcoind01 and bitcoind02 +# shell: bash +# run: | +# ports=(31591 32591 31592 32592) +# for port in "${ports[@]}"; do +# if ! lsof -i:$port -sTCP:LISTEN > /dev/null; then +# echo "Error: No process is listening on port $port" +# exit 1 +# fi +# done +# echo "Success: All specified ports are being listened to." - name: Test bitcoin nodes run: | echo Test bitcoin node 1 - curl -v -s -u admin:admin --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;' http://bitcoind01:32591 - echo Test bitcoin node 2 - curl -v -s -u admin:admin --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;' http://bitcoind02:32592 + curl -v -s -u admin:admin --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;' http://localhost:32591 +# echo Test bitcoin node 2 +# curl -v -s -u admin:admin --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;' http://locahost:32592 - name: Setup Node.js @@ -384,8 +393,8 @@ jobs: # - name: Run Mining Integration Tests # run: | -# chmod +x .github/mining-test/run.sh -# ./.github/mining-test/run.sh +# chmod +x mining-test/run.sh +# ./mining-test/run.sh - name: Run Mining Integration Tests working-directory: mining-integration-tests diff --git a/.github/mining-test/bitcoind01/bitcoind.conf b/mining-test/bitcoind01/bitcoind.conf similarity index 100% rename from .github/mining-test/bitcoind01/bitcoind.conf rename to mining-test/bitcoind01/bitcoind.conf diff --git a/.github/mining-test/bitcoind02/bitcoind.conf b/mining-test/bitcoind02/bitcoind.conf similarity index 100% rename from .github/mining-test/bitcoind02/bitcoind.conf rename to mining-test/bitcoind02/bitcoind.conf diff --git a/.github/mining-test/run.sh b/mining-test/run.sh similarity index 100% rename from .github/mining-test/run.sh rename to mining-test/run.sh