From 89c9d2ec1894d5c9201fb3a1f7353a286f1f4f85 Mon Sep 17 00:00:00 2001 From: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com> Date: Thu, 10 Apr 2025 11:28:28 +0200 Subject: [PATCH 01/17] Create e2e.yaml just for testing purposes --- .github/workflows/e2e.yaml | 145 +++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 .github/workflows/e2e.yaml diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml new file mode 100644 index 0000000..d514bdb --- /dev/null +++ b/.github/workflows/e2e.yaml @@ -0,0 +1,145 @@ +name: Manual Deployment + +on: + workflow_dispatch: + +jobs: + deploy: + runs-on: self-hosted + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Build DAppNode Package + run: | + npx @dappnode/dappnodesdk build --variant=hoodi + + - name: Extract IPFS Hash + id: extract_ipfs + run: | + # Use jq to get the hash from the generated releases.json. + ipfs_hash=$(jq -r '.[].hash' variants/hoodi/releases.json) + echo "IPFS hash: $ipfs_hash" + # Save the hash as an environment variable for later steps. + echo "IPFS_HASH=$ipfs_hash" >> $GITHUB_ENV + + - name: Check DAppManager Ping + id: ping_dappmanager + run: | + # Ping the DAppManager endpoint and check for HTTP 200 + code=$(curl -s -o /dev/null -w "%{http_code}" http://172.33.1.7:7000/ping) + if [ "$code" -ne 200 ]; then + echo "dappmanager is not running with env TEST=true and therefore the test api is not running" + exit 1 + fi + + - name: Get Staker Config + id: staker_config + run: | + # Get the staker configuration + response=$(curl -s -X POST http://172.33.1.7:7000/stakerConfigGet \ + -H "Content-Type: application/json" \ + -d '{"network": "hoodi"}') + echo "$response" > staker_config.json + + # Select the execution client "hoodi-geth.dnp.dappnode.eth" + client=$(echo "$response" | jq -c '.executionClients[] | select(.dnpName=="hoodi-geth.dnp.dappnode.eth")') + if [ -z "$client" ]; then + echo "Error: execution client hoodi-geth.dnp.dappnode.eth not selected." + exit 1 + fi + isInstalled=$(echo "$client" | jq -r '.isInstalled') + isRunning=$(echo "$client" | jq -r '.isRunning') + if [ "$isInstalled" != "true" ] || [ "$isRunning" != "true" ]; then + echo "Error: hoodi-geth.dnp.dappnode.eth must be installed and running." + exit 1 + fi + # Retrieve the semversion (if available). Falls back to "unknown" if not set. + semversion=$(echo "$client" | jq -r '.data.semVersion // "unknown"') + echo "Execution client semver: $semversion" + echo "SEM_VERSION=$semversion" >> $GITHUB_ENV + + - name: Install Package + id: install_package + run: | + # Replace the placeholder with the actual ipfs hash from step 2. + ipfs_hash=${{ env.IPFS_HASH }} + curl -X POST http://172.33.1.7:7000/packageInstall \ + -H "Content-Type: application/json" \ + -d "{ + \"name\": \"hoodi-geth-dnp.dappnode.eth\", + \"version\": \"${ipfs_hash}\", + \"userSettings\": {}, + \"options\": { + \"BYPASS_CORE_RESTRICTION\": true, + \"BYPASS_SIGNED_RESTRICTION\": true + } + }" + + - name: Get Geth Hoodi Data + id: get_geth_data + run: | + # Get the unique_id and mount_path for later usage + response=$(curl -s http://localhost:3000/data/request/geth-hoodi) + echo "$response" > geth_hoodi.json + unique_id=$(echo "$response" | jq -r '.unique_id') + mount_path=$(echo "$response" | jq -r '.mount_path') + echo "Unique ID: $unique_id, Mount Path: $mount_path" + echo "UNIQUE_ID=$unique_id" >> $GITHUB_ENV + echo "MOUNT_PATH=$mount_path" >> $GITHUB_ENV + + - name: Remount Docker Volume Using MOUNT_PATH as Source + id: remount_docker + run: | + set -e + mount_path="${{ env.MOUNT_PATH }}" + container_name="DAppNodePackage-geth.hoodi-geth.dnp.dappnode.eth" + + # Retrieve the container's mounts as JSON and ensure exactly one volume is attached. + mounts=$(docker inspect "$container_name" --format '{{json .Mounts}}') + volume_count=$(echo "$mounts" | jq 'length') + if [ "$volume_count" -ne 1 ]; then + echo "Error: Expected exactly one volume for container ${container_name}, but found ${volume_count}." + exit 1 + fi + + # Get the docker volume name; the docker volume's data directory is typically located at /var/lib/docker/volumes//_data. + volume_name=$(echo "$mounts" | jq -r '.[0].Name') + volume_target="/var/lib/docker/volumes/${volume_name}/_data" + echo "Using NFS source ${mount_path} to mount onto docker volume ${volume_name} at ${volume_target}" + + # Mount the NFS share from MOUNT_PATH into the docker volume's data folder. + sudo mount -t nfs "${mount_path}" "${volume_target}" + if [ $? -ne 0 ]; then + echo "Error: Failed to mount ${mount_path} onto ${volume_target}" + exit 1 + fi + + echo "NFS mount successful. Restarting container ${container_name}..." + docker container restart "$container_name" + + - name: Poll Eth Syncing Status + id: poll_eth_sync + run: | + # Obtain the IP address of the container from the docker network "dncore_network". + container_ip=$(docker inspect DAppNodePackage-geth.hoodi-geth.dnp.dappnode.eth --format='{{.NetworkSettings.Networks.dncore_network.IPAddress}}') + if [ -z "$container_ip" ]; then + echo "Error: Could not obtain the IP address of container DAppNodePackage-geth.hoodi-geth.dnp.dappnode.eth on network dncore_network." + exit 1 + fi + endpoint="http://${container_ip}:8545" + echo "Polling eth_syncing status at $endpoint" + for i in $(seq 1 30); do + response=$(curl -s -X POST -H "Content-Type: application/json" \ + --data '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}' "$endpoint") + syncing=$(echo "$response" | jq -r '.result') + echo "Attempt $i: eth_syncing response: $syncing" + if [ "$syncing" == "false" ]; then + echo "Synchronization is complete." + exit 0 + fi + sleep 10 + done + echo "Error: eth node is still syncing after 30 attempts." + exit 1 + From cc235cedc469eda64a2c1fa4dd7d16c9954d4d38 Mon Sep 17 00:00:00 2001 From: 3alpha Date: Thu, 10 Apr 2025 11:30:53 +0200 Subject: [PATCH 02/17] Rename e2e.yaml to e2e.yml --- .github/workflows/{e2e.yaml => e2e.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{e2e.yaml => e2e.yml} (100%) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yml similarity index 100% rename from .github/workflows/e2e.yaml rename to .github/workflows/e2e.yml From 5918745c5af98aaed19aa3d505e410a5ff02dbaf Mon Sep 17 00:00:00 2001 From: 3alpha Date: Thu, 10 Apr 2025 11:32:56 +0200 Subject: [PATCH 03/17] Update e2e.yml --- .github/workflows/e2e.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index d514bdb..7631e65 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -2,6 +2,7 @@ name: Manual Deployment on: workflow_dispatch: + push: jobs: deploy: From 6dca2e5b9c4364aa44e751c858b85e01c982d0b9 Mon Sep 17 00:00:00 2001 From: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com> Date: Thu, 10 Apr 2025 11:40:33 +0200 Subject: [PATCH 04/17] set node 22 --- .github/workflows/e2e.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 7631e65..5cb69dc 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -11,6 +11,17 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 + - name: Setup Node.js 22 using nvm + run: | + # Set up nvm + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" + + # Install and use Node 22 + nvm install 22 + nvm use 22 + echo "Using Node version: $(node --version)" + - name: Build DAppNode Package run: | npx @dappnode/dappnodesdk build --variant=hoodi From 01bbeb840bdb4bc96e55980839bb11069accc5fe Mon Sep 17 00:00:00 2001 From: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com> Date: Thu, 10 Apr 2025 11:43:46 +0200 Subject: [PATCH 05/17] use setup node --- .github/workflows/e2e.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 5cb69dc..16d02ab 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -11,16 +11,10 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 - - name: Setup Node.js 22 using nvm - run: | - # Set up nvm - export NVM_DIR="$HOME/.nvm" - [ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" - - # Install and use Node 22 - nvm install 22 - nvm use 22 - echo "Using Node version: $(node --version)" + - name: Setup Node.js 22 + uses: actions/setup-node@v4 + with: + node-version: 22 - name: Build DAppNode Package run: | From ee64144bb8569cb29005df2734d18e6e99c139b7 Mon Sep 17 00:00:00 2001 From: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com> Date: Thu, 10 Apr 2025 11:45:13 +0200 Subject: [PATCH 06/17] add provider remote --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 16d02ab..b1099a6 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -18,7 +18,7 @@ jobs: - name: Build DAppNode Package run: | - npx @dappnode/dappnodesdk build --variant=hoodi + npx @dappnode/dappnodesdk build --provider=remote --variant=hoodi - name: Extract IPFS Hash id: extract_ipfs From 75f13d4f0e77ac694499e6e1defb626e5eac695e Mon Sep 17 00:00:00 2001 From: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com> Date: Thu, 10 Apr 2025 11:49:24 +0200 Subject: [PATCH 07/17] update package_variants dir --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index b1099a6..ea705ad 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -24,7 +24,7 @@ jobs: id: extract_ipfs run: | # Use jq to get the hash from the generated releases.json. - ipfs_hash=$(jq -r '.[].hash' variants/hoodi/releases.json) + ipfs_hash=$(jq -r '.[].hash' package_variants/hoodi/releases.json) echo "IPFS hash: $ipfs_hash" # Save the hash as an environment variable for later steps. echo "IPFS_HASH=$ipfs_hash" >> $GITHUB_ENV From 374c0126ae9e92fbdcfe59a251328e71f416a676 Mon Sep 17 00:00:00 2001 From: 3alpha Date: Thu, 10 Apr 2025 13:19:42 +0200 Subject: [PATCH 08/17] Update paths, add stop and start --- .github/workflows/e2e.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index ea705ad..2f4c4dc 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -98,7 +98,7 @@ jobs: id: remount_docker run: | set -e - mount_path="${{ env.MOUNT_PATH }}" + mount_path="${{ env.MOUNT_PATH }}/.ethereum/hoodi" container_name="DAppNodePackage-geth.hoodi-geth.dnp.dappnode.eth" # Retrieve the container's mounts as JSON and ensure exactly one volume is attached. @@ -109,6 +109,9 @@ jobs: exit 1 fi + echo "Stopping container ${container_name}..." + docker container stop "$container_name" + # Get the docker volume name; the docker volume's data directory is typically located at /var/lib/docker/volumes//_data. volume_name=$(echo "$mounts" | jq -r '.[0].Name') volume_target="/var/lib/docker/volumes/${volume_name}/_data" @@ -121,8 +124,8 @@ jobs: exit 1 fi - echo "NFS mount successful. Restarting container ${container_name}..." - docker container restart "$container_name" + echo "NFS mount successful. Starting container ${container_name}..." + docker container start "$container_name" - name: Poll Eth Syncing Status id: poll_eth_sync From 0fc4e44e85f6da28e010f228980815fca1989e36 Mon Sep 17 00:00:00 2001 From: 3alpha Date: Thu, 10 Apr 2025 13:38:55 +0200 Subject: [PATCH 09/17] Update e2e.yml --- .github/workflows/e2e.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 2f4c4dc..dd5200c 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -138,17 +138,31 @@ jobs: fi endpoint="http://${container_ip}:8545" echo "Polling eth_syncing status at $endpoint" + for i in $(seq 1 30); do + # '|| true' ensures the script continues even if curl fails. response=$(curl -s -X POST -H "Content-Type: application/json" \ - --data '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}' "$endpoint") + --data '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}' "$endpoint" || true) + + # Optional: Check if 'curl' returned anything + if [ -z "$response" ]; then + echo "Attempt $i: No response or curl error. Retrying..." + sleep 10 + continue + fi + syncing=$(echo "$response" | jq -r '.result') echo "Attempt $i: eth_syncing response: $syncing" + if [ "$syncing" == "false" ]; then echo "Synchronization is complete." exit 0 fi + sleep 10 done + echo "Error: eth node is still syncing after 30 attempts." exit 1 + From abd535fd6a138039b63ec0a5f57406950a973aa9 Mon Sep 17 00:00:00 2001 From: 3alpha Date: Thu, 10 Apr 2025 13:46:17 +0200 Subject: [PATCH 10/17] Add release data steps --- .github/workflows/e2e.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index dd5200c..e12a907 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -164,5 +164,34 @@ jobs: echo "Error: eth node is still syncing after 30 attempts." exit 1 + - name: Unmount Docker Volume + if: always() + run: | + set -e + container_name="${{ env.CONTAINER_NAME }}" + volume_target="${{ env.VOLUME_TARGET }}" + + echo "Stopping container ${container_name}..." + docker container stop "$container_name" + + echo "Unmounting data from ${volume_target}..." + sudo umount "${volume_target}" + + echo "Starting container ${container_name}..." + docker container start "$container_name" + + - name: Release Data + if: always() + run: | + set -e + unique_id="${{ env.UNIQUE_ID }}" + if [ -z "$unique_id" ]; then + echo "No unique_id found. Skipping data release." + exit 0 + fi + + echo "Releasing data for unique_id: $unique_id" + response=$(curl -s -X POST "http://localhost:3000/data/release/$unique_id") + echo "Data release response: $response" From 88adf5bc442b645a4ce1acc6a91795296d230989 Mon Sep 17 00:00:00 2001 From: 3alpha Date: Thu, 10 Apr 2025 13:51:11 +0200 Subject: [PATCH 11/17] save envs for unmount step --- .github/workflows/e2e.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index e12a907..c5b56be 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -127,6 +127,10 @@ jobs: echo "NFS mount successful. Starting container ${container_name}..." docker container start "$container_name" + echo "VOLUME_NAME=$volume_name" >> $GITHUB_ENV + echo "VOLUME_TARGET=$volume_target" >> $GITHUB_ENV + echo "CONTAINER_NAME=$container_name" >> $GITHUB_ENV + - name: Poll Eth Syncing Status id: poll_eth_sync run: | From 758baaf7cf49e6b5816dafdc08b1b794cba8d0f4 Mon Sep 17 00:00:00 2001 From: 3alpha Date: Thu, 10 Apr 2025 15:32:18 +0200 Subject: [PATCH 12/17] removing node key and adding sleep --- .github/workflows/e2e.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index c5b56be..8d8ec74 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -123,6 +123,9 @@ jobs: echo "Error: Failed to mount ${mount_path} onto ${volume_target}" exit 1 fi + + echo "Removing datasorce nodekey..." + rm /var/lib/docker/volumes/${volume_name}/_data/geth/nodekey echo "NFS mount successful. Starting container ${container_name}..." docker container start "$container_name" @@ -168,6 +171,8 @@ jobs: echo "Error: eth node is still syncing after 30 attempts." exit 1 + - name: Wait for tests (dummy sleep) + run: sleep 60 - name: Unmount Docker Volume if: always() run: | From a1cf5b3b4bb7a9fc0c7d936b85ba67226e178ae5 Mon Sep 17 00:00:00 2001 From: 3alpha Date: Thu, 10 Apr 2025 15:36:30 +0200 Subject: [PATCH 13/17] remove remove nodekey --- .github/workflows/e2e.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 8d8ec74..9630689 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -124,9 +124,6 @@ jobs: exit 1 fi - echo "Removing datasorce nodekey..." - rm /var/lib/docker/volumes/${volume_name}/_data/geth/nodekey - echo "NFS mount successful. Starting container ${container_name}..." docker container start "$container_name" From 79370bd8aa796b13b0b037d96947c0b0f7b18730 Mon Sep 17 00:00:00 2001 From: pablomendezroyo Date: Tue, 3 Jun 2025 12:05:07 +0200 Subject: [PATCH 14/17] use test code --- .github/workflows/e2e.yml | 164 +------------------------------------- 1 file changed, 4 insertions(+), 160 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 03c4717..f558344 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -39,164 +39,8 @@ jobs: exit 1 fi - - name: Get Staker Config - id: staker_config + - name: Run staker client test sdk run: | - # Get the staker configuration - response=$(curl -s -X POST http://172.33.1.7:7000/stakerConfigGet \ - -H "Content-Type: application/json" \ - -d '{"network": "hoodi"}') - echo "$response" > staker_config.json - - # Select the execution client "hoodi-geth.dnp.dappnode.eth" - client=$(echo "$response" | jq -c '.executionClients[] | select(.dnpName=="hoodi-geth.dnp.dappnode.eth")') - if [ -z "$client" ]; then - echo "Error: execution client hoodi-geth.dnp.dappnode.eth not selected." - exit 1 - fi - isInstalled=$(echo "$client" | jq -r '.isInstalled') - isRunning=$(echo "$client" | jq -r '.isRunning') - if [ "$isInstalled" != "true" ] || [ "$isRunning" != "true" ]; then - echo "Error: hoodi-geth.dnp.dappnode.eth must be installed and running." - exit 1 - fi - # Retrieve the semversion (if available). Falls back to "unknown" if not set. - semversion=$(echo "$client" | jq -r '.data.semVersion // "unknown"') - echo "Execution client semver: $semversion" - echo "SEM_VERSION=$semversion" >> $GITHUB_ENV - - - name: Install Package - id: install_package - run: | - # Replace the placeholder with the actual ipfs hash from step 2. - ipfs_hash=${{ env.IPFS_HASH }} - curl -X POST http://172.33.1.7:7000/packageInstall \ - -H "Content-Type: application/json" \ - -d "{ - \"name\": \"hoodi-geth-dnp.dappnode.eth\", - \"version\": \"${ipfs_hash}\", - \"userSettings\": {}, - \"options\": { - \"BYPASS_CORE_RESTRICTION\": true, - \"BYPASS_SIGNED_RESTRICTION\": true - } - }" - - - name: Get Geth Hoodi Data - id: get_geth_data - run: | - # Get the unique_id and mount_path for later usage - response=$(curl -s http://localhost:3000/data/request/geth-hoodi) - echo "$response" > geth_hoodi.json - unique_id=$(echo "$response" | jq -r '.unique_id') - mount_path=$(echo "$response" | jq -r '.mount_path') - echo "Unique ID: $unique_id, Mount Path: $mount_path" - echo "UNIQUE_ID=$unique_id" >> $GITHUB_ENV - echo "MOUNT_PATH=$mount_path" >> $GITHUB_ENV - - - name: Remount Docker Volume Using MOUNT_PATH as Source - id: remount_docker - run: | - set -e - mount_path="${{ env.MOUNT_PATH }}/.ethereum/hoodi" - container_name="DAppNodePackage-geth.hoodi-geth.dnp.dappnode.eth" - - # Retrieve the container's mounts as JSON and ensure exactly one volume is attached. - mounts=$(docker inspect "$container_name" --format '{{json .Mounts}}') - volume_count=$(echo "$mounts" | jq 'length') - if [ "$volume_count" -ne 1 ]; then - echo "Error: Expected exactly one volume for container ${container_name}, but found ${volume_count}." - exit 1 - fi - - echo "Stopping container ${container_name}..." - docker container stop "$container_name" - - # Get the docker volume name; the docker volume's data directory is typically located at /var/lib/docker/volumes//_data. - volume_name=$(echo "$mounts" | jq -r '.[0].Name') - volume_target="/var/lib/docker/volumes/${volume_name}/_data" - echo "Using NFS source ${mount_path} to mount onto docker volume ${volume_name} at ${volume_target}" - - # Mount the NFS share from MOUNT_PATH into the docker volume's data folder. - sudo mount -t nfs "${mount_path}" "${volume_target}" - if [ $? -ne 0 ]; then - echo "Error: Failed to mount ${mount_path} onto ${volume_target}" - exit 1 - fi - - echo "NFS mount successful. Starting container ${container_name}..." - docker container start "$container_name" - - echo "VOLUME_NAME=$volume_name" >> $GITHUB_ENV - echo "VOLUME_TARGET=$volume_target" >> $GITHUB_ENV - echo "CONTAINER_NAME=$container_name" >> $GITHUB_ENV - - - name: Poll Eth Syncing Status - id: poll_eth_sync - run: | - # Obtain the IP address of the container from the docker network "dncore_network". - container_ip=$(docker inspect DAppNodePackage-geth.hoodi-geth.dnp.dappnode.eth --format='{{.NetworkSettings.Networks.dncore_network.IPAddress}}') - if [ -z "$container_ip" ]; then - echo "Error: Could not obtain the IP address of container DAppNodePackage-geth.hoodi-geth.dnp.dappnode.eth on network dncore_network." - exit 1 - fi - endpoint="http://${container_ip}:8545" - echo "Polling eth_syncing status at $endpoint" - - for i in $(seq 1 30); do - # '|| true' ensures the script continues even if curl fails. - response=$(curl -s -X POST -H "Content-Type: application/json" \ - --data '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}' "$endpoint" || true) - - # Optional: Check if 'curl' returned anything - if [ -z "$response" ]; then - echo "Attempt $i: No response or curl error. Retrying..." - sleep 10 - continue - fi - - syncing=$(echo "$response" | jq -r '.result') - echo "Attempt $i: eth_syncing response: $syncing" - - if [ "$syncing" == "false" ]; then - echo "Synchronization is complete." - exit 0 - fi - - sleep 10 - done - - echo "Error: eth node is still syncing after 30 attempts." - exit 1 - - name: Wait for tests (dummy sleep) - run: sleep 60 - - name: Unmount Docker Volume - if: always() - run: | - set -e - container_name="${{ env.CONTAINER_NAME }}" - volume_target="${{ env.VOLUME_TARGET }}" - - echo "Stopping container ${container_name}..." - docker container stop "$container_name" - - echo "Unmounting data from ${volume_target}..." - sudo umount "${volume_target}" - - echo "Starting container ${container_name}..." - docker container start "$container_name" - - - name: Release Data - if: always() - run: | - set -e - unique_id="${{ env.UNIQUE_ID }}" - if [ -z "$unique_id" ]; then - echo "No unique_id found. Skipping data release." - exit 0 - fi - - echo "Releasing data for unique_id: $unique_id" - response=$(curl -s -X POST "http://localhost:3000/data/release/$unique_id") - echo "Data release response: $response" - \ No newline at end of file + git clone https://github.com/dappnode/staker-test-util + cd staker-test-util + LOG_LEVEL=DEBUG go run cmd/main.go --ipfs-gateway-url=https://gateway-dev.ipfs.dappnode.io --tropidatooor-url=http://localhost:3000 --ipfs-hash=${{ env.IPFS_HASH }} From e538a96cfa5232390a15dcf1790c2df28344dac3 Mon Sep 17 00:00:00 2001 From: pablomendezroyo Date: Tue, 3 Jun 2025 12:08:46 +0200 Subject: [PATCH 15/17] run binary locally --- .github/workflows/e2e.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index f558344..d7cd05e 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -41,6 +41,5 @@ jobs: - name: Run staker client test sdk run: | - git clone https://github.com/dappnode/staker-test-util - cd staker-test-util + cd /home/pablo/staker-test-util LOG_LEVEL=DEBUG go run cmd/main.go --ipfs-gateway-url=https://gateway-dev.ipfs.dappnode.io --tropidatooor-url=http://localhost:3000 --ipfs-hash=${{ env.IPFS_HASH }} From 2ccec0b6e7a0d33873e91cf0017742119375dd97 Mon Sep 17 00:00:00 2001 From: pablomendezroyo Date: Tue, 3 Jun 2025 12:11:23 +0200 Subject: [PATCH 16/17] setup go --- .github/workflows/e2e.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index d7cd05e..ea94cf9 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -15,6 +15,10 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: "1.24.3" - name: Build DAppNode Package run: | From eba47dbe1a7b1015df1f6262c3b23b7ec5047a25 Mon Sep 17 00:00:00 2001 From: pablomendezroyo Date: Tue, 3 Jun 2025 12:19:54 +0200 Subject: [PATCH 17/17] remove requirements for test --- dappnode_package.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/dappnode_package.json b/dappnode_package.json index 2b029ed..593e780 100644 --- a/dappnode_package.json +++ b/dappnode_package.json @@ -32,8 +32,5 @@ }, "bugs": { "url": "https://github.com/dappnode/DAppNodePackage-geth-generic/issues" - }, - "requirements": { - "minimumDappnodeVersion": "0.2.106" } }