From 363ae7324c51f9240c948d68b5443d7e215cfddb Mon Sep 17 00:00:00 2001 From: Firdous2307 <124298708+Firdous2307@users.noreply.github.com> Date: Tue, 8 Oct 2024 19:07:13 +0100 Subject: [PATCH 01/12] feat: Add installRelay parameter to action.yml --- action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/action.yml b/action.yml index c9769c0..9865a16 100644 --- a/action.yml +++ b/action.yml @@ -6,6 +6,10 @@ inputs: required: true default: false type: boolean + installRelay: + description: 'Install JSON-RPC-Relay' + required: false + default: false outputs: accountId: description: "Hedera account id for a new account" From 0b072e399d873c731bfecfe3e9fcc94c4e97db91 Mon Sep 17 00:00:00 2001 From: Firdous2307 <124298708+Firdous2307@users.noreply.github.com> Date: Tue, 8 Oct 2024 19:15:10 +0100 Subject: [PATCH 02/12] feat: Implement relay installation logic in setup.sh --- setup.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 setup.sh diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..b394f5d --- /dev/null +++ b/setup.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Install JSON-RPC-Relay if requested +if [ "$INPUT_INSTALLRELAY" = "true" ]; then + echo "Installing JSON-RPC-Relay..." + solo relay deploy + if [ $? -ne 0 ]; then + echo "Failed to install JSON-RPC-Relay" + exit 1 + fi + echo "JSON-RPC-Relay installed successfully" +fi From a922030f6b39ca24ed07ead94d0d6f09f041dc70 Mon Sep 17 00:00:00 2001 From: Firdous2307 <124298708+Firdous2307@users.noreply.github.com> Date: Tue, 8 Oct 2024 19:15:32 +0100 Subject: [PATCH 03/12] docs: Update README with installRelay parameter --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 81d52c9..a2bd93d 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,9 @@ The GitHub action takes the following inputs: If set to `true`, the action will install a mirror node in addition to the main node. The mirror node can be accessed at `localhost:8080`. +- `installRelay`: A boolean parameter that is `false` by default. + If set to `true`, the action will install a JSON-RPC-Relay in addition to the main node. + ## Outputs The GitHub action outputs the following information: From a4271905b27ed0bdc30e81716772d06870474ecf Mon Sep 17 00:00:00 2001 From: Firdous2307 <124298708+Firdous2307@users.noreply.github.com> Date: Tue, 8 Oct 2024 19:23:26 +0100 Subject: [PATCH 04/12] docs: Enhance README with installRelay parameter information --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a2bd93d..970e938 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,15 @@ The GitHub action takes the following inputs: If set to `true`, the action will install a mirror node in addition to the main node. The mirror node can be accessed at `localhost:8080`. +| Input | Description | Required | Default | +|----------------|-------------------------------|----------|---------| +| ... | ... | ... | ... | +| `installRelay` | Install JSON-RPC-Relay | false | false | + +... + - `installRelay`: A boolean parameter that is `false` by default. - If set to `true`, the action will install a JSON-RPC-Relay in addition to the main node. + If set to `true`, the action will install the JSON-RPC-Relay as part of the setup process. This allows you to easily add a relay to your Hedera network setup. The relay is installed using the `solo relay deploy` command. ## Outputs From 2af65eda3c2abad49bcdc2e91fcb66c0de77c6f8 Mon Sep 17 00:00:00 2001 From: Firdous2307 <124298708+Firdous2307@users.noreply.github.com> Date: Tue, 8 Oct 2024 21:52:38 +0100 Subject: [PATCH 05/12] test: Add workflows for various Hedera Solo configurations --- .github/workflows/mirrorNode-relay.yml | 26 ++++++++++++++++++++++++++ .github/workflows/relay.yml | 24 ++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/mirrorNode-relay.yml create mode 100644 .github/workflows/relay.yml diff --git a/.github/workflows/mirrorNode-relay.yml b/.github/workflows/mirrorNode-relay.yml new file mode 100644 index 0000000..633b1fe --- /dev/null +++ b/.github/workflows/mirrorNode-relay.yml @@ -0,0 +1,26 @@ +name: With Mirror Node and Relay + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Setup Hedera Solo + uses: ./ + with: + installMirrorNode: true + installRelay: true + id: solo + + - name: Use Hedera Solo + run: | + echo "Account ID: ${{ steps.solo.outputs.accountId }}" + echo "Private Key: ${{ steps.solo.outputs.privateKey }}" + echo "Public Key: ${{ steps.solo.outputs.publicKey }}" + curl -X 'GET' 'http://localhost:8080/api/v1/network/nodes' -H 'accept: application/json' + solo relay status \ No newline at end of file diff --git a/.github/workflows/relay.yml b/.github/workflows/relay.yml new file mode 100644 index 0000000..831bfd7 --- /dev/null +++ b/.github/workflows/relay.yml @@ -0,0 +1,24 @@ +name: With Relay + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Setup Hedera Solo + uses: ./ + with: + installRelay: true + id: solo + + - name: Use Hedera Solo + run: | + echo "Account ID: ${{ steps.solo.outputs.accountId }}" + echo "Private Key: ${{ steps.solo.outputs.privateKey }}" + echo "Public Key: ${{ steps.solo.outputs.publicKey }}" + solo relay status \ No newline at end of file From 460f607bbeef9247b7a2448bca930ff0b5650dc2 Mon Sep 17 00:00:00 2001 From: Firdous2307 <124298708+Firdous2307@users.noreply.github.com> Date: Tue, 8 Oct 2024 22:06:27 +0100 Subject: [PATCH 06/12] fix: new names for workflow files --- .../workflows/{mirrorNode-relay.yml => mirror-node-and-relay.yml} | 0 .github/workflows/{relay.yml => relay-only.yml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{mirrorNode-relay.yml => mirror-node-and-relay.yml} (100%) rename .github/workflows/{relay.yml => relay-only.yml} (100%) diff --git a/.github/workflows/mirrorNode-relay.yml b/.github/workflows/mirror-node-and-relay.yml similarity index 100% rename from .github/workflows/mirrorNode-relay.yml rename to .github/workflows/mirror-node-and-relay.yml diff --git a/.github/workflows/relay.yml b/.github/workflows/relay-only.yml similarity index 100% rename from .github/workflows/relay.yml rename to .github/workflows/relay-only.yml From 1ed37343186048f478f95b30e94ec704a4bae5ed Mon Sep 17 00:00:00 2001 From: Firdous2307 <124298708+Firdous2307@users.noreply.github.com> Date: Tue, 8 Oct 2024 22:19:11 +0100 Subject: [PATCH 07/12] chore: Remove redundant workflow files --- .github/workflows/mirror-node-and-relay.yml | 26 --------------------- .github/workflows/relay-only.yml | 24 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 .github/workflows/mirror-node-and-relay.yml delete mode 100644 .github/workflows/relay-only.yml diff --git a/.github/workflows/mirror-node-and-relay.yml b/.github/workflows/mirror-node-and-relay.yml deleted file mode 100644 index 633b1fe..0000000 --- a/.github/workflows/mirror-node-and-relay.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: With Mirror Node and Relay - -on: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - - name: Setup Hedera Solo - uses: ./ - with: - installMirrorNode: true - installRelay: true - id: solo - - - name: Use Hedera Solo - run: | - echo "Account ID: ${{ steps.solo.outputs.accountId }}" - echo "Private Key: ${{ steps.solo.outputs.privateKey }}" - echo "Public Key: ${{ steps.solo.outputs.publicKey }}" - curl -X 'GET' 'http://localhost:8080/api/v1/network/nodes' -H 'accept: application/json' - solo relay status \ No newline at end of file diff --git a/.github/workflows/relay-only.yml b/.github/workflows/relay-only.yml deleted file mode 100644 index 831bfd7..0000000 --- a/.github/workflows/relay-only.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: With Relay - -on: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - - name: Setup Hedera Solo - uses: ./ - with: - installRelay: true - id: solo - - - name: Use Hedera Solo - run: | - echo "Account ID: ${{ steps.solo.outputs.accountId }}" - echo "Private Key: ${{ steps.solo.outputs.privateKey }}" - echo "Public Key: ${{ steps.solo.outputs.publicKey }}" - solo relay status \ No newline at end of file From d6aed50d4fb41bb2d836e2e103449559aac65660 Mon Sep 17 00:00:00 2001 From: Firdous2307 <124298708+Firdous2307@users.noreply.github.com> Date: Tue, 8 Oct 2024 22:24:12 +0100 Subject: [PATCH 08/12] test: Set JSON-RPC-Relay installation to true for testing --- action.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 9865a16..08c2535 100644 --- a/action.yml +++ b/action.yml @@ -9,7 +9,8 @@ inputs: installRelay: description: 'Install JSON-RPC-Relay' required: false - default: false + default: true + type: boolean outputs: accountId: description: "Hedera account id for a new account" @@ -79,6 +80,14 @@ runs: solo mirror-node deploy kubectl port-forward svc/fullstack-deployment-hedera-explorer -n solo-test 8080:80 & + - name: Setup and Deploy Relay + shell: bash + run: | + chmod +x ${{ github.action_path }}/setup.sh + ${{ github.action_path }}/setup.sh + env: + INPUT_INSTALLRELAY: ${{ inputs.installRelay }} + - name: Create account id: create-account shell: bash From d4fd81e407855b7d008962c1de20be50e0fa2182 Mon Sep 17 00:00:00 2001 From: Firdous2307 <124298708+Firdous2307@users.noreply.github.com> Date: Tue, 8 Oct 2024 22:49:45 +0100 Subject: [PATCH 09/12] feat: Set JSON-RPC-Relay installation to false by default --- README.md | 3 --- action.yml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 970e938..04fcf5d 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,8 @@ The GitHub action takes the following inputs: | Input | Description | Required | Default | |----------------|-------------------------------|----------|---------| -| ... | ... | ... | ... | | `installRelay` | Install JSON-RPC-Relay | false | false | -... - - `installRelay`: A boolean parameter that is `false` by default. If set to `true`, the action will install the JSON-RPC-Relay as part of the setup process. This allows you to easily add a relay to your Hedera network setup. The relay is installed using the `solo relay deploy` command. diff --git a/action.yml b/action.yml index 08c2535..21183f7 100644 --- a/action.yml +++ b/action.yml @@ -9,7 +9,7 @@ inputs: installRelay: description: 'Install JSON-RPC-Relay' required: false - default: true + default: false type: boolean outputs: accountId: From 69b5abd065bf8b44de99748535578952d388083e Mon Sep 17 00:00:00 2001 From: Firdous2307 <124298708+Firdous2307@users.noreply.github.com> Date: Fri, 11 Oct 2024 22:50:01 +0100 Subject: [PATCH 10/12] refactor: use conditionals for installation --- action.yml | 11 ++++++----- setup.sh | 12 ------------ 2 files changed, 6 insertions(+), 17 deletions(-) delete mode 100644 setup.sh diff --git a/action.yml b/action.yml index 0019d02..fcab4a4 100644 --- a/action.yml +++ b/action.yml @@ -84,13 +84,14 @@ runs: solo mirror-node deploy kubectl port-forward svc/fullstack-deployment-hedera-explorer -n solo-test ${{ inputs.mirrorNodePort }}:80 & - - name: Setup and Deploy Relay + - name: Deploy JSON-RPC-Relay + if: ${{ inputs.installRelay == 'true' }} shell: bash run: | - chmod +x ${{ github.action_path }}/setup.sh - ${{ github.action_path }}/setup.sh - env: - INPUT_INSTALLRELAY: ${{ inputs.installRelay }} + echo "Installing JSON-RPC-Relay..." + solo relay deploy + echo "JSON-RPC-Relay installed successfully" + - name: Create account id: create-account diff --git a/setup.sh b/setup.sh deleted file mode 100644 index b394f5d..0000000 --- a/setup.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Install JSON-RPC-Relay if requested -if [ "$INPUT_INSTALLRELAY" = "true" ]; then - echo "Installing JSON-RPC-Relay..." - solo relay deploy - if [ $? -ne 0 ]; then - echo "Failed to install JSON-RPC-Relay" - exit 1 - fi - echo "JSON-RPC-Relay installed successfully" -fi From a0cf13783a180964fcc9d26c03eee15acae34d78 Mon Sep 17 00:00:00 2001 From: Firdous2307 <124298708+Firdous2307@users.noreply.github.com> Date: Fri, 11 Oct 2024 22:59:29 +0100 Subject: [PATCH 11/12] test: checking if json rpc relay is added to actions --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index fcab4a4..38d72e5 100644 --- a/action.yml +++ b/action.yml @@ -9,7 +9,7 @@ inputs: installRelay: description: 'Install JSON-RPC-Relay' required: false - default: false + default: true type: boolean mirrorNodePort : description : 'Port for Mirror Node' From 915d74723f62b85e82f88618e6dc58d7e9da8628 Mon Sep 17 00:00:00 2001 From: Firdous2307 <124298708+Firdous2307@users.noreply.github.com> Date: Fri, 11 Oct 2024 23:04:49 +0100 Subject: [PATCH 12/12] feat: Add JSON RPC relay parameter --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 38d72e5..fcab4a4 100644 --- a/action.yml +++ b/action.yml @@ -9,7 +9,7 @@ inputs: installRelay: description: 'Install JSON-RPC-Relay' required: false - default: true + default: false type: boolean mirrorNodePort : description : 'Port for Mirror Node'