Skip to content

Commit d2fe873

Browse files
authored
Merge branch 'main' into 00918-update-vcpkg
2 parents 3eb1d9a + a19622d commit d2fe873

24 files changed

+989
-52
lines changed

.github/CODEOWNERS

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,30 @@
1111
# NOTE: Must be placed last to ensure enforcement over all other rules
1212

1313
# Protection Rules for Github Configuration Files and Actions Workflows
14-
/.github/ @hiero-ledger/github-committers @hiero-ledger/github-maintainers
15-
/.github/workflows/ @hiero-ledger/github-committers @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
14+
/.github/ @hiero-ledger/github-maintainers
15+
/.github/workflows/ @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
1616

1717
# Cmake project files and inline plugins
18-
**/.clang* @hiero-ledger/github-committers @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
19-
**/.clang-format @hiero-ledger/github-committers @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
20-
**/.clang-tidy @hiero-ledger/github-committers @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
21-
**/CMakeLists.txt @hiero-ledger/github-committers @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
22-
**/CMakePresets.json @hiero-ledger/github-committers @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
18+
**/.clang* @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
19+
**/.clang-format @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
20+
**/.clang-tidy @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
21+
**/CMakeLists.txt @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
22+
**/CMakePresets.json @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
2323

2424
# Codacy Tool Configurations
25-
/config/ @hiero-ledger/github-committers @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
26-
.remarkrc @hiero-ledger/github-committers @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
25+
/config/ @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
26+
.remarkrc @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
2727

2828
# Self-protection for root CODEOWNERS files (this file should not exist and should definitely require approval)
29-
/CODEOWNERS @hiero-ledger/github-committers @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
29+
/CODEOWNERS @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
3030

3131
# Protect the repository root files
32-
/README.md @hiero-ledger/github-committers @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
32+
/README.md @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
3333
**/LICENSE @hiero-ledger/github-maintainers @hiero-ledger/tsc
3434

3535
# CodeCov configuration
3636
**/codecov.yml @hiero-ledger/github-maintainers
3737

3838
# Git Ignore definitions
39-
**/.gitignore @hiero-ledger/github-committers @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
40-
**/.gitignore.* @hiero-ledger/github-committers @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
39+
**/.gitignore @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers
40+
**/.gitignore.* @hiero-ledger/github-maintainers @hiero-ledger/hiero-sdk-cpp-maintainers @hiero-ledger/hiero-sdk-cpp-committers

.github/workflows/zxc-build-library.yaml

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,32 @@ permissions:
3636
contents: read
3737

3838
jobs:
39+
lint:
40+
name: Lint
41+
runs-on: hiero-client-sdk-linux-large
42+
strategy:
43+
matrix:
44+
include:
45+
- type: sdk
46+
check-path: "src/sdk/main"
47+
- type: tck
48+
check-path: "src/tck"
49+
50+
steps:
51+
- name: Harden Runner
52+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
53+
with:
54+
egress-policy: audit
55+
56+
- name: Checkout Code
57+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
58+
59+
- name: Run Clang-Format
60+
uses: jidicula/clang-format-action@4726374d1aa3c6aecf132e5197e498979588ebc8 # v4.15.0
61+
with:
62+
clang-format-version: "17"
63+
check-path: ${{ matrix.check-path }}
64+
3965
build:
4066
name: Build
4167
runs-on: hiero-client-sdk-linux-large
@@ -50,7 +76,7 @@ jobs:
5076

5177
steps:
5278
- name: Harden Runner
53-
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
79+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
5480
with:
5581
egress-policy: audit
5682

@@ -101,7 +127,7 @@ jobs:
101127
submodules: true
102128

103129
- name: Use Node.js 22
104-
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
130+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
105131
with:
106132
node-version: 22
107133

@@ -156,7 +182,7 @@ jobs:
156182
run: sudo npm install -g @hashgraph/solo@0.34.0
157183

158184
- name: Install Solo Required Tools
159-
run: |
185+
run: |
160186
sudo curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
161187
sudo chmod +x ./kubectl
162188
sudo mv ./kubectl /usr/local/bin/kubectl
@@ -195,7 +221,7 @@ jobs:
195221

196222
- name: Attach Artifact
197223
if: github.event.pull_request.merged == true
198-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
224+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
199225
with:
200226
name: hapi-library-${{ runner.os }}-${{ steps.sha.outputs.short }}
201227
path: package/
@@ -211,7 +237,7 @@ jobs:
211237

212238
steps:
213239
- name: Harden Runner
214-
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
240+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
215241
with:
216242
egress-policy: audit
217243

@@ -257,7 +283,7 @@ jobs:
257283
Add-Content -Path $env:GITHUB_OUTPUT -Value "short=$short"
258284
259285
- name: Attach Artifact
260-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
286+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
261287
with:
262288
name: hapi-library-${{ runner.os }}-${{ steps.sha.outputs.short }}
263289
path: package/
@@ -272,7 +298,7 @@ jobs:
272298

273299
steps:
274300
- name: Harden Runner
275-
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
301+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
276302
with:
277303
egress-policy: audit
278304

@@ -294,14 +320,14 @@ jobs:
294320
run: |
295321
cmake --preset macos-arm64-release
296322
cmake --build --preset macos-arm64-release -j 4
297-
323+
298324
- name: Compute Short SHA
299325
id: sha
300326
run: echo "short=$(echo -n "${{ github.sha }}" | cut -c1-8)" >> $GITHUB_OUTPUT
301327

302328
- name: Attach Artifact
303-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
329+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
304330
with:
305331
name: hapi-library-${{ runner.os }}-${{ steps.sha.outputs.short }}
306332
path: package/
307-
if-no-files-found: warn
333+
if-no-files-found: warn

MAINTAINERS.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Maintainers
2+
3+
The general handling of Maintainer rights and all groups in this GitHub org is done in the https://github.com/hiero-ledger/governance repository.
4+
5+
## Maintainer Scopes, GitHub Roles and GitHub Teams
6+
7+
Maintainers are assigned the following scopes in this repository:
8+
9+
| Scope | Definition | GitHub Role | GitHub Team |
10+
| ---------- | ------------------------ | ----------- | ---------------------------------- |
11+
| Maintainer | The GitHub Maintain role | Maintain | `hiero-sdk-cpp-maintainers` |
12+
13+
## Active Maintainers
14+
15+
<!-- Please keep this sorted alphabetically by github -->
16+
17+
| Name | GitHub ID | Scope | LFID | Discord ID | Email | Company Affiliation |
18+
|----- | --------- | ----- | ---- | ---------- | ----- | ------------------- |
19+
| | | | | | | |
20+
21+
22+
## Emeritus Maintainers
23+
24+
| Name | GitHub ID | Scope | LFID | Discord ID | Email | Company Affiliation |
25+
|----- | --------- | ----- | ---- | ---------- | ----- | ------------------- |
26+
| | | | | | | |
27+
28+
## The Duties of a Maintainer
29+
30+
Maintainers are expected to perform the following duties for this repository. The duties are listed in more or less priority order:
31+
32+
- Review, respond, and act on any security vulnerabilities reported against the repository.
33+
- Review, provide feedback on, and merge or reject GitHub Pull Requests from
34+
Contributors.
35+
- Review, triage, comment on, and close GitHub Issues
36+
submitted by Contributors.
37+
- When appropriate, lead/facilitate architectural discussions in the community.
38+
- When appropriate, lead/facilitate the creation of a product roadmap.
39+
- Create, clarify, and label issues to be worked on by Contributors.
40+
- Ensure that there is a well defined (and ideally automated) product test and
41+
release pipeline, including the publication of release artifacts.
42+
- When appropriate, execute the product release process.
43+
- Maintain the repository CONTRIBUTING.md file and getting started documents to
44+
give guidance and encouragement to those wanting to contribute to the product, and those wanting to become maintainers.
45+
- Contribute to the product via GitHub Pull Requests.
46+
- Monitor requests from the LF Decentralized Trust Technical Advisory Council about the
47+
contents and management of LFDT repositories, such as branch handling,
48+
required files in repositories and so on.
49+
- Contribute to the LFDT Project's Quarterly Report.
50+
51+
## Becoming a Maintainer
52+
53+
This community welcomes contributions. Interested contributors are encouraged to
54+
progress to become maintainers. To become a maintainer the following steps
55+
occur, roughly in order.
56+
57+
- The proposed maintainer establishes their reputation in the community,
58+
including authoring five (5) significant merged pull requests, and expresses
59+
an interest in becoming a maintainer for the repository.
60+
- A PR is created to update this file to add the proposed maintainer to the list of active maintainers.
61+
- The PR is authored by an existing maintainer or has a comment on the PR from an existing maintainer supporting the proposal.
62+
- The PR is authored by the proposed maintainer or has a comment on the PR from the proposed maintainer confirming their interest in being a maintainer.
63+
- The PR or comment from the proposed maintainer must include their
64+
willingness to be a long-term (more than 6 month) maintainer.
65+
- Once the PR and necessary comments have been received, an approval timeframe begins.
66+
- The PR **MUST** be communicated on all appropriate communication channels, including relevant community calls, chat channels and mailing lists. Comments of support from the community are welcome.
67+
- The PR is merged and the proposed maintainer becomes a maintainer if either:
68+
- Two weeks have passed since at least three (3) Maintainer PR approvals have been recorded, OR
69+
- An absolute majority of maintainers have approved the PR.
70+
- If the PR does not get the requisite PR approvals, it may be closed.
71+
- Once the add maintainer PR has been merged, any necessary updates to the GitHub Teams are made.
72+
73+
## Removing Maintainers
74+
75+
Being a maintainer is not a status symbol or a title to be carried
76+
indefinitely. It will occasionally be necessary and appropriate to move a
77+
maintainer to emeritus status. This can occur in the following situations:
78+
79+
- Resignation of a maintainer.
80+
- Violation of the Code of Conduct warranting removal.
81+
- Inactivity.
82+
- A general measure of inactivity will be no commits or code review comments
83+
for one reporting quarter. This will not be strictly enforced if
84+
the maintainer expresses a reasonable intent to continue contributing.
85+
- Reasonable exceptions to inactivity will be granted for known long term
86+
leave such as parental leave and medical leave.
87+
- Other circumstances at the discretion of the other Maintainers.
88+
89+
The process to move a maintainer from active to emeritus status is comparable to the process for adding a maintainer, outlined above. In the case of voluntary
90+
resignation, the Pull Request can be merged following a maintainer PR approval. If the removal is for any other reason, the following steps **SHOULD** be followed:
91+
92+
- A PR is created to update this file to move the maintainer to the list of emeritus maintainers.
93+
- The PR is authored by, or has a comment supporting the proposal from, an existing maintainer or a member of the project's Technical Steering Commitee (TSC).
94+
- Once the PR and necessary comments have been received, the approval timeframe begins.
95+
- The PR **MAY** be communicated on appropriate communication channels, including relevant community calls, chat channels and mailing lists.
96+
- The PR is merged and the maintainer transitions to maintainer emeritus if:
97+
- The PR is approved by the maintainer to be transitioned, OR
98+
- Two weeks have passed since at least three (3) Maintainer PR approvals have been recorded, OR
99+
- An absolute majority of maintainers have approved the PR.
100+
- If the PR does not get the requisite PR approvals, it may be closed.
101+
102+
Returning to active status from emeritus status uses the same steps as adding a
103+
new maintainer. Note that the emeritus maintainer already has the 5 required
104+
significant changes as there is no contribution time horizon for those.

src/sdk/examples/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ set(REVENUE_GENERATING_TOPICS_EXAMPLE_NAME ${PROJECT_NAME}-revenue-generating-to
4848
set(SCHEDULE_EXAMPLE_NAME ${PROJECT_NAME}-schedule-example)
4949
set(SCHEDULE_IDENTICAL_TRANSACTION_EXAMPLE_NAME ${PROJECT_NAME}-schedule-identical-transaction-example)
5050
set(SCHEDULE_MULTI_SIG_TRANSACTION_EXAMPLE_NAME ${PROJECT_NAME}-schedule-multisig-transaction-example)
51+
set(SCHEDULE_NETWORK_UPDATE_EXAMPLE_NAME ${PROJECT_NAME}-schedule-network-update-example)
5152
set(SCHEDULE_TRANSACTION_MULTI_SIG_TRANSACTION_EXAMPLE_NAME ${PROJECT_NAME}-schedule-transaction-multisig-threshold-example)
5253
set(SCHEDULE_TRANSFER_EXAMPLE_NAME ${PROJECT_NAME}-schedule-transfer-example)
5354
set(SIGN_TRANSACTION_EXAMPLE_NAME ${PROJECT_NAME}-sign-transaction-example)
@@ -106,6 +107,7 @@ add_executable(${REVENUE_GENERATING_TOPICS_EXAMPLE_NAME} RevenueGeneratingTopics
106107
add_executable(${SCHEDULE_EXAMPLE_NAME} ScheduleExample.cc)
107108
add_executable(${SCHEDULE_IDENTICAL_TRANSACTION_EXAMPLE_NAME} ScheduleIdenticalTransactionExample.cc)
108109
add_executable(${SCHEDULE_MULTI_SIG_TRANSACTION_EXAMPLE_NAME} ScheduleMultiSigTransactionExample.cc)
110+
add_executable(${SCHEDULE_NETWORK_UPDATE_EXAMPLE_NAME} ScheduleNetworkUpdateExample.cc)
109111
add_executable(${SCHEDULE_TRANSACTION_MULTI_SIG_TRANSACTION_EXAMPLE_NAME} ScheduleTransactionMultiSigThresholdExample.cc)
110112
add_executable(${SCHEDULE_TRANSFER_EXAMPLE_NAME} ScheduleTransferExample.cc)
111113
add_executable(${SIGN_TRANSACTION_EXAMPLE_NAME} SignTransactionExample.cc)
@@ -186,6 +188,7 @@ target_link_libraries(${REVENUE_GENERATING_TOPICS_EXAMPLE_NAME} PUBLIC ${PROJECT
186188
target_link_libraries(${SCHEDULE_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
187189
target_link_libraries(${SCHEDULE_IDENTICAL_TRANSACTION_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
188190
target_link_libraries(${SCHEDULE_MULTI_SIG_TRANSACTION_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
191+
target_link_libraries(${SCHEDULE_NETWORK_UPDATE_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
189192
target_link_libraries(${SCHEDULE_TRANSACTION_MULTI_SIG_TRANSACTION_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
190193
target_link_libraries(${SCHEDULE_TRANSFER_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
191194
target_link_libraries(${SIGN_TRANSACTION_EXAMPLE_NAME} PUBLIC ${PROJECT_NAME})
@@ -246,6 +249,7 @@ install(TARGETS
246249
${SCHEDULE_EXAMPLE_NAME}
247250
${SCHEDULE_IDENTICAL_TRANSACTION_EXAMPLE_NAME}
248251
${SCHEDULE_MULTI_SIG_TRANSACTION_EXAMPLE_NAME}
252+
${SCHEDULE_NETWORK_UPDATE_EXAMPLE_NAME}
249253
${SCHEDULE_TRANSACTION_MULTI_SIG_TRANSACTION_EXAMPLE_NAME}
250254
${SCHEDULE_TRANSFER_EXAMPLE_NAME}
251255
${SIGN_TRANSACTION_EXAMPLE_NAME}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
#include "AccountId.h"
3+
#include "Client.h"
4+
#include "ED25519PrivateKey.h"
5+
6+
#include <chrono>
7+
#include <dotenv.h>
8+
#include <iostream>
9+
#include <thread>
10+
11+
using namespace Hiero;
12+
13+
int main(int argc, char** argv)
14+
{
15+
dotenv::init();
16+
const AccountId operatorAccountId = AccountId::fromString(std::getenv("OPERATOR_ID"));
17+
const std::shared_ptr<PrivateKey> operatorPrivateKey = ED25519PrivateKey::fromString(std::getenv("OPERATOR_KEY"));
18+
19+
/*
20+
* Step 1: Initialize the client.
21+
* Note: By default, the first network address book update will be executed now
22+
* and subsequent updates will occur every 24 hours.
23+
* This is controlled by network update period, which defaults to 24 hours.
24+
*/
25+
Client client = Client::forTestnet();
26+
27+
const auto defaultNetworkUpdatePeriod = client.getNetworkUpdatePeriod();
28+
std::cout << "The network update period is " << defaultNetworkUpdatePeriod.count() << " seconds" << std::endl;
29+
30+
/*
31+
* Step 2: Change network update period to 1 hour
32+
*/
33+
const auto newNetworkUpdatePeriod = std::chrono::hours(1);
34+
client.setNetworkUpdatePeriod(newNetworkUpdatePeriod);
35+
std::cout << "Changed the network update period to " << defaultNetworkUpdatePeriod.count() << " hour" << std::endl;
36+
37+
/*
38+
* Step 3: Wait for 1 hour
39+
*/
40+
std::cout << "Waiting for 1 hour..." << std::endl;
41+
std::this_thread::sleep_for(std::chrono::hours(1));
42+
std::cout << "1 hour elapsed." << std::endl;
43+
44+
/*
45+
* Step 4: Display client network
46+
*/
47+
for (const auto node : client.getNetwork())
48+
{
49+
std::cout << "Node address: " << node.first << " Node account: " << node.second.toString() << std::endl;
50+
}
51+
52+
return 0;
53+
}

src/sdk/main/src/Client.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,6 @@ void Client::scheduleNetworkUpdate()
10821082
break;
10831083
}
10841084
}
1085-
10861085
// The network update was cancelled, stop looping.
10871086
else
10881087
{

0 commit comments

Comments
 (0)