29 |
30 | ## Contribute
31 |
32 | - To contribute, please refer to the **[Hiero-Ledger's contribution guidelines](https://github.com/hiero-ledger/.github/blob/main/CONTRIBUTING.md)**
33 |
34 | ## Code of Conduct
35 |
36 | This project is governed by the **[Contributor Covenant Code of Conduct](https://github.com/hashgraph/.github/blob/main/CODE_OF_CONDUCT.md)**. By participating, you are expected to uphold this code of conduct.
37 |
38 | ## About Users and Maintainers
39 |
40 | - Users and Maintainers guidelies are located in **[Hiero-Ledger's roles and groups guidelines](https://github.com/hiero-ledger/governance/blob/main/roles-and-groups.md#maintainers).**
41 |
42 | ## License
43 |
44 | [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)
45 |
--------------------------------------------------------------------------------
/getting-started/how-to-run-hedera-local-node-in-a-cloud-development-environment-cde/codespaces.md:
--------------------------------------------------------------------------------
1 | # Run in Codespaces
2 |
3 | Codespaces is a cloud development environment (CDE) that's hosted in the cloud. You can customize your project for GitHub Codespaces by committing configuration files to your repository (often known as Configuration-as-Code), which creates a repeatable codespaces configuration for all users of your project. [GitHub Codespaces overview](https://docs.github.com/en/codespaces/overview)
4 |
5 | ***
6 |
7 | ## Prerequisites
8 |
9 | * Review the [Quickstart for GitHub Codespaces](https://docs.github.com/en/codespaces/getting-started/quickstart) guide.
10 | * Install the VSCode Desktop application.
11 | * In [Editor preference](https://github.com/settings/codespaces) change your client to `Visual Studio Code` (Should not be `Visual Studio Code for the Web`)
12 |
13 | ***
14 |
15 | ## Configure Dev Container
16 |
17 | To configure the dev container, open the [Hiero Local Node repo](https://github.com/hashgraph/hedera-local-node) and click on `Code`->`Codespaces`->`...`-> `Configure dev container`.
18 |
19 |
20 |
21 | This will open the dev container configuration file where you can customize your configuration like the CPUs and memory.
22 |
23 |
24 |
25 | {% hint style="info" %}
26 | **Note**: If you make changes to your config file, commit and push your changes before running local node, to ensure the project starts with the right configuration.
27 | {% endhint %}
28 |
29 | ## Creating and Running Your Codespace
30 |
31 | Open the [Hiero Local Node repo](https://github.com/hashgraph/hedera-local-node) and click on the `Code`->`Codespaces`->`...`-> `New with options...` button and choose the appropriate settings:
32 |
33 |
34 |
35 | Once your codespace is created, the template repository will be automatically cloned into it. Your codespace is all set up, and the local node is running!
36 |
37 |
38 |
39 | ***
40 |
41 | ## Conclusion and Additional Resources
42 |
43 | Congrats on successfully setting up your Codespace and running a Hiero Local Node!
44 |
45 | **➡** [**Hiero Local Node Repository**](https://github.com/hashgraph/hedera-local-node#readme)
46 |
47 | **➡** [**Quickstart for GitHub Codespaces**](https://docs.github.com/en/codespaces/getting-started/quickstart)
48 |
49 | **➡** [**Adding Dev Container Config to Repo**](https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration)
50 |
--------------------------------------------------------------------------------
/sdks/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | description: Hiero supported and community-maintained SDKs
3 | ---
4 |
5 | # Hiero SDKs
6 |
7 | There are several options for friendly, language-specific access to the Hiero API and its network services.
8 |
9 | ## Hiero SDK Collaboration Hub
10 |
11 | The **[Hiero SDK Collaboration Hub](https://github.com/hiero-ledger/sdk-collaboration-hub)** repo serves as a collaborative space for design proposals, contribution guidelines, templates, and other helpful documentation to support Hiero SDK contributors.
12 |
13 | To follow the latest news and collaborate with other maintainers in Hiero's SDKs, join our **[bi-weekly meeting](https://zoom-lfx.platform.linuxfoundation.org/meetings/hiero?view=week&occurrence=1760968800)**.
14 |
15 | ## Hiero Consensus Node SDKs
16 |
17 | Hiero and the developer community contribute to and maintain Hiero Consensus Node SDKs across various languages.
18 |
19 | {% hint style="info" %}
20 | **Note:** The Hiero JavaScript SDK supports React Native with Expo on Android devices and Android emulators. It does not currently support React Native Bare.
21 | {% endhint %}
22 |
23 |
24 |
25 | Want to help contribute or have a project you'd like to see, here? Join the [community calls](https://www.lfdecentralizedtrust.org/meeting-calendar) to propose your project, or add a [pull request](https://github.com/hiero-ledger/hiero-docs)!
26 |
--------------------------------------------------------------------------------
/getting-started/how-to-run-hedera-local-node-in-a-cloud-development-environment-cde/gitpod.md:
--------------------------------------------------------------------------------
1 | # Run in Gitpod
2 |
3 | The local network comprises the consensus node, mirror node, [JSON-RPC relay](https://github.com/hashgraph/hedera-json-rpc-relay#readme), and other Consensus Node services and now be set up without Docker and draining your computer’s resources by using Gitpod. Gitpod provides Cloud Development Environments (CDEs) and allows developers to work from any device without the need to maintain static and brittle local development environments. By the end of this tutorial, you will have your Hedera local node running on Gitpod.
4 |
5 | ***
6 |
7 | ## Prerequisites
8 |
9 | * Signed into your GitHub account in your browser.
10 | * [Register](https://gitpod.io/login/) a Gitpod account with your GitHub account.
11 | * If this is your first time using Gitpod, please read the [Gitpod getting started](https://www.gitpod.io/docs/introduction/getting-started) guide.
12 | * Install the [Gitpod browser extension](https://www.gitpod.io/docs/configure/user-settings/browser-extension).
13 | * The Mirror Node Web Explorer requires [VS Code Desktop](https://www.gitpod.io/docs/references/ides-and-editors/vscode) to be installed, as [VS Code Browser](https://www.gitpod.io/docs/references/ides-and-editors/vscode-browser) has limitations related to communicating with local ports, e.g. `http://127.0.0.1:5551/`.
14 |
15 | ***
16 |
17 | ## Set Up Gitpod Permissions
18 |
19 | Enable `public_repo` permission for the GitHub provider on [Gitpod’s Git integrations page](https://gitpod.io/user/integrations).
20 |
21 |
22 |
23 |
24 |
25 | ***
26 |
27 | ## Running the Hiero Local Node
28 |
29 | The `hiero-local-node` project repository already has a Gitpod configuration file ([`.gitpod.yml`](https://github.com/hashgraph/hedera-local-node/blob/main/.gitpod.yml)), which makes it easy to run it within a workspace on Gitpod. Open the [Hiero Local Node repo](https://github.com/hashgraph/hedera-local-node). Click on the Gitpod `Open` button.
30 |
31 |
32 |
33 | The Gitpod browser extension modifies the Github UI to add this button. This will spin up a new Gitpod workspace with your choice of CDE which will run the Hiero Local Node in your cloud environment.
34 |
35 | ### **Testing the Setup**
36 |
37 | To confirm everything is running smoothly, run the `curl` commands below to query the mirror node for a list of accounts, query the JSON-RPC relay for the latest block, and open the mirror node explorer (HashScan) using the local endpoint ([http://localhost:8080/devnet/dashboard](http://localhost:8080/devnet/dashboard)).
38 |
39 | **Mirror Node REST API**
40 |
41 | The following command queries the Mirror Node for a list of accounts on your Hedera network.
42 |
43 | ```bash
44 | curl "http://localhost:5551/api/v1/accounts" \
45 | -X GET
46 | ```
47 |
48 | See the [Mirror Node interact API docs](https://testnet.mirrornode.hedera.com/api/v1/docs/) for a full list of available APIs.
49 |
50 | **JSON RPC Relay**
51 |
52 | The following command queries the RPC Relay for the latest block on your Hedera network.
53 |
54 | {% code overflow="wrap" %}
55 | ```bash
56 | curl "" \\
57 | -X POST \\
58 | -H "Content-Type: application/json" \\
59 | --data '{"method":"eth_getBlockByNumber","params":["latest",false],"id":1,"jsonrpc":"2.0"}'
60 | ```
61 | {% endcode %}
62 |
63 | See the [endpoint table](https://github.com/hashgraph/hedera-json-rpc-relay/blob/main/docs/rpc-api.md#endpoint-table) in `hiero-json-rpc-relay` for a full list of available RPCs.
64 |
65 | **Mirror Node Explorer (Hashscan)**
66 |
67 | Visit the local mirror node explorer endpoint ([http://localhost:8080/devnet/dashboard](http://localhost:8080/devnet/dashboard)) in your web browser. Ensure that `LOCALNET` is selected, as this will show you the Hedera network running within your Gitpod, and not one of the public nodes.
68 |
69 |
70 |
71 | ### Shut Down the Gitpod Workspace
72 |
73 | {% hint style="warning" %}
74 | **Note**: Gitpod usage is billed by the hour on paid plans, and hours are limited on the free plans. Therefore, once completed, remember to stop the Gitpod workspace.
75 | {% endhint %}
76 |
77 |
78 |
79 | ***
80 |
81 | ## Conclusion and Additional Resources
82 |
83 | Congrats on successfully setting up your Gitpod workspace and running a Hiero Local Node!
84 |
85 | **➡** [**Hiero Local Node Repository**](https://github.com/hashgraph/hedera-local-node#readme)
86 |
87 | **➡** [**Gitpod Documentation**](https://www.gitpod.io/docs/introduction/getting-started)
88 |
--------------------------------------------------------------------------------
/getting-started/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started with Hiero
2 |
3 | Welcome to the Hiero Getting Started section where you'll find information on how to get involved in Hiero and a collection of step-by-step guides designed to help you set up and explore a fully functional Hiero local node (network).
4 |
5 | ## Get Involved in Hiero
6 |
7 | **➡** [**Start Here**](https://hiero.org/) - Learn about what is Hiero, who are the main participants and where to find collaboration opportunities.
8 |
9 | **➡** [**Get Caught Up With The Latest News**](https://hiero.org/blog/) - Read our latest blog project news and events happening in our community.
10 |
11 | **➡** [**Learn More About LFDT and Hiero**](https://www.lfdecentralizedtrust.org/projects/hiero) - Learn more about Hiero from Linux Foundation Decentralized Trust blog site.
12 |
13 | **➡** [**Clone The Code**](https://github.com/hiero-ledger/) - Learn more about the code base in GitHub.
14 |
15 | **➡** [**Attend our Technical Steering Committee Meeting**](https://zoom-lfx.platform.linuxfoundation.org/meetings/hiero?view=week&occurrence=1760450400) - Our Technical Committee Meetings are open and welcomes anyone who is interested in learning about the latest project status and direction.
16 |
17 | **➡** [**Attend any of our public meetings**](https://zoom-lfx.platform.linuxfoundation.org/meetings/hiero?view=month) - Explore any of our public project meetings. These meetings are designed to welcome everyone interested in learning more and contributing to any of Hiero's components.
18 |
19 | ## Hiero Setup Guides
20 |
21 | The [**Hiero Local Node**](https://github.com/hashgraph/hedera-local-node) project empowers developers to deploy their own local network for development and testing. This network includes essential services such as the consensus node, mirror node, JSON-RPC relay, and more that can be deployed using multiple methods.
22 |
23 | **➡** [**Deploy Your Hiero Local Node**](./#deploy-your-hiero-local-node)
24 |
25 | **➡** [**Available Services and Dashboards**](./#available-services-and-dashboards)
26 |
27 | ***
28 |
29 | ### Deploy Your Hiero Local Node
30 |
31 | Choose to deploy between Docker with the Hiero CLI, managing your node via the official NPM package, or leveraging Cloud Development Environments (CDEs) like Gitpod or GitHub Codespaces. These guides are designed to help you quickly and efficiently establish a testing environment. This flexibility enables you to work from any device without being tied down by a static local setup.
32 |
33 |
Use Docker and the Hiero CLI to spin up a complete local network on your machine. This includes a consensus node, mirror node, JSON-RPC relay, and other supporting services.
Use the CLI tool to install and run the Hiero local node using the official NPM package. This lets you start, stop, and generate accounts directly via CLI commands.
34 |
35 | ***
36 |
37 | ### **Available Services and Dashboards**
38 |
39 | The Hiero local node comes with various services, each serving different functions, and accessible locally. You can use these services on `localhost`.
40 |
41 | {% hint style="info" %}
42 | In Gitpod and Codespaces, "localhost" refers to a virtual cloud server you're accessing via your browser. These platforms redirect local addresses to your cloud workspace, making it feel like you're working on a local setup.
43 | {% endhint %}
44 |
45 | These are the `localhost` endpoints for each service:
46 |
47 |
48 |
--------------------------------------------------------------------------------
/.gitbook.yaml:
--------------------------------------------------------------------------------
1 | redirects:
2 | tutorials/hello-world: getting-started/README.md
3 | tutorials/hello-world/hfs-files: getting-started/README.md
4 | tutorials/hello-world/create-fund-account: getting-started/web2-developers/transfer-hbar.md
5 | tutorials/hello-world/hts-fungible-token: getting-started/web2-developers/create-a-token.md
6 | tutorials/hello-world/hcs-topic: getting-started/web2-developers/create-a-topic.md
7 | tutorials/hello-world/hscs-smart-contract: getting-started/evm-developers/deploy-a-contract.md
8 | core-concepts/smart-contracts/hederas-evm-equivalence-goals-and-exceptions: core-concepts/smart-contracts/understanding-hederas-evm-differences-and-compatibility/README.md
9 | docs/hashgraph-overview: core-concepts/hashgraph-consensus-algorithms/README.md
10 | getting-started/hcs-submit-your-first-message: tutorials/consensus/submit-your-first-message.md
11 | getting-started/query-data: getting-started/README.md
12 | getting-started/create-an-account: getting-started/environment-setup.md
13 | docs/hedera-api: sdks-and-apis/sdks/README.md
14 | docs/hedera-api/basic-types/feedata: sdks-and-apis/hedera-api/basic-types/feedata.md
15 | docs/hedera-api/basic-types/tokensupplytype: sdks-and-apis/hedera-api/basic-types/tokensupplytype.md
16 | docs/hedera-api/file-service: sdks-and-apis/sdks/file-service/README.md
17 | docs/hedera-api/schedule-service: sdks-and-apis/sdks/schedule-transaction/README.md
18 | docs/hedera-api/schedule-service/schedulecreate: sdks-and-apis/sdks/schedule-transaction/create-a-schedule-transaction.md
19 | docs/hedera-api/smart-contracts: sdks-and-apis/sdks/smart-contracts/README.md
20 | docs/hedera-api/token-service: sdks-and-apis/sdks/token-service/README.md
21 | docs/hedera-api/token-service/customfees/fixedfee: sdks-and-apis/sdks/readme-1/custom-token-fees.md
22 | docs/hedera-api/token-service/customfees/royaltyfee: sdks-and-apis/sdks/readme-1/custom-token-fees.md
23 | docs/hedera-api/token-service/tokenfeescheduleupdate: sdks-and-apis/sdks/token-service/update-a-fee-schedule.md
24 | docs/hedera-api/token-service/tokenfreezeaccount: sdks-and-apis/sdks/token-service/freeze-an-account.md
25 | docs/hedera-api/token-service/tokenpause: sdks-and-apis/sdks/token-service/pause-a-token.md
26 | docs/hedera-api/token-service/tokenservice: sdks-and-apis/sdks/token-service/README.md
27 | docs/hedera-api/token-service/tokenwipeaccount: sdks-and-apis/sdks/token-service/wipe-a-token.md
28 | docs/join-hedera-testnet: networks/README.md
29 | docs/mirror-node-api: sdks-and-apis/rest-api.md
30 | docs/mirror-node-api/cryptocurrency-api: sdks-and-apis/rest-api.md
31 | docs/mirror-node-api/hedera-consensus-service-api-1: sdks-and-apis/sdks/consensus-service/README.md
32 | docs/mirror-node-api/rest-api: sdks-and-apis/rest-api.md
33 | docs/release-notes: networks/release-notes/README.md
34 | docs/release-notes/services: networks/release-notes/services.md
35 | docs/sdks: sdks-and-apis/sdks/README.md
36 | docs/sdks/address-book: sdks-and-apis/sdks/address-book.md
37 | docs/sdks/consensus/create-a-topic: sdks-and-apis/sdks/consensus-service/create-a-topic.md
38 | docs/sdks/cryptocurrency/adjust-an-allowance: sdks-and-apis/sdks/accounts-and-hbar/adjust-an-allowance.md
39 | docs/sdks/cryptocurrency/approve-an-allowance: sdks-and-apis/sdks/accounts-and-hbar/approve-an-allowance
40 | docs/sdks/cryptocurrency/create-an-account: sdks-and-apis/sdks/accounts-and-hbar/create-an-account.md
41 | docs/sdks/cryptocurrency/get-account-balance: sdks-and-apis/sdks/accounts-and-hbar/get-account-balance.md
42 | docs/sdks/cryptocurrency/get-account-info: sdks-and-apis/sdks/accounts-and-hbar/get-account-info.md
43 | docs/sdks/cryptocurrency/transfer-cryptocurrency: sdks-and-apis/sdks/accounts-and-hbar/transfer-cryptocurrency.md
44 | docs/sdks/cryptocurrency/update-an-account: sdks-and-apis/sdks/accounts-and-hbar/update-an-account.md
45 | docs/sdks/file-storage/append-to-a-file: sdks-and-apis/sdks/file-storage/append-to-a-file.md
46 | docs/sdks/file-storage/create-a-file: sdks-and-apis/sdks/file-storage/create-a-file.md
47 | docs/sdks/keys/create-a-threshold-key: sdks-and-apis/sdks/keys/create-a-threshold-key.md
48 | docs/sdks/keys/generate-a-new-key-pair: sdks-and-apis/sdks/keys/generate-a-new-key-pair.md
49 | docs/sdks/pseudorandom-number-generator: sdks-and-apis/sdks/pseudorandom-number-generator.md
50 | docs/sdks/schedule-transaction: sdks-and-apis/sdks/schedule-transaction/README.md
51 | docs/sdks/schedule-transaction/create-a-schedule-transaction: sdks-and-apis/sdks/schedule-transaction/create-a-schedule-transaction.md
52 | docs/sdks/schedule-transaction/get-schedule-info: sdks-and-apis/sdks/schedule-transaction/get-schedule-info.md
53 | docs/sdks/schedule-transaction/sign-a-schedule-transaction: sdks-and-apis/sdks/schedule-transaction/sign-a-schedule-transaction.md
54 | docs/sdks/set-up-your-local-network: sdks-and-apis/sdks/set-up-your-local-network.md
55 | docs/sdks/smart-contracts: sdks-and-apis/sdks/smart-contracts/README.md
56 | docs/sdks/smart-contracts/call-a-smart-contract-function: sdks-and-apis/sdks/smart-contracts/call-a-smart-contract-function.md
57 | docs/sdks/smart-contracts/call-a-smart-contract-function-1: sdks-and-apis/sdks/smart-contracts/call-a-smart-contract-function.md
58 | docs/sdks/smart-contracts/create-a-smart-contract: sdks-and-apis/sdks/smart-contracts/create-a-smart-contract.md
59 | docs/sdks/smart-contracts/get-smart-contract-info: sdks-and-apis/sdks/smart-contracts/get-smart-contract-info.md
60 | docs/sdks/smart-contracts/hedera-service-solidity-libraries: sdks-and-apis/sdks/smart-contracts/hedera-service-solidity-libraries.md
61 | docs/sdks/smart-contracts/update-a-smart-contract: sdks-and-apis/sdks/smart-contracts/update-a-smart-contract.md
62 | docs/sdks/tokens: sdks-and-apis/sdks/token-service/README.md
63 | docs/sdks/tokens/associate-tokens-to-an-account: sdks-and-apis/sdks/token-service/associate-tokens-to-an-account.md
64 | docs/sdks/tokens/atomic-swaps: sdks-and-apis/sdks/token-service/atomic-swaps.md
65 | docs/sdks/tokens/burn-a-token: sdks-and-apis/sdks/token-service/burn-a-token.md
66 | docs/sdks/tokens/custom-token-fees: sdks-and-apis/sdks/token-service/custom-token-fees.md
67 | docs/sdks/tokens/define-a-token: sdks-and-apis/sdks/token-service/define-a-token.md
68 | docs/sdks/tokens/enable-kyc-account-flag-1: sdks-and-apis/sdks/token-service/enable-kyc-account-flag.md
69 | docs/sdks/tokens/freeze-an-account: sdks-and-apis/sdks/token-service/freeze-an-account.md
70 | docs/sdks/tokens/get-account-token-balance: sdks-and-apis/sdks/token-service/get-account-token-balance.md
71 | docs/sdks/tokens/mint-a-token: sdks-and-apis/sdks/token-service/mint-a-token.md
72 | docs/sdks/tokens/nft-id: sdks-and-apis/sdks/token-service/nft-id.md
73 | docs/sdks/tokens/pause-a-token: sdks-and-apis/sdks/token-service/pause-a-token.md
74 | docs/sdks/tokens/transfer-tokens: sdks-and-apis/sdks/token-service/transfer-tokens.md
75 | docs/sdks/tokens/unfreeze-an-account: sdks-and-apis/sdks/token-service/unfreeze-an-account.md
76 | docs/sdks/tokens/unpause-a-token: sdks-and-apis/sdks/token-service/unpause-a-token.md
77 | docs/sdks/tokens/wipe-a-token: sdks-and-apis/sdks/token-service/wipe-a-token.md
78 | docs/sdks/transactions: sdks-and-apis/sdks/transactions/README.md
79 | docs/sdks/transactions/get-a-transaction-record: sdks-and-apis/sdks/transactions/get-a-transaction-record.md
80 | docs/sdks/transactions/sign-a-multisignature-transaction: sdks-and-apis/sdks/transactions/sign-a-multisignature-transaction.md
81 | getting-started/java/hcs-submit-your-first-message: tutorials/topics/submit-your-first-message.md
82 | getting-started/try-examples: tutorials/README.md
83 | getting-started/try-examples/create-and-transfer-your-first-nft: tutorials/tokens/create-and-transfer-your-first-nft.md
84 | getting-started/try-examples/deploy-a-contract-using-the-hedera-token-service: tutorials/smart-contracts/deploy-a-contract-using-the-hedera-token-service.md
85 | getting-started/try-examples/deploy-your-first-smart-contract: tutorials/smart-contracts/deploy-your-first-smart-contract.md
86 | getting-started/try-examples/schedule-your-first-transaction: tutorials/scheduled-transaction/schedule-your-first-transaction.md
87 | getting-started/try-examples/submit-your-first-message: tutorials/submit-your-first-message.md
88 | mainnet/mainnet-nodes: networks/mainnet/mainnet-nodes/README.md
89 | mainnet/mainnet-nodes/node-requirements: networks/mainnet/mainnet-nodes/node-requirements.md
90 | mirrornet: core-concepts/mirror-nodes/README.md
91 | resources/demo-applications: tutorials/demo-applications.md
92 | resources/json-rpc-relay: core-concepts/smart-contracts/json-rpc-relay.md
93 | resources/starter-projects: tutorials/starter-projects.md
94 | resources/tutorials: tutorials/README.md
95 | resources/tutorials/deploy-smart-contracts-on-hedera: tutorials/smart-contracts/README.md
96 | resources/tutorials/get-event-information-from-hedera-smart-contracts: tutorials/get-event-information-from-hedera-smart-contracts.md
97 | resources/tutorials/getting-started-with-the-hedera-consensus-service-fabric-plugin: tutorials/more-tutorials/get-started-with-the-hedera-consensus-service-fabric-plugin/README.md
98 | resources/tutorials/schedule-a-transaction: tutorials/more-tutorials/schedule-your-first-transaction.md
99 | testnet: networks/testnet/README.md
100 | testnet/testnet-access: networks/testnet/testnet-access.md
101 | testnet/testnet-nodes: networks/testnet/testnet-nodes.md
102 |
--------------------------------------------------------------------------------
/getting-started/how-to-set-up-a-hedera-local-node.md:
--------------------------------------------------------------------------------
1 | # Set Up Hiero Local Node Using Docker
2 |
3 | In this tutorial, we will adopt, set up, and run a Hiero node locally using Docker. By the end of this tutorial, you'll be equipped to run a Hiero local node and generate keys, allowing you to test your projects and deploy projects in your local environment.
4 |
5 | ***
6 |
7 | ## Prerequisites
8 |
9 | * [Node.js](https://nodejs.org/en) >= v14.x
10 | * [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) >= v6.14.17**\*\***
11 | * Minimum 16GB RAM
12 | * [Docker](https://www.docker.com/) >= v20.10.x
13 | * [Docker Compose](https://docs.docker.com/compose/) >= v2.12.3
14 | * Have Docker running on your machine with the correct configurations.
15 |
16 |
17 |
18 | Docker configuration 🛠️
19 |
20 | Ensure the **`VirtioFS`** file sharing implementation is enabled in the docker settings.
21 |
22 |
23 |
24 | Ensure the following configurations are set at minimum in Docker **Settings** -> **Resources** and are available for use:
25 |
26 | * **CPUs:** 6
27 | * **Memory:** 8GB
28 | * **Swap:** 1 GB
29 | * **Disk Image Size:** 64 GB
30 |
31 |
32 |
33 | Ensure the **`Allow the default Docker sockets to be used (requires password)`** is enabled in Docker **Settings -> Advanced**.
34 |
35 |
36 |
37 | **Note:** The image may look different if you are on a different version
38 |
39 |
40 |
41 | {% hint style="info" %}
42 | #### _**Note**_
43 |
44 | _**\*\***Local node can be run using Docker, NPM, or on CDEs but we will use Docker for this tutorial._ [_Here_](https://github.com/hashgraph/hedera-local-node#official-npm-release) _are the installation steps for NPM._
45 | {% endhint %}
46 |
47 | ***
48 |
49 | ## Table of Contents
50 |
51 | 1. [Start Your Local Network](how-to-set-up-a-hedera-local-node.md#start-your-local-network)
52 | 2. [Generate Keys](how-to-set-up-a-hedera-local-node.md#generate-keys)
53 | 3. [Stop Your Local Network](how-to-set-up-a-hedera-local-node.md#stop-your-local-network)
54 | 4. [Additional Resources](how-to-set-up-a-hedera-local-node.md#additional-resources)
55 |
56 | ***
57 |
58 | ## Start Your Local Network
59 |
60 | Open a new terminal and navigate to your preferred directory where your Hiero Local Node project will live. Run the following command to clone the repo and install dependencies to your local machine:
61 |
62 | ```bash
63 | git clone https://github.com/hiero-ledger/hiero-local-node.git
64 | cd hiero-local-node
65 | npm install
66 | ```
67 |
68 | For Windows users: You will need to update the file endings of `compose-network/mirror-node/init.sh` by running this in WSL:
69 |
70 | ```bash
71 | dos2unix compose-network/mirror-node/init.sh
72 | ```
73 |
74 | Ensure Docker is installed and open on your machine before running this command to get the network up and running:
75 |
76 | ```bash
77 | // starts and generates the first 30 accounts
78 | npm run start -- -d
79 |
80 | or
81 |
82 | // will start local node but will not generate the first 30 accounts
83 | docker compose up -d
84 | ```
85 |
86 | ***
87 |
88 | ## Generate Keys
89 |
90 | To generate accounts with random private keys, run the `generate-accounts` command. Specify the number of accounts generated by appending the number to the `hedera generate-account` command. For example, to generate 5 accounts, run `hedera generate-accounts 5`.
91 |
92 |
93 |
94 | hedera generate-accounts 5
95 |
96 | ```
97 | Generating accounts in synchronous mode...
98 | |-----------------------------------------------------------------------------------------|
99 | |-----------------------------| Accounts list ( ECDSA keys) |----------------------------|
100 | |-----------------------------------------------------------------------------------------|
101 | | id | private key | balance |
102 | |-----------------------------------------------------------------------------------------|
103 | | 0.0.1033 - 0xced34a00d3fff542e350a5e61cb41509812bf23ea581f83a0a862c94d8c69704 - 10000 ℏ |
104 | | 0.0.1034 - 0xa4189ab682ba43925ce654ca09800bba86cf8b1b7f889006d5170d95f4fed365 - 10000 ℏ |
105 | | 0.0.1035 - 0xf9106e9841677136c9cbe8c114dab80470ca62a15bfe9c777006bcb114288c22 - 10000 ℏ |
106 | | 0.0.1036 - 0xe3517a9235971be1e1f95e791f3ffd7d753a652799fa11f1ace626036c4db275 - 10000 ℏ |
107 | | 0.0.1037 - 0x636926cf2f6f9fd0a58043c600390eeef0bbed9d4b8a113ea68a8d67f922d04e - 10000 ℏ |
108 | |-----------------------------------------------------------------------------------------|
109 |
110 | |--------------------------------------------------------------------------------------------------------------------------------------|
111 | |------------------------------------------------| Accounts list (Alias ECDSA keys) |--------------------------------------------------|
112 | |--------------------------------------------------------------------------------------------------------------------------------------|
113 | | id | public address | private key | balance |
114 | |--------------------------------------------------------------------------------------------------------------------------------------|
115 | | 0.0.1038 - 0xaBE90e20f394629e054Bc1E8F1338Fe8ea94F0b5 - 0x444913bd258f764e62db6c87abde7ca52ec22985db8c91b8c3b2b4f2c51775f0 - 10000 ℏ |
116 | | 0.0.1039 - 0x26d941d8E1f6bF9B0F7e5156fA6ff02acEd0DF3E - 0xea25f427caf7029989669f93926b7902dde5361b176b4bc17b8ec0a967beaa0b - 10000 ℏ |
117 | | 0.0.1040 - 0x64001c2d1f3a8d3574435B4F125944018E2E584D - 0xf2deb678a1e67e288d8a128334f41c890e7600b2a5471ecc9a3af4824e3021b7 - 10000 ℏ |
118 | | 0.0.1041 - 0x6bE22CD9D16b64969683B74897E4EBB30c7c30E8 - 0xb9c2480cdbdddb2ecd6e032b87820c29e8791ad4f53b89f829269d856c835819 - 10000 ℏ |
119 | | 0.0.1042 - 0x992d8aD211b28B23589c0b3Fe30de6C90662C4aB - 0x7e8bb0d85a8d80fa2eb2c9f6bd5c9b1a2c2f9f6992c7fffd201c8e81f0ec0000 - 10000 ℏ |
120 | |--------------------------------------------------------------------------------------------------------------------------------------|
121 |
122 | |-----------------------------------------------------------------------------------------|
123 | |-----------------------------| Accounts list (ED25519 keys) |----------------------------|
124 | |-----------------------------------------------------------------------------------------|
125 | | id | private key | balance |
126 | |-----------------------------------------------------------------------------------------|
127 | | 0.0.1043 - 0xd4917e152ca922b8bfbafffc3486512ae25ec0a75b05c44f517b11cd12fd949b - 10000 ℏ |
128 | | 0.0.1044 - 0xbaeec69382fbb43e4d521b3d8717c9cba610a1fbcaededaaf4408c3138a683ae - 10000 ℏ |
129 | | 0.0.1045 - 0x1f5c4b2efd3c36d29e9d2e16a825abd001f99bff2388bb8c6011cd5f956023c9 - 10000 ℏ |
130 | | 0.0.1046 - 0x1976acdd5e71ce7e8db4cb0aa112fa1c16876155f0f20b9b7029916073f1d67f - 10000 ℏ |
131 | | 0.0.1047 - 0x6e29f48b11ffc77e277f0500d607b35956da58f1ed30aad003fb1846bfffc483 - 10000 ℏ |
132 | |-----------------------------------------------------------------------------------------|
133 | ```
134 |
135 |
136 |
137 | {% hint style="info" %}
138 | **Please note**: Since the first 10 accounts generated are with predefined private keys, if you need 5 generated with random keys, you will run `hedera start 15`. The same rule applies when you use the `hedera generate-accounts` command.
139 | {% endhint %}
140 |
141 | Grab any of the account private keys generated from the _**Alias ECDSA keys Accounts list**_. This will be used as the `LOCAL_NODE_OPERATOR_PRIVATE_KEY` environment variable value in your `.env` file of your project.
142 |
143 | ***
144 |
145 | ## Stop Your Local Network
146 |
147 | To stop your local node, you can run the `hedera stop` command. If you want to keep any files created manually in the working directory, please save them before executing this command.
148 |
149 |
150 |
151 | hedera stop
152 |
153 | ```
154 | Stopping the network...
155 | Stopping the docker containers...
156 | Cleaning the volumes and temp files...
157 | ```
158 |
159 |
160 |
161 | Alternatively, run `docker compose down -v; git clean -xfd; git reset --hard` to stop the local node and reset it to its original state.
162 |
163 |
164 |
165 | docker compose down -v; git clean -xfd; git reset --hard
166 |
167 | ```bash
168 | [+] Running 27/27
169 | ✔ Container mirror-node-web3 Removed 3.5s
170 | ✔ Container json-rpc-relay-ws Removed 10.8s
171 | ✔ Container mirror-node-monitor Removed 3.7s
172 | ✔ Container relay-cache Removed 0.9s
173 | ✔ Container prometheus Removed 0.9s
174 | ✔ Container record-sidecar-uploader Removed 0.0s
175 | ✔ Container grafana Removed 0.9s
176 | ✔ Container hedera-explorer Removed 10.4s
177 | ✔ Container json-rpc-relay Removed 10.7s
178 | ✔ Container account-balances-uploader Removed 0.1s
179 | ✔ Container envoy-proxy Removed 1.0s
180 | ✔ Container mirror-node-grpc Removed 2.7s
181 | ✔ Container mirror-node-rest Removed 10.4s
182 | ✔ Container network-node Removed 10.8s
183 | ✔ Container mirror-node-importer Removed 10.4s
184 | ✔ Container record-streams-uploader Removed 0.0s
185 | ✔ Container haveged Removed 0.0s
186 | ✔ Container mirror-node-db Removed 0.3s
187 | ✔ Container minio Removed 0.0s
188 | ✔ Volume prometheus-data Removed 0.0s
189 | ✔ Volume minio-data Removed 0.0s
190 | ✔ Volume mirror-node-postgres Removed 0.1s
191 | ✔ Volume grafana-data Removed 0.2s
192 | ✔ Network network-node-bridge Removed 0.1s
193 | ✔ Network hedera-local-node_default Removed 0.2s
194 | ✔ Network cloud-storage Removed 0.2s
195 | ✔ Network mirror-node Removed 0.2s
196 | Removing .husky/_/
197 | Removing network-logs/
198 | Removing node_modules/
199 | HEAD is now at ......
200 | ```
201 |
202 |
203 |
204 | _**📣 Note**: All available commands can be checked out_ [_here_](https://github.com/hashgraph/hedera-local-node/tree/main?tab=readme-ov-file#using-hedera-local)_._
205 |
206 | ***
207 |
208 | ## Additional Resources
209 |
210 | **➡** [**Hiero Local Node Repository**](https://github.com/hashgraph/hedera-local-node#readme)
211 |
212 | **➡** [**Hiero Local Node CLI Tool Commands**](https://github.com/hashgraph/hedera-local-node#using-hedera-local)
213 |
214 | **➡** [**Hiero Local Node Docker Setup** ](https://www.youtube.com/watch?v=KOhzu6ftmbY)**\[Video Tutorial]**
215 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/getting-started/setup-hedera-node-cli-npm.md:
--------------------------------------------------------------------------------
1 | # Set Up Hiero Node Using NPM CLI Tool
2 |
3 | In this tutorial, we will adopt, set up, and run a Hiero node locally using the [@hashgraph/hedera-local](https://www.npmjs.com/package/@hashgraph/hedera-local) NPM Command Line Interface (CLI) tool with `docker compose`.
4 |
5 | {% hint style="info" %}
6 | This tutorial is based on the [Hiero Local Node README documentation](https://github.com/hashgraph/hedera-local-node).
7 | {% endhint %}
8 |
9 | ---
10 |
11 | ## Prerequisites
12 |
13 | To get started with this tutorial, ensure that you have the following software installed:
14 |
15 | - [Node.js](https://nodejs.org/) >= v14.x (Check version: `node -v`)
16 | - NPM >= v6.14.17 (Check version: `npm -v`)
17 | - [Docker](https://www.docker.com/) >= v20.10.x (Check version: `docker -v`)
18 | - [Docker Compose](https://docs.docker.com/compose/) >= v2.12.3 (Check version: `docker compose version`)
19 | - Hardware: Minimum 16GB RAM
20 |
21 | ### Installation
22 |
23 | - Node.js and NPM: Refer to the [official installation guide](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs).
24 | - Docker: See [Docker Setup Guide](https://github.com/hashgraph/hedera-local-node?tab=readme-ov-file#note) to get Docker up and running (note: specific instructions may vary based on the OS).
25 |
26 | ## Getting Started
27 |
28 | Clone the GitHub repo and navigate to the project folder using the commands below;
29 |
30 | ```bash
31 | git clone https://github.com/hiero-ledger/hiero-local-node.git
32 | cd hiero-local-node
33 | ```
34 |
35 | ### Install CLI Tool
36 |
37 | The command below can be used to install the official release from the [NPM](https://www.npmjs.com/package/@hashgraph/hedera-local) repository.
38 |
39 | ```bash
40 | npm install @hashgraph/hedera-local -g
41 | ```
42 |
43 | {% hint style="warning" %}
44 |
45 | #### **Note**
46 |
47 | This version may not reflect the most recent changes to the main branch of this repository. It also uses a baked-in version of the Docker Compose definitions and will not reflect any local changes made to the repository.
48 | {% endhint %}
49 |
50 | #### Local development Installation
51 |
52 | Install the dependencies locally.
53 |
54 | ```bash
55 | npm install && npm install -g
56 | ```
57 |
58 | ### Running the Node:
59 |
60 | Start the local node (Note: Ensure Docker is running):
61 |
62 | ```bash
63 | npm run start
64 | ```
65 |
66 | **You can pass the following CLI flags, this would be used later in the following sections:**
67 |
68 | ```bash
69 | --d / --detached - Start the local node in detached mode.
70 | --h / --host - Override the default host.
71 | ```
72 |
73 | **Other NPM commands:**
74 |
75 | - `npm run restart` to restart the network
76 | - `npm run stop` to stop the network
77 | - `npm run generate-accounts` to generate new accounts - network must be running first
78 |
79 | **You should see the following response in the terminal:**
80 |
81 | {% code overflow="wrap" fullWidth="false" %}
82 |
83 | ```bash
84 | hiero-local-node % npm run start
85 |
86 | > @hashgraph/hedera-local@2.26.2 restart
87 | > npm run build && node ./build/index.js restart
88 |
89 |
90 | > @hashgraph/hedera-local@2.26.2 build
91 | > rimraf ./build && tsc
92 |
93 | [Hedera-Local-Node] INFO (StateController) [✔︎] Starting restart procedure!
94 | [Hedera-Local-Node] INFO (CleanUpState) ⏳ Initiating clean up procedure. Trying to revert unneeded changes to files...
95 | [Hedera-Local-Node] INFO (CleanUpState) [✔︎] Clean up of consensus node properties finished.
96 | [Hedera-Local-Node] INFO (CleanUpState) [✔︎] Clean up of mirror node properties finished.
97 | [Hedera-Local-Node] INFO (StopState) ⏳ Initiating stop procedure. Trying to stop docker containers and clean up volumes...
98 | [Hedera-Local-Node] INFO (StopState) ⏳ Stopping the network...
99 | [Hedera-Local-Node] INFO (StopState) [✔︎] Hiero Local Node was stopped successfully.
100 | [Hedera-Local-Node] INFO (InitState) ⏳ Making sure that Docker is started and it is correct version...
101 | [Hedera-Local-Node] INFO (DockerService) ⏳ Checking docker compose version...
102 | [Hedera-Local-Node] INFO (DockerService) ⏳ Checking docker resources...
103 | [Hedera-Local-Node] WARNING (DockerService) [!] Port 3000 is in use.
104 | [Hedera-Local-Node] INFO (InitState) ⏳ Setting configuration with latest images on host 127.0.0.1 with dev mode turned off using turbo mode in single node configuration...
105 | [Hedera-Local-Node] INFO (InitState) [✔︎] Local Node Working directory set to /Users/owanate/Library/Application Support/hedera-local.
106 | [Hedera-Local-Node] INFO (InitState) [✔︎] Hedera JSON-RPC Relay rate limits were disabled.
107 | [Hedera-Local-Node] INFO (InitState) [✔︎] Needed environment variables were set for this configuration.
108 | [Hedera-Local-Node] INFO (InitState) [✔︎] Needed bootsrap properties were set for this configuration.
109 | [Hedera-Local-Node] INFO (InitState) [✔︎] Needed bootsrap properties were set for this configuration.
110 | [Hedera-Local-Node] INFO (InitState) [✔︎] Needed mirror node properties were set for this configuration.
111 | [Hedera-Local-Node] INFO (StartState) ⏳ Starting Hiero Local Node...
112 | ```
113 |
114 | {% endcode %}
115 |
116 | To generate default accounts and start the local node in detached mode, use the command below:
117 |
118 | ```bash
119 | npm run start -- -d
120 | ```
121 |
122 | **You should see the following response in the terminal:**
123 |
124 | {% code overflow="wrap" fullWidth="false" %}
125 |
126 | ```bash
127 | hiero-local-node % npm run start -- -d
128 |
129 | > @hashgraph/hedera-local@2.26.2 start
130 | > npm run build && node ./build/index.js start -d
131 |
132 |
133 | > @hashgraph/hedera-local@2.26.2 build
134 | > rimraf ./build && tsc
135 | [Hedera-Local-Node] INFO (StartState) [✔︎] Hiero Local Node successfully started!
136 | [Hedera-Local-Node] INFO (NetworkPrepState) ⏳ Starting Network Preparation State...
137 | [Hedera-Local-Node] INFO (NetworkPrepState) [✔︎] Imported fees successfully!
138 | [Hedera-Local-Node] INFO (NetworkPrepState) [✔︎] Topic was created!
139 | [Hedera-Local-Node] INFO (AccountCreationState) ⏳ Starting Account Creation state in synchronous mode ...
140 | [Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
141 | [Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------| Accounts list (ECDSA keys) |----------------------------|
142 | [Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
143 | [Hedera-Local-Node] INFO (AccountCreationState) | id | private key | balance |
144 | [Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
145 | [Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1002 - 0x7f109a9e3b0d8ecfba9cc23a3614433ce0fa7ddcc80f2a8f10b222179a5a80d6 - 10000 ℏ |
146 | [Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1003 - 0x6ec1f2e7d126a74a1d2ff9e1c5d90b92378c725e506651ff8bb8616a5c724628 - 10000 ℏ |
147 | [Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1004 - 0xb4d7f7e82f61d81c95985771b8abf518f9328d019c36849d4214b5f995d13814 - 10000 ℏ |
148 | [Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1005 - 0x941536648ac10d5734973e94df413c17809d6cc5e24cd11e947e685acfbd12ae - 10000 ℏ |
149 | [Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1006 - 0x5829cf333ef66b6bdd34950f096cb24e06ef041c5f63e577b4f3362309125863 - 10000 ℏ |
150 | [Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1007 - 0x8fc4bffe2b40b2b7db7fd937736c4575a0925511d7a0a2dfc3274e8c17b41d20 - 10000 ℏ |
151 | [Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1008 - 0xb6c10e2baaeba1fa4a8b73644db4f28f4bf0912cceb6e8959f73bb423c33bd84 - 10000 ℏ |
152 | [Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1009 - 0xfe8875acb38f684b2025d5472445b8e4745705a9e7adc9b0485a05df790df700 - 10000 ℏ |
153 | [Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1010 - 0xbdc6e0a69f2921a78e9af930111334a41d3fab44653c8de0775572c526feea2d - 10000 ℏ |
154 | [Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1011 - 0x3e215c3d2a59626a669ed04ec1700f36c05c9b216e592f58bbfd3d8aa6ea25f9 - 10000 ℏ |
155 | [Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
156 | [Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
157 | [Hedera-Local-Node] INFO (AccountCreationState) |------------------------------------------------| Accounts list (Alias ECDSA keys) |--------------------------------------------------|
158 | [Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
159 | [Hedera-Local-Node] INFO (AccountCreationState) | id | public address | private key | balance |
160 | [Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
161 | [Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1012 - 0x67d8d32e9bf1a9968a5ff53b87d777aa8ebbee69 - 0x105d050185ccb907fba04dd92d8de9e32c18305e097ab41dadda21489a211524 - 10000 ℏ |
162 | .....
163 | [Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
164 | [Hedera-Local-Node] INFO (AccountCreationState) [✔︎] Accounts created succefully!
165 | [Hedera-Local-Node] INFO (CleanUpState) ⏳ Initiating clean up procedure. Trying to revert unneeded changes to files...
166 | [Hedera-Local-Node] INFO (CleanUpState) [✔︎] Clean up of consensus node properties finished.
167 | [Hedera-Local-Node] INFO (CleanUpState) [✔︎] Clean up of mirror node properties finished.
168 | ```
169 |
170 | {% endcode %}
171 |
172 | 
173 |
174 | ## Verify Running Node
175 |
176 | There are different ways to verify that a node is running;
177 |
178 | - Check Block Number using Hashscan Block Explorer
179 | - Send `cURL` request to `getBlockNumber`
180 |
181 | ### Check Block Number using Hashscan Block Explorer
182 |
183 | Visit the local mirror node explorer endpoint ([http://localhost:8080/devnet/dashboard](http://localhost:8080/devnet/dashboard)) in your web browser. Ensure that `LOCALNET` is selected, as this will show you the Hedera network running within your local network.
184 |
185 | Select any of the listed blocks to view the details (Consensus, Block, Transaction Hash, etc) for a particular block.
186 |
187 | 
188 |
189 | 
190 |
191 | ### Send cURL request to getBlockNumber
192 |
193 | Let's verify that we are able to interact with Hedera Testnet using JSON-RPC by issuing an `eth_getBlockByNumber` JSON-RPC request.
194 |
195 | **Enter the curl command below:**
196 |
197 | {% code overflow="wrap" %}
198 |
199 | ```bash
200 | curl http://localhost:7546/ \
201 | -X POST \
202 | -H "Content-Type: application/json" \
203 | --data '{"method":"eth_getBlockByNumber","params":["latest",false],"id":1,"jsonrpc":"2.0"}'
204 | ```
205 |
206 | {% endcode %}
207 |
208 | **You should get the following response:**
209 |
210 | {% code overflow="wrap" %}
211 |
212 | ```bash
213 | curl http://localhost:7546/ \
214 | -X POST \
215 | -H "Content-Type: application/json" \
216 | --data '{"method":"eth_getBlockByNumber","params":["latest",false],"id":1,"jsonrpc":"2.0"}'
217 | {"result":{"timestamp":"0x667c000e","difficulty":"0x0","extraData":"0x","gasLimit":"0xe4e1c0","baseFeePerGas":"0xa54f4c3c00","gasUsed":"0x0","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","receiptsRoot":"0x0000000000000000000000000000000000000000000000000000000000000000","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x93d","stateRoot":"0x0000000000000000000000000000000000000000000000000000000000000000","totalDifficulty":"0x0","transactions":[],"transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","uncles":[],"withdrawals":[],"withdrawalsRoot":"0x0000000000000000000000000000000000000000000000000000000000000000","number":"0x1604","hash":"0xfef0932ffb429840fe765d6d87c77425e2991326ddae6747dcce5c929c69ef38","parentHash":"0xef1ef331626f4f50ba2541d440b45cac51c5d8d6b4c46407a00c15d593c31e96"},"jsonrpc":"2.0","id":1}%
218 | ```
219 |
220 | {% endcode %}
221 |
222 | ### Troubleshooting
223 |
224 | Find below some common errors and how to troubleshoot them:
225 |
226 | **Error: Node cannot start properly because necessary ports are in use!**
227 |
228 | {% code overflow="wrap" fullWidth="false" %}
229 |
230 | ```bash
231 | hiero-local-node % npm run start -- -d
232 |
233 | > @hashgraph/hedera-local@2.26.2 start
234 | > npm run build && node ./build/index.js start -d
235 |
236 |
237 | > @hashgraph/hedera-local@2.26.2 build
238 | > rimraf ./build && tsc
239 |
240 | [Hedera-Local-Node] INFO (StateController) [✔︎] Starting start procedure!
241 | [Hedera-Local-Node] INFO (InitState) ⏳ Making sure that Docker is started and it is correct version...
242 | [Hedera-Local-Node] INFO (DockerService) ⏳ Checking docker compose version...
243 | [Hedera-Local-Node] INFO (DockerService) ⏳ Checking docker resources...
244 | [Hedera-Local-Node] ERROR (DockerService) [✘] [✘] Port 5551 is in use.
245 | [Hedera-Local-Node] ERROR (DockerService) [✘] [✘] Port 8545 is in use.
246 | [Hedera-Local-Node] ERROR (DockerService) [✘] [✘] Port 5600 is in use.
247 | [Hedera-Local-Node] ERROR (DockerService) [✘] [✘] Port 5433 is in use.
248 | [Hedera-Local-Node] ERROR (DockerService) [✘] [✘] Port 8082 is in use.
249 | [Hedera-Local-Node] ERROR (DockerService) [✘] [✘] Port 6379 is in use.
250 | [Hedera-Local-Node] WARNING (DockerService) [!] Port 7546 is in use.
251 | [Hedera-Local-Node] WARNING (DockerService) [!] Port 8080 is in use.
252 | [Hedera-Local-Node] WARNING (DockerService) [!] Port 3000 is in use.
253 | [Hedera-Local-Node] ERROR (DockerService) [✘] [✘] Node cannot start properly because necessary ports are in use!
254 | ```
255 |
256 | {% endcode %}
257 |
258 | {% hint style="success" %}
259 |
260 | #### **Fix**
261 |
262 | - **Option 1:** Instead of starting another instance of the network, use the `npm run generate-accounts` to generate new accounts for an already started network.
263 | - **Option 2:** If you get the above error, ensure that you terminate any existing Docker processes for the local node, as well as any other processes that are bound to these port numbers, before running the npm start command. You can run `docker compose down -v`, `git clean -xfd`, `git reset --hard` to fix this.
264 | {% endhint %}
265 |
266 | ## Useful Terms
267 |
268 | For an in-depth explanation of the different terms below, see the [glossary documentation](https://docs.hedera.com/hedera/support-and-community/glossary).
269 |
270 | - Accounts list (ED25519 keys)
271 | - Private keys
272 | - Public address
273 |
274 | ## Next Steps
275 |
276 | Want to learn how to deploy smart contracts on Hedera? Visit the guide on how to [Deploy a Smart Contract Using Hardhat and Hedera JSON-RPC Relay](https://docs.hedera.com/hedera/tutorials/smart-contracts/deploy-a-smart-contract-using-hardhat-hedera-json-rpc-relay).
277 |
278 | ## Summary
279 |
280 | In this tutorial, we successfully set up and ran the Hedera local node using the [NPM CLI](https://www.npmjs.com/package/@hashgraph/hedera-local) tool, generated default accounts, and solved common errors encountered when running the local node.
281 |
282 | ## Useful Resources
283 |
284 | - Set and Run a Hiero Node using the [Local Hedera Package](https://github.com/hashgraph/hedera-local-node?tab=readme-ov-file#using-hedera-local).
285 | - [Setup node using Docker CLI](https://github.com/hashgraph/hedera-local-node?tab=readme-ov-file#docker).
286 | - Use [local network variables](https://github.com/hashgraph/hedera-local-node?tab=readme-ov-file#network-variables) to interact with Consensus and Mirror Nodes
287 | - Using [Grafana and Prometheus Endpoints](https://github.com/hashgraph/hedera-local-node?tab=readme-ov-file#grafana--prometheus).
288 |
289 |