Skip to content

Commit

Permalink
chore: Hiero renaming initial (#823)
Browse files Browse the repository at this point in the history
Signed-off-by: gsstoykov <[email protected]>
  • Loading branch information
gsstoykov authored Nov 22, 2024
1 parent c9cb13e commit e85ee2d
Show file tree
Hide file tree
Showing 706 changed files with 5,297 additions and 16,098 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OPERATOR_KEY=<PRIVATE_KEY>
OPERATOR_ID=<ACCOUNT_ID>
HEDERA_NETWORK=<NETWORK_NAME>
HIERO_NETWORK=<NETWORK_NAME>
CONFIG_FILE=<PATH_TO_CLIENT_CONFIG>
PASSPHRASE=<OPTIONAL_PASSWORD_FOR_MNEMONIC_GENERATION>
2 changes: 1 addition & 1 deletion .github/workflows/zxc-build-library.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: hiero-client-sdk-linux-large

env:
HEDERA_NETWORK: localhost
HIERO_NETWORK: localhost
strategy:
matrix:
include:
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.15...3.24)
project(hedera-sdk-cpp VERSION 0.1.0 DESCRIPTION "Hedera SDK C++" LANGUAGES CXX)
project(hiero-sdk-cpp VERSION 0.1.0 DESCRIPTION "Hiero SDK C++" LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -23,7 +23,7 @@ find_package(EXPAT CONFIG REQUIRED)

include(FetchContent)
include(SystemLibraries.cmake)
include(HederaApi.cmake)
include(HieroApi.cmake)

enable_testing()

Expand Down
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to the Hedera SDK for C++
# Contributing to the Hiero SDK for C++

Thank you for your interest in contributing the Hedera SDK for C++!
Thank you for your interest in contributing the Hiero SDK for C++!

We appreciate your interest in helping us and the rest of our community. We welcome bug reports, feature requests, and
code contributions.
Expand Down Expand Up @@ -129,7 +129,7 @@ It will populate the newly added tag in `origin`.

### Step 2 - Draft Release in GitHub

Open [Hedera C++ SDK](https://github.com/hashgraph/hedera-sdk-cpp) and search for `Create a new release` link.
Open [Hiero C++ SDK](https://github.com/hiero-ledger/hiero-sdk-cpp) and search for `Create a new release` link.
Select tag `v0.3.0` from the dropdown list. Enter the Release title to be same as the release number which is been
prepared (for example: `v0.3.0`).

Expand All @@ -146,7 +146,7 @@ emoji ➡️ followed by a description in plain English for each over-arching ne
#### Examples

This section should list all of the newly added examples. Each of them should represent a link to the implementation (
for example: [TransferTokensExample.cc](<(https://github.com/hashgraph/hedera-sdk-cpp/blob/main/src/sdk/examples/TransferTokensExample.cc)>). It's a good idea also to add prefix with ➡️ before
for example: [TransferTokensExample.cc](<(https://github.com/hiero-ledger/hiero-sdk-cpp/blob/main/src/sdk/examples/TransferTokensExample.cc)>). It's a good idea also to add prefix with ➡️ before
each line.

#### Notes
Expand All @@ -160,12 +160,12 @@ Here should be listed all of the Pull Requests (PRs) which are part of the relea

> (pull-request-title) by (@author) in (#link)

[issues]: https://github.com/hashgraph/hedera-sdk-cpp/issues
[label-bug]: https://github.com/hashgraph/hedera-sdk-cpp/labels/bug
[issues]: https://github.com/hiero-ledger/hiero-sdk-cpp/issues
[label-bug]: https://github.com/hiero-ledger/hiero-sdk-cpp/labels/bug
[mwe]: https://en.wikipedia.org/wiki/Minimal_Working_Example
[markdown]: https://guides.github.com/features/mastering-markdown/
[label-feature-enhancement]: https://github.com/hashgraph/hedera-sdk-cpp/labels/Feature%20Enhancement
[label-new-feature]: https://github.com/hashgraph/hedera-sdk-cpp/labels/New%20Feature
[pull-requests]: https://github.com/hashgraph/hedera-sdk-cpp/pulls
[license]: https://github.com/hashgraph/hedera-sdk-cpp/blob/main/LICENSE
[label-feature-enhancement]: https://github.com/hiero-ledger/hiero-sdk-cpp/labels/Feature%20Enhancement
[label-new-feature]: https://github.com/hiero-ledger/hiero-sdk-cpp/labels/New%20Feature
[pull-requests]: https://github.com/hiero-ledger/hiero-sdk-cpp/pulls
[license]: https://github.com/hiero-ledger/hiero-sdk-cpp/blob/main/LICENSE
[discord]: https://hedera.com/discord
2 changes: 1 addition & 1 deletion HederaApi.cmake → HieroApi.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(HAPI_VERSION_TAG "v0.55.0" CACHE STRING "Use the configured version tag for the Hedera API protobufs")
set(HAPI_VERSION_TAG "v0.55.0" CACHE STRING "Use the configured version tag for the Hiero API protobufs")

if (HAPI_VERSION_TAG STREQUAL "")
set(HAPI_VERSION_TAG "v0.55.0")
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2022 Hedera Hashgraph LLC
Copyright 2024 Hiero

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![](https://img.shields.io/badge/c++-17-blue)
![](https://img.shields.io/badge/cmake-3.24-blue)
[![](https://github.com/hashgraph/hedera-sdk-cpp/actions/workflows/flow-pull-request-checks.yaml/badge.svg)](https://github.com/hashgraph/hedera-sdk-cpp/actions/workflows/flow-pull-request-checks.yaml)
[![](https://github.com/hiero-ledger/hiero-sdk-cpp/actions/workflows/flow-pull-request-checks.yaml/badge.svg)](https://github.com/hiero-ledger/hiero-sdk-cpp/actions/workflows/flow-pull-request-checks.yaml)

The C++ SDK for interacting with a Hiero network.

Expand Down Expand Up @@ -155,8 +155,8 @@ located in the `addressbook/` and `config/` directories. Make sure your `.env` f

- `OPERATOR_ID`: The ID of the operator account.
- `OPERATOR_KEY`: The DER-encoded hex private key of the operator account.
- `HEDERA_NETWORK`: The Hedera network name. Must be one of `mainnet`, `testnet`, or `previewnet`.
- `PASSPHRASE`: Optional variable used by `hedera-sdk-cpp-generate-private-key-from-mnemonic-example` to generate a
- `HIERO_NETWORK`: The Hiero network name. Must be one of `mainnet`, `testnet`, or `previewnet`.
- `PASSPHRASE`: Optional variable used by `hiero-sdk-cpp-generate-private-key-from-mnemonic-example` to generate a
private key from a mnemonic with a passphrase.

The command to run an example looks like:
Expand Down
34 changes: 8 additions & 26 deletions src/sdk/examples/AccountAliasExample.cc
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
/*-
*
* Hedera C++ SDK
*
* Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// SPDX-License-Identifier: Apache-2.0
#include "AccountBalance.h"
#include "AccountBalanceQuery.h"
#include "AccountInfo.h"
Expand All @@ -32,25 +14,25 @@
#include <dotenv.h>
#include <iostream>

using namespace Hedera;
using namespace Hiero;

int main(int argc, char** argv)
{
dotenv::init();
const AccountId operatorAccountId = AccountId::fromString(std::getenv("OPERATOR_ID"));
const std::shared_ptr<PrivateKey> operatorPrivateKey = ED25519PrivateKey::fromString(std::getenv("OPERATOR_KEY"));

// Get a client for the Hedera testnet, and set the operator account ID and key such that all generated transactions
// Get a client for the Hiero testnet, and set the operator account ID and key such that all generated transactions
// will be paid for by this account and be signed by this key.
Client client = Client::forTestnet();
client.setOperator(operatorAccountId, operatorPrivateKey);

/*
* Hedera supports a form of auto account creation.
* Hiero supports a form of auto account creation.
*
* You can "create" an account by generating a private key, and then deriving the public key, without any need to
* interact with the Hedera network. The public key more or less acts as the user's account ID. This public key is an
* account's mAliasKey: a public key that aliases (or will eventually alias) to a Hedera account.
* interact with the Hiero network. The public key more or less acts as the user's account ID. This public key is an
* account's mAliasKey: a public key that aliases (or will eventually alias) to a Hiero account.
*
* An AccountId takes one of two forms: a normal AccountId with a null mAliasKey member takes the form 0.0.123, while
* an AccountId with a non-null mAliasKey member takes the form
Expand All @@ -62,9 +44,9 @@ int main(int argc, char** argv)
* transactions, however most queries and transactions involving such an AccountId won't work until Hbar has been
* transferred to the mAliasKey account.
*
* There is no record in the Hedera network of an account associated with a given mAliasKey until an amount of Hbar is
* There is no record in the Hiero network of an account associated with a given mAliasKey until an amount of Hbar is
* transferred to the account. The moment that Hbar is transferred to that mAliasKey AccountId is the moment that that
* account actually begins to exist in the Hedera ledger.
* account actually begins to exist in the Hiero ledger.
*/

// Generate a ED25519 private, public key pair
Expand Down
24 changes: 3 additions & 21 deletions src/sdk/examples/AccountAllowanceExample.cc
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
/*-
*
* Hedera C++ SDK
*
* Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// SPDX-License-Identifier: Apache-2.0
#include "AccountAllowanceApproveTransaction.h"
#include "AccountBalance.h"
#include "AccountBalanceQuery.h"
Expand All @@ -34,15 +16,15 @@
#include <dotenv.h>
#include <iostream>

using namespace Hedera;
using namespace Hiero;

int main(int argc, char** argv)
{
dotenv::init();
const AccountId operatorAccountId = AccountId::fromString(std::getenv("OPERATOR_ID"));
const std::shared_ptr<PrivateKey> operatorPrivateKey = ED25519PrivateKey::fromString(std::getenv("OPERATOR_KEY"));

// Get a client for the Hedera testnet, and set the operator account ID and key such that all generated transactions
// Get a client for the Hiero testnet, and set the operator account ID and key such that all generated transactions
// will be paid for by this account and be signed by this key.
Client client = Client::forTestnet();
client.setOperator(operatorAccountId, operatorPrivateKey);
Expand Down
24 changes: 3 additions & 21 deletions src/sdk/examples/AccountAllowanceSerializedExample.cc
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
/*-
*
* Hedera C++ SDK
*
* Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// SPDX-License-Identifier: Apache-2.0
#include "AccountAllowanceApproveTransaction.h"
#include "AccountBalance.h"
#include "AccountBalanceQuery.h"
Expand All @@ -36,15 +18,15 @@
#include <dotenv.h>
#include <iostream>

using namespace Hedera;
using namespace Hiero;

int main(int argc, char** argv)
{
dotenv::init();
const AccountId operatorAccountId = AccountId::fromString(std::getenv("OPERATOR_ID"));
const std::shared_ptr<PrivateKey> operatorPrivateKey = ED25519PrivateKey::fromString(std::getenv("OPERATOR_KEY"));

// Get a client for the Hedera testnet, and set the operator account ID and key such that all generated transactions
// Get a client for the Hiero testnet, and set the operator account ID and key such that all generated transactions
// will be paid for by this account and be signed by this key.
Client client = Client::forTestnet();
client.setOperator(operatorAccountId, operatorPrivateKey);
Expand Down
28 changes: 5 additions & 23 deletions src/sdk/examples/AccountCreateWithHtsExample.cc
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
/*-
*
* Hedera C++ SDK
*
* Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// SPDX-License-Identifier: Apache-2.0
#include "AccountInfo.h"
#include "AccountInfoQuery.h"
#include "Client.h"
Expand All @@ -36,15 +18,15 @@
#include <dotenv.h>
#include <iostream>

using namespace Hedera;
using namespace Hiero;

int main(int argc, char** argv)
{
dotenv::init();
const AccountId operatorAccountId = AccountId::fromString(std::getenv("OPERATOR_ID"));
const std::shared_ptr<PrivateKey> operatorPrivateKey = ED25519PrivateKey::fromString(std::getenv("OPERATOR_KEY"));

// Get a client for the Hedera testnet, and set the operator account ID and key such that all generated transactions
// Get a client for the Hiero testnet, and set the operator account ID and key such that all generated transactions
// will be paid for by this account and be signed by this key.
Client client = Client::forTestnet();
client.setOperator(operatorAccountId, operatorPrivateKey);
Expand All @@ -62,7 +44,7 @@ int main(int argc, char** argv)
std::cout << "---------" << std::endl;

/**
* Step 1: Create an NFT using the Hedera token service.
* Step 1: Create an NFT using the Hiero token service.
*/
TokenId tokenId = TokenCreateTransaction()
.setTokenName("HIP-542 Example Collection")
Expand Down Expand Up @@ -131,7 +113,7 @@ int main(int argc, char** argv)
std::cout << "---------" << std::endl;

/**
* Step 1: Create a fungible token using the Hedera token service.
* Step 1: Create a fungible token using the Hiero token service.
*/
tokenId = TokenCreateTransaction()
.setTokenName("HIP-542 Token")
Expand Down
40 changes: 11 additions & 29 deletions src/sdk/examples/AccountCreationWaysExample.cc
Original file line number Diff line number Diff line change
@@ -1,35 +1,17 @@
/*-
*
* Hedera C++ SDK
*
* Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// SPDX-License-Identifier: Apache-2.0
#include "AccountId.h"
#include "ECDSAsecp256k1PrivateKey.h"

#include <iostream>

using namespace Hedera;
using namespace Hiero;

int main(int argc, char** argv)
{
/**
* Reference: [HIP-583 Expand alias support in CryptoCreate & CryptoTransfer
* Transactions](https://hips.hedera.com/hip/hip-583)
* In Hedera we have the concept of 4 different account representations:
* In Hiero we have the concept of 4 different account representations:
* - An account can have an account ID in shard.realm.accountNumber format (0.0.10).
* - An account can have a public key alias in
* 0.0.302D300706052B8104000A032200036847776633520568B5B4B1D074C647BE63579B3D7DC9E4B638042CB4E041C8B8 format.
Expand All @@ -40,20 +22,20 @@ int main(int argc, char** argv)

// An Account ID in shard.realm.number format, i.e. `0.0.10` with the corresponding
// `0x000000000000000000000000000000000000000A` ethereum address.
const AccountId hederaFormat = AccountId::fromString("0.0.10");
std::cout << "Account ID: " + hederaFormat.toString() << std::endl;
std::cout << "Account " + hederaFormat.toString() + " corresponding Long-Zero address: "
<< hederaFormat.toSolidityAddress() << std::endl;
const AccountId hieroFormat = AccountId::fromString("0.0.10");
std::cout << "Account ID: " + hieroFormat.toString() << std::endl;
std::cout << "Account " + hieroFormat.toString() + " corresponding Long-Zero address: "
<< hieroFormat.toSolidityAddress() << std::endl;

// The Hedera Long-Form Account ID: 0.0.aliasPublicKey, i.e.
// The Hiero Long-Form Account ID: 0.0.aliasPublicKey, i.e.
// `0.0.302D300706052B8104000A032200036847776633520568B5B4B1D074C647BE63579B3D7DC9E4B638042CB4E041C8B8`
const std::unique_ptr<ECDSAsecp256k1PrivateKey> privateKey = ECDSAsecp256k1PrivateKey::generatePrivateKey();
const AccountId aliasAccountId = privateKey->getPublicKey()->toAccountId();
std::cout << "Hedera Long-Form Account ID: " + aliasAccountId.toString() << std::endl;
std::cout << "Hiero Long-Form Account ID: " + aliasAccountId.toString() << std::endl;

// The Hedera Account Long-Zero address `0x000000000000000000000000000000000000000a` (for accountId 0.0.10)
// The Hiero Account Long-Zero address `0x000000000000000000000000000000000000000a` (for accountId 0.0.10)
const AccountId longZeroAddress = AccountId::fromString("0x000000000000000000000000000000000000000a");
std::cout << "Hedera Account Long-Zero address: " << longZeroAddress.toString() << std::endl;
std::cout << "Hiero Account Long-Zero address: " << longZeroAddress.toString() << std::endl;

// The Ethereum Account Address / public-address `0xb794f5ea0ba39494ce839613fffba74279579268`.
const AccountId evmAddress = AccountId::fromString("0xb794f5ea0ba39494ce839613fffba74279579268");
Expand Down
Loading

0 comments on commit e85ee2d

Please sign in to comment.