diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9b43adc692..966238daaf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -174,8 +174,11 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1 - - name: Install Local Node - run: npm install -g @hashgraph/hedera-local + - name: Prepare Hiero Solo + id: solo + uses: hiero-ledger/hiero-solo-action@35efe2334bffb73298716402a5c688321ec29260 # v0.6 + with: + installMirrorNode: true - name: Build SDK run: ./gradlew assemble @@ -183,14 +186,11 @@ jobs: - name: Code Quality Checks run: ./gradlew qualityCheck :examples:qualityCheck --continue --rerun-tasks - - name: Start Local Node - run: npx @hashgraph/hedera-local start -d --network local --network-tag=0.61.1 - - name: Run Unit and Integration Tests env: - OPERATOR_KEY: "0xa608e2130a0a3cb34f86e757303c862bee353d9ab77ba4387ec084f881d420d4" - OPERATOR_ID: "0.0.1022" - HEDERA_NETWORK: "localhost" + OPERATOR_ID: ${{ steps.solo.outputs.accountId }} + OPERATOR_KEY: ${{ steps.solo.outputs.privateKey }} + HEDERA_NETWORK: solo run: | ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK :aggregation:testCodeCoverageReport @@ -200,9 +200,6 @@ jobs: with: files: gradle/aggregation/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml - - name: Stop the local node - run: npx @hashgraph/hedera-local stop - run-examples: name: Run Examples runs-on: hiero-client-sdk-linux-medium @@ -234,8 +231,11 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1 - - name: Install Local Node - run: npm install -g @hashgraph/hedera-local + - name: Prepare Hiero Solo + id: solo + uses: hiero-ledger/hiero-solo-action@35efe2334bffb73298716402a5c688321ec29260 # v0.6 + with: + installMirrorNode: true - name: Build SDK run: ./gradlew assemble @@ -243,21 +243,19 @@ jobs: - name: Build Android Example run: ./gradlew -p example-android assemble - - name: Start the local node - run: npx @hashgraph/hedera-local start -d --network local --network-tag=0.61.1 - - name: Prepare .env for Examples run: | - echo "OPERATOR_KEY=0xa608e2130a0a3cb34f86e757303c862bee353d9ab77ba4387ec084f881d420d4" > examples/.env - echo "OPERATOR_ID=0.0.1022" >> examples/.env - echo "HEDERA_NETWORK=localhost" >> examples/.env + echo "OPERATOR_KEY=${{ steps.solo.outputs.privateKey }}" > examples/.env + echo "OPERATOR_ID=${{ steps.solo.outputs.accountId }}" >> examples/.env + echo "HEDERA_NETWORK=solo" >> examples/.env - name: Run Examples + env: + OPERATOR_ID: ${{ steps.solo.outputs.accountId }} + OPERATOR_KEY: ${{ steps.solo.outputs.privateKey }} + HEDERA_NETWORK: solo run: ./gradlew :examples:runAllExamples - - name: Stop the local node - run: npx @hashgraph/hedera-local stop - test-tck: name: TCK Tests runs-on: hiero-client-sdk-linux-medium @@ -288,17 +286,18 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1 - - name: Install Local Node - run: npm install -g @hashgraph/hedera-local + - name: Prepare Hiero Solo + id: solo + uses: hiero-ledger/hiero-solo-action@35efe2334bffb73298716402a5c688321ec29260 # v0.6 + with: + installMirrorNode: true - name: Build TCK run: ./gradlew assemble - - name: Start Local Node - run: npx @hashgraph/hedera-local start -d --network local - - name: Run TCK Unit Tests - run: ./gradlew :tck:test - - - name: Stop the local node - run: npx @hashgraph/hedera-local stop + env: + OPERATOR_ID: ${{ steps.solo.outputs.accountId }} + OPERATOR_KEY: ${{ steps.solo.outputs.privateKey }} + HEDERA_NETWORK: solo + run: ./gradlew -POPERATOR_ID=$OPERATOR_ID -POPERATOR_KEY=$OPERATOR_KEY -PHEDERA_NETWORK=$HEDERA_NETWORK :tck:test diff --git a/.github/workflows/disabled/main.yml b/.github/workflows/disabled/main.yml index c390b2713e..72c238c56a 100644 --- a/.github/workflows/disabled/main.yml +++ b/.github/workflows/disabled/main.yml @@ -59,14 +59,19 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: path: hedera-sdk-java + + - name: Prepare Hiero Solo + id: solo + uses: hiero-ledger/hiero-solo-action@35efe2334bffb73298716402a5c688321ec29260 # v0.6 + with: + installMirrorNode: true + - name: Run Hedera SDK Tests timeout-minutes: 30 env: - OPERATOR_KEY: "302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137" - OPERATOR_ID: "0.0.2" - HEDERA_NETWORK: "localhost" + OPERATOR_ID: ${{ steps.solo.outputs.accountId }} + OPERATOR_KEY: ${{ steps.solo.outputs.privateKey }} + HEDERA_NETWORK: solo run: | - cd hedera-services - docker-compose up & - cd ../hedera-sdk-java + cd hedera-sdk-java ./gradlew -PHEDERA_NETWORK=$HEDERA_NETWORK -POPERATOR_KEY=$OPERATOR_KEY -POPERATOR_ID=$OPERATOR_ID testIntegration diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ClientHelper.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ClientHelper.java index 55aa034898..7704dc5dcb 100644 --- a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ClientHelper.java +++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/ClientHelper.java @@ -8,7 +8,7 @@ public class ClientHelper { - public static final String LOCAL_NETWORK_NAME = "localhost"; + public static final String LOCAL_NETWORK_NAME = "solo"; private static final String LOCAL_CONSENSUS_NODE_ENDPOINT = "127.0.0.1:50211"; diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountCreateIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountCreateIntegrationTest.java index e1ddf11af5..33438d7d29 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountCreateIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/AccountCreateIntegrationTest.java @@ -436,11 +436,12 @@ void createAccountUsingSetKeyWithAliasAccountShouldHaveKeyAsKeyAndECDSAKEyAsAlia } @Test - @DisplayName("Can create account using setKeyWithoutAlias, account should have key as key and no alias") - void createAccountUsingSetKeyWithoutAliasAccountShouldHaveKeyAsKeyAndNoAlias() throws Exception { + @DisplayName("Can create account using setKeyWithoutAlias, account should have key as key and expected alias") + void createAccountUsingSetKeyWithoutAliasAccountShouldHaveKeyAsKeyAndExpectedAlias() throws Exception { try (var testEnv = new IntegrationTestEnv(1)) { var key = PrivateKey.generateECDSA(); + var evmAddress = key.getPublicKey().toEvmAddress(); var accountId = new AccountCreateTransaction() .setReceiverSignatureRequired(true) @@ -457,7 +458,7 @@ void createAccountUsingSetKeyWithoutAliasAccountShouldHaveKeyAsKeyAndNoAlias() t assertThat(info.accountId).isNotNull(); assertThat(info.key).isEqualTo(key.getPublicKey()); - assertTrue(isLongZeroAddress(Hex.decode(info.contractAccountId))); + assertThat(info.contractAccountId).hasToString(evmAddress.toString()); } } diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/IntegrationTestEnv.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/IntegrationTestEnv.java index 77f028105e..03f4383f3e 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/IntegrationTestEnv.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/IntegrationTestEnv.java @@ -83,7 +83,7 @@ private static Client createTestEnvClient() throws Exception { return Client.forPreviewnet(); } else if (System.getProperty("HEDERA_NETWORK").equals("testnet")) { return Client.forTestnet(); - } else if (System.getProperty("HEDERA_NETWORK").equals("localhost")) { + } else if (System.getProperty("HEDERA_NETWORK").equals("solo")) { var network = new HashMap(); network.put(LOCAL_CONSENSUS_NODE_ENDPOINT, LOCAL_CONSENSUS_NODE_ACCOUNT_ID); diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NodeCreateTransactionIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NodeCreateTransactionIntegrationTest.java index ecae9374c6..c5d89f5781 100644 --- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NodeCreateTransactionIntegrationTest.java +++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/NodeCreateTransactionIntegrationTest.java @@ -26,9 +26,9 @@ class NodeCreateTransactionIntegrationTest { void canCreateNewNetworkNode() throws Exception { // Set the network var network = new HashMap(); - network.put("localhost:50211", LOCAL_CONSENSUS_NODE_ACCOUNT_ID); + network.put("solo", LOCAL_CONSENSUS_NODE_ACCOUNT_ID); - try (var client = Client.forNetwork(network).setMirrorNetwork(List.of("localhost:5600"))) { + try (var client = Client.forNetwork(network).setMirrorNetwork(List.of("solo"))) { // Set the operator to be account 0.0.2 var originalOperatorKey = PrivateKey.fromString(