Skip to content

Integrate Hiero Solo into PR Checks workflow #2311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 30 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,23 +174,23 @@ 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

- 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

Expand All @@ -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
Expand Down Expand Up @@ -234,30 +231,31 @@ 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

- 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
Expand Down Expand Up @@ -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
17 changes: 11 additions & 6 deletions .github/workflows/disabled/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, AccountId>();
network.put(LOCAL_CONSENSUS_NODE_ENDPOINT, LOCAL_CONSENSUS_NODE_ACCOUNT_ID);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class NodeCreateTransactionIntegrationTest {
void canCreateNewNetworkNode() throws Exception {
// Set the network
var network = new HashMap<String, AccountId>();
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(
Expand Down
Loading