Code Monkey home page Code Monkey logo

hedera-local-node's Introduction

Smoke Testsnpm (tag) Environment Variables Made With License

The Hedera Local Node project allows developers to set up their own local network. The local network is composed of one mirror node and one consensus node. You can set this up by either using the CLI tool or by running Docker.

NOTE: It's recomended to start using the CLI Tool.

Requirements

  • Node.js >= v14.x
    • Node version check: node -v
  • NPM >= v6.14.17
    • NPM version check: npm -v
  • Docker >= v20.10.x
    • Docker version check: docker -v
  • Docker Compose => v2.12.2
    • Docker Compose version check: docker compose version
  • Minimum 16GB RAM

Note:

  • Ensure the VirtioFS file sharing implementation is enabled in the docker settings.

Note: The image may look different if you are on a different version docker-compose-settings.png

  • Ensure the following configurations are set at minimum in Docker Settings -> Resources and are available for use
    • CPUs: 6
    • Memory: 8GB
    • Swap: 1 GB
    • Disk Image Size: 64 GB

Note: The image may look different if you are on a different version settings.png

  • Ensure the Allow the default Docker sockets to be used (requires password) is enabled in Docker Settings -> Advanced.

Note: The image may look different if you are on a different version docker-socket-setting

CLI Tool - @hashgraph/hedera-local

What

This package defines cli commands, that can be executed via node (npx), for interacting with the Local Hedera Network.

Installation

Official NPM Release

The command below can be used to install the official release from the NPM repository. This version may not reflect the most recent changes to the main branch of this repository.

This version uses a baked in version of the Docker Compose definitions and will not reflect any local changes made to the repository.

npm install @hashgraph/hedera-local -g

Local Development Installation

The command below can be used to install the hedera-local module as a symlink against your locally checked out copy of this repository.

This is the recommended method for testing against the latest changes or a point in time version from a branch/tag.

npm install && npm install -g

Using npm

npm run start to start the network npm run restart to restart the network npm run stop to stop the network npm run generate-accounts to generate new account for already started network

NOTE: If you want to use any of the CLI options listed below, you'd need to pass -- after npm run start (for example) and then specify the wanted option. For example, if you want to start in detached mode, you can use npm run start -- -d

Using hedera-local

$ hedera

Local Hedera Package - Runs consensus and mirror nodes on localhost:
- consensus node url - 127.0.0.1:50211
- node id - 0.0.3
- mirror node url - http://127.0.0.1:5551

Available commands:
    start - Starts the local hedera network.
        options:
            --d or --detached for starting in detached mode.
            --verbose set the verbose level. Defaults to 'info' choices are "info" & "trace"
            --h or --host to override the default host.
            --n or --network to override the default configuration. Defaults to mainnet.
            --l or --limits to enable/disable the JSON-RPC relay rate limits. Defaults to true.
            --dev to enable/disable developer mode.
            --full to enable/disable full mode. Production local-node.
            --multinode     Enable or disable multi-node mode.
            --balance to set starting hbar balance of the created accounts.
            --async to enable or disable asynchronous creation of accounts.
            --b or --blocklist to enable or disable account blocklisting. Depending on how many private keys are blocklisted, this will affect the generated on startup accounts.
            --enable-debug  Enable or disable debugging of the local node [boolean] [default: false]
            --network-tag Select custom network node tag [string] [defaults: predefined selected configuration]
            --mirror-tag Select custom mirror node tag [string] [defaults: predefined selected configuration]
            --relay-tag Select custom hedera-json-rpc relay tag [string] [defaults: predefined selected configuration]
            --workdir       Path to the working directory for local node [string] [default: "[USER APP DATA]/hedera-local"]
    stop - Stops the local hedera network and delete all the existing data.
    restart - Restart the local hedera network.
    generate-accounts <n> - Generates N accounts, default 10.
        options:
            --h or --host to override the default host.
            --balance to set starting hbar balance of the created accounts.
            --async to enable or disable asynchronous creation of accounts.
    debug [timestamp] - Parses and prints the contents of the record file that has been created
                        during the selected timestamp.
                        Important: Local node must be started with the -g, --enable-debug flag to enable this feature

Note: Generated accounts are 3 types (ECDSA, Alias ECDSA and ED25519). All of them are usable via HederaSDK. Only Alias ECDSA accounts can be imported into wallet like Metamask or used in ethers.

Note: Read more about developer mode here

Commands

hedera start <options>

Demo

  • --accounts - Default is 10. Specify the number of accounts to generate at startup. The first 10 are with predefined private keys, and the next ones are with random generated private keys.

  • --h / --host - Override the default host.

hedera restart <options>

Demo

  • --accounts - Default is 10. Specify the number of accounts to generate at startup. The first 10 are with predefined private keys, and the next ones are with random generated private keys.

  • --h / --host - Override the default host.

hedera start -d <options>

$ hedera start
[Hedera-Local-Node] INFO (StateController) Starting start procedure!
[Hedera-Local-Node] INFO (InitState) Making sure that Docker is started and it's correct version...
[Hedera-Local-Node] INFO (InitState) Setting configuration for local network with latest images on host 127.0.0.1 with dev mode turned off using turbo mode in single node configuration...
[Hedera-Local-Node] INFO (InitState) Hedera JSON-RPC Relay rate limits were disabled.
[Hedera-Local-Node] INFO (InitState) Needed environment variables were set for this configuration.
[Hedera-Local-Node] INFO (InitState) Needed bootsrap properties were set for this configuration.
[Hedera-Local-Node] INFO (InitState) Needed mirror node properties were set for this configuration.
[Hedera-Local-Node] INFO (StartState) Starting Hedera Local Node...
[Hedera-Local-Node] INFO (StartState) Detecting network...
[Hedera-Local-Node] INFO (StartState) Hedera Local Node successfully started!
[Hedera-Local-Node] INFO (NetworkPrepState) Starting Network Preparation State...
[Hedera-Local-Node] INFO (NetworkPrepState) Imported fees successfully
[Hedera-Local-Node] INFO (NetworkPrepState) Topic was created!
[Hedera-Local-Node] INFO (AccountCreationState) Starting Account Creation state in synchronous mode...
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------| Accounts list ( ECDSA  keys) |----------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |    id    |                            private key                            |  balance |
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1002 - 0x2c55a65b9ae99b5aee790f3f07634896627a26c9fd8460c97058b32579684b60 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1003 - 0x0e2161b2e6f2d801ef364042e6c0792aa10e07fa38680de06d4db0036c44f4b6 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1004 - 0x30173710e439883b329042c1a5e15b0e982a2caf3e9c7e93e3c88b953addd651 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1005 - 0x3ee101ae0556279500bcb276d80db192ffe7a36d9a3e5530dcdc9ba30c88f96c - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1006 - 0x755c4df6c25868d47d734a2567cc2b40e23cc6b042ae9c1e9906750fadb715fa - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1007 - 0xf5ca2d9f83c42f37091b0b28536f95bbfaca637f3eca99491184c6bf893897ec - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1008 - 0xc1e9e486450d8f2a7f6a211ae8e9fce9b9807f593fe853fe1a29a2204907d946 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1009 - 0x5881aa6c3af348248c4a18d5fa876dd973c5308f2fb818dbb857e742d9dbfa6d - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1010 - 0x28f6c9477a68e7082d4bae82a1333acdf90463e3a33cef9eec45500d449a855a - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1011 - 0x1e3cc555262836a8b19fe0d42dc597f61299ab08a916df31d0bc0a4286e3969b - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |------------------------------------------------| Accounts list (Alias ECDSA keys) |--------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |    id    |               public address               |                             private key                            | balance |
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1012 - 0x67D8d32E9Bf1a9968a5ff53B87d777Aa8EBBEe69 - 0x105d050185ccb907fba04dd92d8de9e32c18305e097ab41dadda21489a211524 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1013 - 0x05FbA803Be258049A27B820088bab1cAD2058871 - 0x2e1d968b041d84dd120a5860cee60cd83f9374ef527ca86996317ada3d0d03e7 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1014 - 0x927E41Ff8307835A1C081e0d7fD250625F2D4D0E - 0x45a5a7108a18dd5013cf2d5857a28144beadc9c70b3bdbd914e38df4e804b8d8 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1015 - 0xc37f417fA09933335240FCA72DD257BFBdE9C275 - 0x6e9d61a325be3f6675cf8b7676c70e4a004d2308e3e182370a41f5653d52c6bd - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1016 - 0xD927017F5a6a7A92458b81468Dc71FCE6115B325 - 0x0b58b1bd44469ac9f813b5aeaf6213ddaea26720f0b2f133d08b6f234130a64f - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1017 - 0x5C41A21F14cFe9808cBEc1d91b55Ba75ed327Eb6 - 0x95eac372e0f0df3b43740fa780e62458b2d2cc32d6a440877f1cc2a9ad0c35cc - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1018 - 0xcdaD5844f865F379beA057fb435AEfeF38361B68 - 0x6c6e6727b40c8d4b616ab0d26af357af09337299f09c66704146e14236972106 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1019 - 0x6e5D3858f53FC66727188690946631bDE0466B1A - 0x5072e7aa1b03f531b4731a32a021f6a5d20d5ddc4e55acbb71ae202fc6f3a26d - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1020 - 0x29cbb51A44fd332c14180b4D471FBBc6654b1657 - 0x60fe891f13824a2c1da20fb6a14e28fa353421191069ba6b6d09dd6c29b90eff - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1021 - 0x17b2B8c63Fa35402088640e426c6709A254c7fFb - 0xeae4e00ece872dd14fb6dc7a04f390563c7d69d16326f2a703ec8e0934060cc7 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------| Accounts list (ED25519 keys) |----------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |    id    |                            private key                            |  balance |
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1022 - 0x44162cd9b9a2f5582bd13b43cfd8be3bc20b8a81ee77f6bf77391598bcfbae4c - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1023 - 0x50426a7375c3e033608e48a62db7bb8da8be27dc1c9034c5961a1ad15545c3d2 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1024 - 0x28c014594a9dad332bf2fb50fb2aaeca8553fc5c7b48fe06494db6d682cac365 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1025 - 0xb297f0babbf300340fece9985ecf1e9d9b6a2e862043d439075cc88e042760cf - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1026 - 0xe253b897329ef661bbf9af82f669519ce567b69ccc5ae5fead06258ccd1c7cb3 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1027 - 0x2acb0b3ed8ca6af74edb24078d88901a311f735e25df13ce9494579838345a74 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1028 - 0x1a0afad1f38f10514afa5698706cdd19db7ec8e345a416dd66826dd039824ada - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1029 - 0x0d758d68de1c88a785e38b5d23c9459137dd5ae2b79c89b570307f5d35d5039e - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1030 - 0x80bb2f571d08f301f0b4b651c0d249bff6db6c7b727afe74bc8b9b3f0ad11579 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1031 - 0xd26a61159018a3c9824388368cb4ecae278f9244724fd93ecb965fc7e2d9808e - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (CleanUpState) Initiating clean up procedure. Trying to revert unneeded changes to files...
[Hedera-Local-Node] INFO (CleanUpState) Clean up of consensus node properties finished.
[Hedera-Local-Node] INFO (CleanUpState) Clean up of mirror node properties finished.
  • --accounts - Default is 10 per type. Specify the number of accounts to generate at startup. The first 10 are with predefined private keys, and the next ones are with random generated private keys.

  • --d / --detached - Start the local node in detached mode.

  • --h / --host - Override the default host.

$ hedera start --accounts=2
[Hedera-Local-Node] INFO (StateController) Starting start procedure!
[Hedera-Local-Node] INFO (InitState) Making sure that Docker is started and it's correct version...
[Hedera-Local-Node] INFO (InitState) Setting configuration for local network with latest images on host 127.0.0.1 with dev mode turned off using turbo mode in single node configuration...
[Hedera-Local-Node] INFO (InitState) Hedera JSON-RPC Relay rate limits were disabled.
[Hedera-Local-Node] INFO (InitState) Needed environment variables were set for this configuration.
[Hedera-Local-Node] INFO (InitState) Needed bootsrap properties were set for this configuration.
[Hedera-Local-Node] INFO (InitState) Needed mirror node properties were set for this configuration.
[Hedera-Local-Node] INFO (StartState) Starting Hedera Local Node...
[Hedera-Local-Node] INFO (StartState) Detecting network...
[Hedera-Local-Node] INFO (StartState) Hedera Local Node successfully started!
[Hedera-Local-Node] INFO (NetworkPrepState) Starting Network Preparation State...
[Hedera-Local-Node] INFO (NetworkPrepState) Imported fees successfully
[Hedera-Local-Node] INFO (NetworkPrepState) Topic was created!
[Hedera-Local-Node] INFO (AccountCreationState) Starting Account Creation state in synchronous mode...
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------| Accounts list ( ECDSA  keys) |----------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |    id    |                            private key                            |  balance |
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1002 - 0x2c55a65b9ae99b5aee790f3f07634896627a26c9fd8460c97058b32579684b60 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1003 - 0x0e2161b2e6f2d801ef364042e6c0792aa10e07fa38680de06d4db0036c44f4b6 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |------------------------------------------------| Accounts list (Alias ECDSA keys) |--------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |    id    |               public address               |                             private key                            | balance |
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1004 - 0x67D8d32E9Bf1a9968a5ff53B87d777Aa8EBBEe69 - 0x105d050185ccb907fba04dd92d8de9e32c18305e097ab41dadda21489a211524 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1005 - 0x05FbA803Be258049A27B820088bab1cAD2058871 - 0x2e1d968b041d84dd120a5860cee60cd83f9374ef527ca86996317ada3d0d03e7 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------| Accounts list (ED25519 keys) |----------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |    id    |                            private key                            |  balance |
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1006 - 0x44162cd9b9a2f5582bd13b43cfd8be3bc20b8a81ee77f6bf77391598bcfbae4c - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1007 - 0x50426a7375c3e033608e48a62db7bb8da8be27dc1c9034c5961a1ad15545c3d2 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (CleanUpState) Initiating clean up procedure. Trying to revert unneeded changes to files...
[Hedera-Local-Node] INFO (CleanUpState) Clean up of consensus node properties finished.
[Hedera-Local-Node] INFO (CleanUpState) Clean up of mirror node properties finished.

hedera stop

$ hedera stop
[Hedera-Local-Node] INFO (StateController) Starting stop procedure!
[Hedera-Local-Node] INFO (StopState) Initiating stop procedure. Trying to stop docker containers and clean up volumes...
[Hedera-Local-Node] INFO (StopState) Stopping the network...
[Hedera-Local-Node] INFO (StopState) Hedera Local Node was stopped successfully.

No available options


hedera restart -d <options>

$ hedera restart
[Hedera-Local-Node] INFO (StateController) Starting restart procedure!
[Hedera-Local-Node] INFO (StopState) Initiating stop procedure. Trying to stop docker containers and clean up volumes...
[Hedera-Local-Node] INFO (StopState) Stopping the network...
[Hedera-Local-Node] INFO (StopState) Hedera Local Node was stopped successfully.
[Hedera-Local-Node] INFO (InitState) Making sure that Docker is started and it's correct version...
[Hedera-Local-Node] INFO (InitState) Setting configuration for local network with latest images on host 127.0.0.1 with dev mode turned off using turbo mode in single node configuration...
[Hedera-Local-Node] INFO (InitState) Hedera JSON-RPC Relay rate limits were disabled.
[Hedera-Local-Node] INFO (InitState) Needed environment variables were set for this configuration.
[Hedera-Local-Node] INFO (InitState) Needed bootsrap properties were set for this configuration.
[Hedera-Local-Node] INFO (InitState) Needed mirror node properties were set for this configuration.
[Hedera-Local-Node] INFO (StartState) Starting Hedera Local Node...
[Hedera-Local-Node] INFO (StartState) Detecting network...
[Hedera-Local-Node] INFO (StartState) Hedera Local Node successfully started!
[Hedera-Local-Node] INFO (NetworkPrepState) Starting Network Preparation State...
[Hedera-Local-Node] INFO (NetworkPrepState) Imported fees successfully
[Hedera-Local-Node] INFO (NetworkPrepState) Topic was created!
[Hedera-Local-Node] INFO (AccountCreationState) Starting Account Creation state in synchronous mode...
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------| Accounts list ( ECDSA  keys) |----------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |    id    |                            private key                            |  balance |
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1002 - 0x2c55a65b9ae99b5aee790f3f07634896627a26c9fd8460c97058b32579684b60 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1003 - 0x0e2161b2e6f2d801ef364042e6c0792aa10e07fa38680de06d4db0036c44f4b6 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1004 - 0x30173710e439883b329042c1a5e15b0e982a2caf3e9c7e93e3c88b953addd651 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1005 - 0x3ee101ae0556279500bcb276d80db192ffe7a36d9a3e5530dcdc9ba30c88f96c - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1006 - 0x755c4df6c25868d47d734a2567cc2b40e23cc6b042ae9c1e9906750fadb715fa - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1007 - 0xf5ca2d9f83c42f37091b0b28536f95bbfaca637f3eca99491184c6bf893897ec - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1008 - 0xc1e9e486450d8f2a7f6a211ae8e9fce9b9807f593fe853fe1a29a2204907d946 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1009 - 0x5881aa6c3af348248c4a18d5fa876dd973c5308f2fb818dbb857e742d9dbfa6d - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1010 - 0x28f6c9477a68e7082d4bae82a1333acdf90463e3a33cef9eec45500d449a855a - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1011 - 0x1e3cc555262836a8b19fe0d42dc597f61299ab08a916df31d0bc0a4286e3969b - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |------------------------------------------------| Accounts list (Alias ECDSA keys) |--------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |    id    |               public address               |                             private key                            | balance |
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1012 - 0x67D8d32E9Bf1a9968a5ff53B87d777Aa8EBBEe69 - 0x105d050185ccb907fba04dd92d8de9e32c18305e097ab41dadda21489a211524 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1013 - 0x05FbA803Be258049A27B820088bab1cAD2058871 - 0x2e1d968b041d84dd120a5860cee60cd83f9374ef527ca86996317ada3d0d03e7 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1014 - 0x927E41Ff8307835A1C081e0d7fD250625F2D4D0E - 0x45a5a7108a18dd5013cf2d5857a28144beadc9c70b3bdbd914e38df4e804b8d8 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1015 - 0xc37f417fA09933335240FCA72DD257BFBdE9C275 - 0x6e9d61a325be3f6675cf8b7676c70e4a004d2308e3e182370a41f5653d52c6bd - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1016 - 0xD927017F5a6a7A92458b81468Dc71FCE6115B325 - 0x0b58b1bd44469ac9f813b5aeaf6213ddaea26720f0b2f133d08b6f234130a64f - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1017 - 0x5C41A21F14cFe9808cBEc1d91b55Ba75ed327Eb6 - 0x95eac372e0f0df3b43740fa780e62458b2d2cc32d6a440877f1cc2a9ad0c35cc - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1018 - 0xcdaD5844f865F379beA057fb435AEfeF38361B68 - 0x6c6e6727b40c8d4b616ab0d26af357af09337299f09c66704146e14236972106 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1019 - 0x6e5D3858f53FC66727188690946631bDE0466B1A - 0x5072e7aa1b03f531b4731a32a021f6a5d20d5ddc4e55acbb71ae202fc6f3a26d - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1020 - 0x29cbb51A44fd332c14180b4D471FBBc6654b1657 - 0x60fe891f13824a2c1da20fb6a14e28fa353421191069ba6b6d09dd6c29b90eff - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1021 - 0x17b2B8c63Fa35402088640e426c6709A254c7fFb - 0xeae4e00ece872dd14fb6dc7a04f390563c7d69d16326f2a703ec8e0934060cc7 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------| Accounts list (ED25519 keys) |----------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |    id    |                            private key                            |  balance |
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1022 - 0x44162cd9b9a2f5582bd13b43cfd8be3bc20b8a81ee77f6bf77391598bcfbae4c - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1023 - 0x50426a7375c3e033608e48a62db7bb8da8be27dc1c9034c5961a1ad15545c3d2 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1024 - 0x28c014594a9dad332bf2fb50fb2aaeca8553fc5c7b48fe06494db6d682cac365 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1025 - 0xb297f0babbf300340fece9985ecf1e9d9b6a2e862043d439075cc88e042760cf - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1026 - 0xe253b897329ef661bbf9af82f669519ce567b69ccc5ae5fead06258ccd1c7cb3 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1027 - 0x2acb0b3ed8ca6af74edb24078d88901a311f735e25df13ce9494579838345a74 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1028 - 0x1a0afad1f38f10514afa5698706cdd19db7ec8e345a416dd66826dd039824ada - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1029 - 0x0d758d68de1c88a785e38b5d23c9459137dd5ae2b79c89b570307f5d35d5039e - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1030 - 0x80bb2f571d08f301f0b4b651c0d249bff6db6c7b727afe74bc8b9b3f0ad11579 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1031 - 0xd26a61159018a3c9824388368cb4ecae278f9244724fd93ecb965fc7e2d9808e - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (CleanUpState) Initiating clean up procedure. Trying to revert unneeded changes to files...
[Hedera-Local-Node] INFO (CleanUpState) Clean up of consensus node properties finished.
[Hedera-Local-Node] INFO (CleanUpState) Clean up of mirror node properties finished.
  • --accounts - Default is 10. Specify the number of accounts to generate at startup. The first 10 are with predefined private keys, and the next ones are with random generated private keys.

  • --d / --detached - Start the local node in detached mode.

  • --h / --host - Override the default host.

$ hedera restart --accounts=2
[Hedera-Local-Node] INFO (StateController) Starting restart procedure!
[Hedera-Local-Node] INFO (StopState) Initiating stop procedure. Trying to stop docker containers and clean up volumes...
[Hedera-Local-Node] INFO (StopState) Stopping the network...
[Hedera-Local-Node] INFO (StopState) Hedera Local Node was stopped successfully.
[Hedera-Local-Node] INFO (InitState) Making sure that Docker is started and it's correct version...
[Hedera-Local-Node] INFO (InitState) Setting configuration for local network with latest images on host 127.0.0.1 with dev mode turned off using turbo mode in single node configuration...
[Hedera-Local-Node] INFO (InitState) Hedera JSON-RPC Relay rate limits were disabled.
[Hedera-Local-Node] INFO (InitState) Needed environment variables were set for this configuration.
[Hedera-Local-Node] INFO (InitState) Needed bootsrap properties were set for this configuration.
[Hedera-Local-Node] INFO (InitState) Needed mirror node properties were set for this configuration.
[Hedera-Local-Node] INFO (StartState) Starting Hedera Local Node...
[Hedera-Local-Node] INFO (StartState) Detecting network...
[Hedera-Local-Node] INFO (StartState) Hedera Local Node successfully started!
[Hedera-Local-Node] INFO (NetworkPrepState) Starting Network Preparation State...
[Hedera-Local-Node] INFO (NetworkPrepState) Imported fees successfully
[Hedera-Local-Node] INFO (NetworkPrepState) Topic was created!
[Hedera-Local-Node] INFO (AccountCreationState) Starting Account Creation state in synchronous mode...
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------| Accounts list ( ECDSA  keys) |----------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |    id    |                            private key                            |  balance |
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1002 - 0x2c55a65b9ae99b5aee790f3f07634896627a26c9fd8460c97058b32579684b60 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1003 - 0x0e2161b2e6f2d801ef364042e6c0792aa10e07fa38680de06d4db0036c44f4b6 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |------------------------------------------------| Accounts list (Alias ECDSA keys) |--------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |    id    |               public address               |                             private key                            | balance |
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1004 - 0x67D8d32E9Bf1a9968a5ff53B87d777Aa8EBBEe69 - 0x105d050185ccb907fba04dd92d8de9e32c18305e097ab41dadda21489a211524 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1005 - 0x05FbA803Be258049A27B820088bab1cAD2058871 - 0x2e1d968b041d84dd120a5860cee60cd83f9374ef527ca86996317ada3d0d03e7 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------| Accounts list (ED25519 keys) |----------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |    id    |                            private key                            |  balance |
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1006 - 0x44162cd9b9a2f5582bd13b43cfd8be3bc20b8a81ee77f6bf77391598bcfbae4c - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1007 - 0x50426a7375c3e033608e48a62db7bb8da8be27dc1c9034c5961a1ad15545c3d2 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (CleanUpState) Initiating clean up procedure. Trying to revert unneeded changes to files...
[Hedera-Local-Node] INFO (CleanUpState) Clean up of consensus node properties finished.
[Hedera-Local-Node] INFO (CleanUpState) Clean up of mirror node properties finished.

hedera generate-accounts <num>

$ hedera generate-accounts 2
[Hedera-Local-Node] INFO (AccountCreationState) |------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |------------------------------| Accounts list (ECDSA keys) |------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |    id    |                            private key                             |  balance |
[Hedera-Local-Node] INFO (AccountCreationState) |------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1008 - 0x626404782c00c1b6b865a43a8de0680296951564fd6c3b3945e04383d24e3c52 - 100000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1009 - 0x227641ce4807f719560627825d9799135e849689eb1c863add1682161970efd6 - 100000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) |------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------| Accounts list (Alias ECDSA keys) |------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |    id    |              public address                |                             private key                            | balance |
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1010 - 0xeBaea5B3BB2f7C96C035804C7913eC79593f3097 - 0xa44cbbd0d48c6b534fc7b243b267bae73f5843df71c73628c9883ff20c660b04 - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1011 - 0x58a2452e618586c439325d549Ef9d1549e3c7A26 - 0x79a9bcb39994373774c06bb0a5e8289ffe8f8a734e2c01e32186196fb68abccf - 10000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) |--------------------------------------------------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |-----------------------------| Accounts list (ED25519 keys) |-----------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) |    id    |                            private key                             |  balance |
[Hedera-Local-Node] INFO (AccountCreationState) |------------------------------------------------------------------------------------------|
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1012 - 0x5f608a35c956fbb1d932c0f3fc113d308041a595351adeddf4e93cee59c1b978 - 100000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) | 0.0.1013 - 0x3fcd5855969a881dcaad4446101a3241ccb5d6e7237f3a55b19268bfcbfdfa91 - 100000 ℏ |
[Hedera-Local-Node] INFO (AccountCreationState) |------------------------------------------------------------------------------------------|
  • --h / --host - Override the default host.

Network specific configuration

Network specific configurations can be applied using the -n/--network option when starting/restarting the local node. Pre-configured options are mainnet, previewnet, testnet and local

To create a custom network configuration, you can edit the src/configuration/local.json with the images and properties that you want and just start the network with npm run start.


You can use it in a hardhat project by adding the following config:

defaultNetwork: 'local',
  networks: {
    local: {
      url: 'http://localhost:7546',
      accounts: [
        0x105d050185ccb907fba04dd92d8de9e32c18305e097ab41dadda21489a211524,
        0x2e1d968b041d84dd120a5860cee60cd83f9374ef527ca86996317ada3d0d03e7
      ],
      chainId: 298,
    },
    testnet: {
      url: 'https://testnet.hashio.io/api',
      accounts: [],
      chainId: 296,
    },
  },

Docker

NOTE: This will not create accounts on startup, nor will perform any kind of checks.

Start Your Local Network

  1. Clone the hedera-local-node repo
git clone https://github.com/hashgraph/hedera-local-node.git
  1. CD to the hedera-local-node directory
    cd hedera-local-node

For Windows users: You will need to update the file endings of compose-network/mirror-node/init.sh by running this in WSL:

    dos2unix compose-network/mirror-node/init.sh
  1. Run docker compose up -d from the terminal to get the network up and running
  2. Set-up your local network client by following this tutorial

Stop Your Local Network

  1. Run docker compose down -v; git clean -xfd; git reset --hard to stop and remove the containers, volumes and clean manually generated files. If you would like to keep any files created manually in the working directory please save them before executing this command.

Network Variables

These are the local network variables to interact with the consensus and mirror node.

  • Consensus Node Endpoint

    • 127.0.0.1:50211
    • The IP address and port of the local consensus node.

      NOTE: To connect to the local consensus node from a browser you will have to use the Envoy proxy at http://127.0.0.1:50213.

  • Consensus Node Account ID

    • 0.0.3
    • The node account ID to submit transactions and queries to
  • Mirror Node GRPC Endpoint

    • 127.0.0.1:5600
    • The mirror node network to use
  • Mirror Node REST API Endpoint

    • 127.0.0.1:5551
    • The endpoint to submit rest API requests to
  • Account ID

    • 0.0.2
    • The account ID to use to pay for transactions and queries
  • Account Key

    • 302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137
    • The private key to account 0.0.2 to sign transactions and queries with

Folder set up

  1. compose-network folder has the static files needed for starting Local network.
  2. compose-network/grafana/dashboards folder contains the Grafana dashboard definitions in JSON format which will be automatically provisioned at startup.
  3. compose-network/grafana/datasources folder contains the Grafana datasource definitions in YAML format which wil be automatically provisioned at startup.
  4. network-logs folder will be created at runtime in the working directory and will have all the log files generated after starting local node.

The local node writes its ephemeral data to a working directory which can be set using the --workdir flag, and has a default value dependant on the OS of the user

OS Default Working Directory
MacOS ~/Library/Application Support/hedera-local
Linux ~/.local/share/hedera-local
Windows %USERPROFILE%\AppData\Local\hedera-local

Steps to change the memory limits, properties and other configurations

The following environment variables can be changed in the .env file for various memory limits

  1. Platform
    • PLATFORM_JAVA_HEAP_MIN
    • PLATFORM_JAVA_HEAP_MAX
  2. Consensus node
    • NETWORK_NODE_MEM_LIMIT
  3. Mirror node
    • MIRROR_GRPC_MEM_LIMIT - memory limit for mirror node gRPC
    • MIRROR_IMPORTER_MEM_LIMIT - memory limit for mirror node importer
    • MIRROR_REST_MEM_LIMIT - memory limit for mirror node rest api
    • MIRROR_WEB3_MEM_LIMIT - memory limit for mirror node web3
  4. To change application.properties, api-permission.properties or bootstrap.properties properties, update the APPLICATION_CONFIG_PATH to the location of updated config folder in .env file

IMPORTANT : Ensure to do docker compose down -v; git clean -xfd; git reset --hard and then docker compose up -d for the new changes to take any effect.

✘ The keys under network-node (hedera.key, hedera.crt and the keys folder) are only intended to be used for testing with this docker based local network. These keys should not be used with any other networks.

Exposed Endpoints

Type Endpoint
Consensus Node Endpoint http://localhost:50211
Mirror Node GRPC Endpoint http://localhost:5600
Mirror Node REST API Endpoint http://localhost:5551
JSON RPC Relay Endpoint http://localhost:7546
JSON RPC Relay Websocket Endpoint http://localhost:8546
Mirror Node Explorer http://localhost:8080
Grafana UI http://localhost:3000
Prometheus UI http://localhost:9090

Grafana & Prometheus

Accessing Prometheus

The deployed Prometheus instance may be accessed from http://localhost:9090 and no credentials are required.

Accessing Grafana

The deployed Grafana instance may be accessed from http://localhost:3000 and the following default credentials are needed at first login:

User Name Password
admin admin

Adding New Dashboards

Creating new dashboards may be accomplished using the Grafana visual editor; however, these dashboards will not persist after a docker compose down -v command or any other command which removes the named volumes.

Dashboards may be exported as JSON definitions and placed under the compose-network/grafana/dashboards folder to ensure they are automatically restored after a docker compose down -v or equivalent operation.

Any dashboard definitions placed into the root of the compose-network/grafana/dashboards folder will appear under the General folder in the Grafana dashboard list Placing dashboards under a subfolder will result in a new folder in the Grafana dashboard list and the dashboards will be deployed under the folder.

Support

If you have a question on how to use the product, please see our support guide.

Contributing

Contributions are welcome. Please see the contributing guide to see how you can get involved.

Code of Conduct

This project is governed by the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to [email protected].

License

Apache License 2.0

hedera-local-node's People

Contributors

alfredog87 avatar attest08 avatar beeradb avatar bguiz avatar daniel-k-ivanov avatar dependabot[bot] avatar dimitrovmaksim avatar ebadiere avatar georgi-l95 avatar github-actions[bot] avatar isavov avatar ivo-yankov avatar junsikchoi avatar kalina-todorova avatar konstantinabl avatar lukelee-sl avatar nana-ec avatar natanasow avatar nathanklick avatar neeharika-sompalli avatar rbarkersl avatar sergioaiobuilders avatar simihunjan avatar stefan-stefanooov avatar theekrystallee avatar victor-yanev avatar yaroslav-007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hedera-local-node's Issues

Add option for detached mode

Problem

Currently there is no option for detached start of the local node. It's always running in the foreground.

Solution

Add option --d / --detached

Alternatives

No response

getting hbars in local node

i have set up a local node without cli wrapper. i am not able to execute file create transaction (error: insufficient payer balance).
pls help.

Investigate docker images download fails, retries interval + message

Issue:
On npx hedera-local start we are downloading the docker images which takes ~1-2 minutes max. Currently though - only some of the images are downloaded (5 out of which only 2 are started). If we run docker-compose up -d separately - then all of the images (12 images) are started. Let's see why the we fail to do so with the start command

Improvements:
Currently we are retrying every 5 seconds and showing the error message each time.
Let's have a message that we are downloading the images and increase the interval a bit
Screenshot 2022-07-06 at 13 23 00

Add Info message after npm install

There is an postinstall script executed after the npm install script.
It executes the docker-compose build command in order to download and prepare the consensus and mirror node images.

The problem is that users do not expect that they must run docker compose when they do npm install.

Solution
Add info message saying that docker must be running in order to finish the npm install script.
Currently the user sees only:

image

Can't sign transactions with generated accounts - failed precheck with status INVALID_SIGNATURE

Description

NOTE: Using macOS with M1 chipset

What happened: While creating an aliased account from one of the generated accounts, we fail withfailed precheck with status INVALID_SIGNATURE when calling TransferTransaction

Expected to see TransferTransaction called successfully and then have an aliased account created

Steps to reproduce

1. Generate the local accounts

➜  hedera-local-node git:(main) ✗ npx hedera-local start
Starting the docker containers...
Starting the network...
Generating accounts...
---------- Accounts list:
0.0.1004 - 0x7f109a9e3b0d8ecfba9cc23a3614433ce0fa7ddcc80f2a8f10b222179a5a80d6 - 100000 ℏ
0.0.1005 - 0x6ec1f2e7d126a74a1d2ff9e1c5d90b92378c725e506651ff8bb8616a5c724628 - 100000 ℏ
0.0.1006 - 0xb4d7f7e82f61d81c95985771b8abf518f9328d019c36849d4214b5f995d13814 - 100000 ℏ
0.0.1007 - 0x941536648ac10d5734973e94df413c17809d6cc5e24cd11e947e685acfbd12ae - 100000 ℏ
0.0.1008 - 0x5829cf333ef66b6bdd34950f096cb24e06ef041c5f63e577b4f3362309125863 - 100000 ℏ
0.0.1009 - 0x8fc4bffe2b40b2b7db7fd937736c4575a0925511d7a0a2dfc3274e8c17b41d20 - 100000 ℏ
0.0.1010 - 0xb6c10e2baaeba1fa4a8b73644db4f28f4bf0912cceb6e8959f73bb423c33bd84 - 100000 ℏ
0.0.1011 - 0xfe8875acb38f684b2025d5472445b8e4745705a9e7adc9b0485a05df790df700 - 100000 ℏ
0.0.1012 - 0xbdc6e0a69f2921a78e9af930111334a41d3fab44653c8de0775572c526feea2d - 100000 ℏ
0.0.1013 - 0x3e215c3d2a59626a669ed04ec1700f36c05c9b216e592f58bbfd3d8aa6ea25f9 - 100000 ℏ
---------- Total: 10 

2. Use a generated account to create an aliased account with the following code snippet

import {
    Client,
    PrivateKey,
    Hbar,
    AccountId,
    AccountBalanceQuery,
    AccountInfoQuery,
    TransferTransaction,
} from "@hashgraph/sdk";

import dotenv from "dotenv";

dotenv.config();

async function main() {
    let client;

    try {
        client = Client.forName({"127.0.0.1:50211":"0.0.3"}).setOperator(
            AccountId.fromString("0.0.1004"),
            PrivateKey.fromStringED25519("0x7f109a9e3b0d8ecfba9cc23a3614433ce0fa7ddcc80f2a8f10b222179a5a80d6")
        );
    } catch (error) {
        throw new Error(
            "Environment variables HEDERA_NETWORK, OPERATOR_ID, and OPERATOR_KEY are required."
        );
    }

    console.log('"Creating" a new account');

    const privateKey = PrivateKey.generateECDSA();
    const publicKey = privateKey.publicKey;

    const aliasAccountId = publicKey.toAccountId(0, 0);

    console.log("Transferring some Hbar to the new account");
    const response = await new TransferTransaction()
        .addHbarTransfer(client.operatorAccountId, new Hbar(10).negated())
        .addHbarTransfer(aliasAccountId, new Hbar(10))
        .execute(client);
    await response.getReceipt(client);

    const balance = await new AccountBalanceQuery()
        .setAccountId(aliasAccountId)
        .execute(client);

    console.log(`Balances of the new account: ${balance.toString()}`);

    const info = await new AccountInfoQuery()
        .setAccountId(aliasAccountId)
        .execute(client);

    console.log(`The normal account ID: ${info.accountId.toString()}`);
    console.log(`The aliased account ID: 0.0.${info.aliasKey.toString()}`);
    console.log(`The private key (use this in sdk/Hedera native wallets): ${privateKey.toString()}`);
    console.log(`The raw private key (use this for JSON RPC wallet import): ${privateKey.toStringRaw()}`);

    console.log("Example complete!");
    client.close();
}

void main();

3. Program throws an error at TransferTransaction()

➜  examples git:(main) ✗ node account-alias-ecdsa.js 
"Creating" a new account
Transferring some Hbar to the new account
file:///Users/michaelgarber/hedera-tools/hedera-json-rpc-relay/docs/examples/node_modules/@hashgraph/sdk/src/PrecheckStatusError.js:35
        super(
        ^

PrecheckStatusError: transaction [email protected] failed precheck with status INVALID_SIGNATURE
    at new PrecheckStatusError (file:///Users/michaelgarber/hedera-tools/hedera-json-rpc-relay/docs/examples/node_modules/@hashgraph/sdk/src/PrecheckStatusError.js:35:9)
    at TransferTransaction._mapStatusError (file:///Users/michaelgarber/hedera-tools/hedera-json-rpc-relay/docs/examples/node_modules/@hashgraph/sdk/src/transaction/Transaction.js:1413:16)
    at TransferTransaction.execute (file:///Users/michaelgarber/hedera-tools/hedera-json-rpc-relay/docs/examples/node_modules/@hashgraph/sdk/src/Executable.js:697:32)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async main (file:///Users/michaelgarber/hedera-tools/hedera-json-rpc-relay/docs/examples/account-alias-ecdsa.js:42:22) {
  status: Status { _code: 7 },
  transactionId: TransactionId {
    accountId: AccountId {
      shard: Long { low: 0, high: 0, unsigned: false },
      realm: Long { low: 0, high: 0, unsigned: false },
      num: Long { low: 1004, high: 0, unsigned: false },
      aliasKey: null,
      aliasEvmAddress: null,
      _checksum: null
    },
    validStart: Timestamp {
      seconds: Long { low: 1657299780, high: 0, unsigned: false },
      nanos: Long { low: 919147360, high: 0, unsigned: false }
    },
    scheduled: false,
    nonce: null
  }
}

Additional context

No response

Hedera network

other

Version

v1.0.3

Operating system

macOS

Prevent creating duplicate config change PRs

Currently when a config file is changed in services and the config change PR is not merge in this repository, the cron job creates duplicate PRs everyday.

Solution:

Change update-config-files.yml to augment one of the for loops to use a HASH=$(sha256sum filename | awk '{ print $1 }') to get the hash of each file and then you can echo a concated string of all the hashes back through sha256sum to get a composite hash and then take the first 8 characters using the cut command, then use those 8 characters as the branch suffix instead of the timestamp.

Support hedera-json-rpc-relay image

Problem

Currently the new hedera-json-rpc-relay container is not made available as part of the hedera-local-node configuration.

Solution

Once a stable v0.1.0 is made available the hedera-json-rpc-relay image should be made available with a similar configuration to relay docker-compose

Alternatives

No response

Optimize the performance through local-node

Worth investigating:

  • speed up the pinger
  • record file export configuration
  • example: hethers poller when listening for logs (every 3 seconds), compare to ethers
  • modify the local-node limit

Add hedera-json-rpc-relay service

Problem

The local-node currently doesn't have a relay service since it was waiting on a stable version.
A v0.1.0 now exists and should be added

Solution

  • Add the relay service to the docker compose using the following template
relay:
    container_name:  json-rpc-relay
    image: "ghcr.io/hashgraph/hedera-json-rpc-relay:${RELAY_IMAGE_TAG}"
    restart: "unless-stopped"
    ports:
      - 7546:7546
    pull_policy: always    
    restart: unless-stopped
    tty: true
  • Add mem service details. may be similar to web3 service
  • Add depends_on rest and network-node
  • Add the RELAY_IMAGE_TAG env variable to modify the relay version. Start with 0.1.0
  • Add env_variable to service details matching relay local configuration. Omit the LOCAL_NODE variable noted

Alternatives

No response

Readme needs to updated

Problem

The readme contains instructions for two separate tools that were merged together.

Solution

Clearly separate the two ways to set up a local network and add additional relevant information.

Alternatives

No response

Generating accounts does not work

Description

I started the network by using the npx hedera-local start command.
Output:

$ npx hedera-local start
Starting the docker containers...
0.22.0: Pulling from hedera-registry/network-node-haveged
Digest: sha256:b1a72fb60ccd62c3c784630113d178f73f7da572c3a8409d73773eeae1ae4133
Status: Downloaded newer image for gcr.io/hedera-registry/network-node-haveged:0.22.0
docker.io/library/postgres@sha256:7ced77a458b7d6f4f3e4abfa55d6428fdcd0016e1926cb7463250b54b06480a1: Pulling from library/postgres
Digest: sha256:7ced77a458b7d6f4f3e4abfa55d6428fdcd0016e1926cb7463250b54b06480a1
Status: Downloaded newer image for postgres@sha256:7ced77a458b7d6f4f3e4abfa55d6428fdcd0016e1926cb7463250b54b06480a1
latest: Pulling from minio/minio
Digest: sha256:cc3940c643eaf91f8236b51442cf23d386a604a90f23adaf599832005a770253
Status: Downloaded newer image for minio/minio:latest
0.4.0: Pulling from hedera-registry/uploader-mirror
Digest: sha256:f16ecf8ea43d3853c185f71c79b95577ecba75ca4ea5d96e2d19137c31d624c4
Status: Downloaded newer image for gcr.io/hedera-registry/uploader-mirror:0.4.0
0.22.0: Pulling from hedera-registry/main-network-node
Digest: sha256:10c8f031c1c67551847ea37bcb90a5429ceefe1702807a1505c6fadaf4792a7c
Status: Downloaded newer image for gcr.io/hedera-registry/main-network-node:0.22.0
13.5-alpine: Pulling from library/postgres
Digest: sha256:8048dd080d627956cc6d9f49eae706b1e71efadcca33f7b16f7a2357d9ff96ef
Status: Downloaded newer image for postgres:13.5-alpine
0.49.0: Pulling from mirrornode/hedera-mirror-grpc
Digest: sha256:50ddad7e3cb8f96726dd973609a27a7127a61d05feac95991c61bcefad06627e
Status: Downloaded newer image for gcr.io/mirrornode/hedera-mirror-grpc:0.49.0
0.49.0: Pulling from mirrornode/hedera-mirror-importer
Digest: sha256:be253eb7e2b9a11f9b58a2b0f048d23944cecf3f32ac4fcfe7834c2320f54cce
Status: Downloaded newer image for gcr.io/mirrornode/hedera-mirror-importer:0.49.0
0.49.0: Pulling from mirrornode/hedera-mirror-rest
Digest: sha256:1d1c164860573bc6d73f48d9e1fd2913b9be26faccd46c936ed6c09f00aa942f
Status: Downloaded newer image for gcr.io/mirrornode/hedera-mirror-rest:0.49.0
0.49.0: Pulling from mirrornode/hedera-mirror-web3
Digest: sha256:d47492f9de0a6f928ca9df86f470497cd1611d535f0659478d6ae433e68e6920
Status: Downloaded newer image for gcr.io/mirrornode/hedera-mirror-web3:0.49.0
node:events:368
     throw er; // Unhandled 'error' event
     ^

Error: connect ECONNREFUSED ::1:5600
   at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16)
Emitted 'error' event on Socket instance at:
   at emitErrorNT (node:internal/streams/destroy:164:8)
   at emitErrorCloseNT (node:internal/streams/destroy:129:3)
   at processTicksAndRejections (node:internal/process/task_queues:83:21) {
 errno: -61,
 code: 'ECONNREFUSED',
 syscall: 'connect',
 address: '::1',
 port: 5600
}

Node.js v17.0.1

The I tried to use npx hedera-local generate-accounts 2 to generate 2 new accounts for the network and received an error.

node:internal/crypto/hash:67
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at createHash (node:crypto:130:10)
    at ripemd160 (/Users/simihunjan/node_modules/@hashgraph/hedera-local/node_modules/@hethers/hdnode/node_modules/@ethersproject/sha2/lib/sha2.js:11:43)
    at new HDNode (/Users/simihunjan/node_modules/@hashgraph/hedera-local/node_modules/@hethers/hdnode/lib/index.js:77:110)
    at Function.HDNode._fromSeed (/Users/simihunjan/node_modules/@hashgraph/hedera-local/node_modules/@hethers/hdnode/lib/index.js:213:16)
    at Function.HDNode.fromMnemonic (/Users/simihunjan/node_modules/@hashgraph/hedera-local/node_modules/@hethers/hdnode/lib/index.js:220:23)
    at Function.Wallet.fromMnemonic (/Users/simihunjan/node_modules/@hashgraph/hedera-local/node_modules/@hethers/wallet/lib/index.js:307:43)
    at Function.Wallet.createRandom (/Users/simihunjan/node_modules/@hashgraph/hedera-local/node_modules/@hethers/wallet/lib/index.js:271:23)
    at Function.generateAccounts (/Users/simihunjan/node_modules/@hashgraph/hedera-local/src/hederaUtils.js:27:35)
    at /Users/simihunjan/node_modules/@hashgraph/hedera-local/cli.js:41:25 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v17.0.1

Steps to reproduce

See above

Additional context

No response

Hedera network

other

Version

0.1.0

Operating system

No response

hedera-local-node don't work on Windows using WSL [users haven't been created]

Discussed in #127

Originally posted by nikania July 22, 2022
I don't know if it's a bug or if I'm doing something incorrectly.

OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.19044 N/A Build 19044
Docker version 20.10.14, build a224086
docker-compose version 1.29.2, build 5becea4c

Problem:
docker-compose up -d starts and runs all services, but logs on database mirror-node-db say that no user roles have been created:

UTC [295] FATAL:  password authentication failed for user "mirror_api"
UTC [295] DETAIL:  Role "mirror_api" does not exist.
Connection matched pg_hba.conf line 99: "host all all all scram-sha-256"
UTC [296] FATAL:  password authentication failed for user "mirror_node"
UTC [296] DETAIL:  Role "mirror_node" does not exist.
Connection matched pg_hba.conf line 99: "host all all all scram-sha-256"

Therefore, the node isn't working. Any suggestions? [ I tried changing line-ending in *.sh scripts to LF - didn't work, tried to run docker-compose as administrator - also didn't work ]

Relay not connecting to the mirror-node

Description

The local node docker-compose relay config is probably not set properly or is lacking additional configuration because the json-rpc-relay cannot connect to the mirror node. Error is:

json-rpc-relay               | [2022-08-18 07:58:12.544 +0000] ERROR (mirror-node/50 on f6303750385c): [GET] blocks/0 567 status
json-rpc-relay               |     err: {
json-rpc-relay               |       "type": "Error",
json-rpc-relay               |       "message": "connect ECONNREFUSED 127.0.0.1:5551",
json-rpc-relay               |       "stack":
json-rpc-relay               |           Error: connect ECONNREFUSED 127.0.0.1:5551
json-rpc-relay               |               at MirrorNodeClient.handleError (/home/node/app/packages/relay/dist/lib/clients/mirrorNodeClient.js:107:27)
json-rpc-relay               |               at MirrorNodeClient.<anonymous> (/home/node/app/packages/relay/dist/lib/clients/mirrorNodeClient.js:95:22)
json-rpc-relay               |               at Generator.throw (<anonymous>)
json-rpc-relay               |               at rejected (/home/node/app/packages/relay/dist/lib/clients/mirrorNodeClient.js:25:65)
json-rpc-relay               |               at processTicksAndRejections (node:internal/process/task_queues:96:5)
json-rpc-relay               |     }
json-rpc-relay               | [2022-08-18 07:58:12.544 +0000] ERROR (Internal error/50 on f6303750385c)

Steps to reproduce

  1. Start the local node with docker-compose up or node cli.js start
  2. Try to execute eth calls agains the relay

Tried both running a local graph node and also deploying a contract using ethers

Additional context

No response

Hedera network

other

Version

v1.1.0

Operating system

macOS

Release a new version of the local node

Problem

The CLI commands work in some environments and not in others.

Solution

The solution is to release another version of the local node to see if it helps resolves the issues.

Alternatives

No response

Run latest version of Hedera Service

Problem

For now, it's now pulling specific version of all the docker images for grpc, importer, main node, etc.
Can we make sure it's pulling latest version, so that we can have local node running which is exact copy of mainnet/testnet functionality?

Solution

  • Tag the docker images with latest, or something, and use it from docker-compose.yml

Alternatives

No response

Connection refused for Mirror Node GRPC Endpoint

Description

Hello all,

Trying to start the local node with the following command:
npx hedera-local start

I had the following error:

image

It looks like the Mirror Node GRPC Endpoint refusing a connection to the port 5600 when using the package hedera-local.

I tried standing the network using docker-compose up -d. So, I checked that all the docker containers were running and listening with the right ports:
image

It seems to have worked

Steps to reproduce

  1. Clone repo
  2. Execute docker-compose up -d
  3. Run npx hedera-local start to get the defaults accounts

Additional context

image

Hedera network

other

Version

v1.0.1

Operating system

macOS

npm install --save -dev 'hedera-local' gives following error, pls help

npm install --save-dev 'hedera-local'
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/'hedera-local' - Not found
npm ERR! 404
npm ERR! 404 ''hedera-local'@' is not in this registry.
npm ERR! 404 This package name is not valid, because
npm ERR! 404 1. name can no longer contain special characters ("~'!()
")
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Vipul\AppData\Local\npm-cache_logs\2022-04-24T14_14_39_786Z-debug-0.log

CLI Should keep the process on focus and not in the background

Currently when npx local-node start is executed there are a bunch of scripts that are performed and after that the node is running in the background. This is flawed because developers do not know what / whether something is running and may even "forget" that they are running a local node.

Solution
When the local node is started, keep the process on focus and not place it in the background. Executing CMD + C or CTRL + C should stop the process

Add Hedera Mirror Node Explorer to the local node

Problem

It is difficult to see what happened on my network when I ran transactions. I can query the mirror node, but that is pretty low level.

Solution

Add the mirror node explorer to the set of containers. It should be wired up to the mirror node by default.

Alternatives

No response

Remove the node based pinger implementation

Description

As of PR #96, which was merged on Jun 23, 2022, the mirror node monitor was added to facilitate providing a steady flow of transactions at a rate of 1 TPS. The node.js based logic in this repository duplicates the functionality already provided by the official mirror node monitor; therefore, the node.js implementation should be removed.

Steps to reproduce

  1. Run hedera-local start
  2. Notice the node.js based pinger has been spawned in a background process.

Additional context

No response

Hedera network

other

Version

v1.1.0

Operating system

No response

Merge local node from limechain repo

Problem

The hedera local node needs to be under the Hashgraph organization.

Solution

Merge hedera local node project from the limechain repo to this repo.

Alternatives

No response

pls address the issues created

i request developers to address the issues created. I am very new and my issues may be very naïve, but if answers are available, then it will be of great help.

Modify consensus node and mirror node versions

Problem

Currently, you cannot switch through the different versions that are on previewnet, testnet, and mainnet.

Solution

The node.js toolchain needs to optionally allow the user to specify which version of the mirror node or consensus node and have it overload the tags specified in the .env file appropriately.

The user should be able to select from the following tags:

  • mainnet
  • testnet
  • latest

Alternatives

No response

Update container versions for mainnet

Problem

We need to update the .env file versions to match the mainnet 0.26.2 version released on June 9th, 2022.

Solution

  • Update the version numbers.

Alternatives

No response

Local node needs a pinger for reliable mirror operation

Description

The creation of record files every 2s is entirely dependent on a steady stream of transactions, if the local node is operating with low throughput, transactions can fail to appear in mirror node until another transaction is submitted.

Suggest we implement "pinger" which executes a crypto transfer from 0.0.2 to 0.0.3 (for example) such that there is a constant stream of transactions, maybe execute the transaction every second or every 2 seconds.

Steps to reproduce

Start a local network, execute a single transaction, check mirror node, the transaction doesn't appear until another transaction is sent to the network some time later.

Additional context

No response

Hedera network

other

Version

v1.0.2

Operating system

No response

Unable to interact with Consensus Node from Browser

Currently, there is no way of using the hedera SDK within a browser and interact with a local hedera node. We are using hashgraph/sdk to do that but when it is used in a browser, the sdk cannot communicate directly with the local-node, it must be connected to an envoy-proxy that exposes a grpc-web endpoint. SDK does not support regular gprc communication.

Solution
Add proxy that would expose grpc-web endpoint for the consensus node.

Support multiple nodes in the local hedera network

Problem

I want to use the hedera local node project for testing. Some of my tests bring down one or more nodes to verify the behavior of my application under those circumstances. I cannot do this on previewnet or testnet. I need to support a multi-node network with control over specific nodes in the network.

Solution

Add the ability to bring up more than one node, and to alter the status of those nodes. I could use docker commands to stop containers, but it would be better for the command line tool to enable starting and stopping of individual nodes. The "start" command should allow me to specify the number of nodes (perhaps only 1-4 right now is sufficient) and another set of commands should be created to start/stop individual nodes.

Alternatives

Create a new tool for a multi-node network. I'm not sure the delta between that project and this one is big enough to warrant a completely new tool.

`npx hedera-local start` does not work

Description

npx hedera-local start errors with the following:

SimiHunjan ~ %1npx hedera-local start
Starting the docker containers...
Starting the network...
Generating accounts...
node:internal/crypto/hash:67
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at createHash (node:crypto:130:10)
    at ripemd160 (/Users/simihunjan/node_modules/@hethers/hdnode/node_modules/@ethersproject/sha2/lib/sha2.js:11:43)
    at new HDNode (/Users/simihunjan/node_modules/@hethers/hdnode/lib/index.js:78:110)
    at Function.HDNode._fromSeed (/Users/simihunjan/node_modules/@hethers/hdnode/lib/index.js:214:16)
    at Function.HDNode.fromMnemonic (/Users/simihunjan/node_modules/@hethers/hdnode/lib/index.js:221:23)
    at Function.Wallet.fromMnemonic (/Users/simihunjan/node_modules/@hethers/wallet/lib/index.js:314:43)
    at Function.Wallet.createRandom (/Users/simihunjan/node_modules/@hethers/wallet/lib/index.js:278:23)
    at Function.generateAccounts (/Users/simihunjan/node_modules/@hashgraph/hedera-local/src/hederaUtils.js:27:35)
    at start (/Users/simihunjan/node_modules/@hashgraph/hedera-local/cli.js:67:23) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}


Steps to reproduce

See above

Additional context

See above

Hedera network

other

Version

latest

Operating system

macOS

Add Github Action to synchronize the standard configuration files

Problem

We need to ensure that the standard (ones without any custom changes) node configuration files are kept up to date with the official source repository.

Solution

  • Add a Github Action to perform the following steps:
    • pull the qualifying configuration files from the https://github.com/hashgraph/hedera-services using the raw content URLs via curl/wget/etc
    • Create a branch with a name similar to the following pattern config-update-YYYYMMDD-HHMMSS
    • Open a PR with the new branch as the source and main as the merge target

Alternatives

Discussed internally but ruled out in favor of Github Actions.

Add environment readiness test flow and steps for users

Problem

Currently the setup steps have an abrupt end and it's not clear to users if the local-node setup is functional and correct.
With so many systems working this experience could be improved

Solution

Docker
Add a local script that

  • uses Java SDK to create a simple CryptoCreate and CryptoTransfer
  • curls Mirror Node `api/v1/transactions/{transactionId} internally for each request to confirm E2E success
  • Prints out hashscan.io transaction url e.g. https://hashscan.io/#/mainnet/transaction/{transactionId} highlighting account for user
  • Displays or prints out hashscan.io accounts url e.g. https://hashscan.io/#/mainnet/account/{accountId} highlighting account for user

CLI Tool
Add npm run {task} flow that

  • uses JS SDK to create a simple CryptoCreate and CryptoTransfer
  • curls Mirror Node `api/v1/transactions/{transactionId} internally for each request to confirm E2E success
  • Prints out hashscan.io transaction url e.g. https://hashscan.io/#/mainnet/transaction/{transactionId} highlighting account for user
  • Displays or prints out hashscan.io accounts url e.g. https://hashscan.io/#/mainnet/account/{accountId} highlighting account for user

Alternatives

Some other flow that provides a simple E2E validation of a health local-node instances.
It's valuable to do something users will need to do such as submit transactions and verify their details

Update node software and mirror node versions

Problem

We need to update the node software container version to v0.27.4 release in preparation for the testnet/mainnet releases. Additionally, we need to update the mirror node software version to v0.59.1 to match the latest testnet/mainnet mirror node releases.

Solution

  • Deploy new container versions for the node software.
  • Update version numbers in the .env file.

Alternatives

None

Error: Can't subscribe to topic

After starting the node and mirror with docker-compose, I try to create a topic and subscribe to it, using the following code:

const { Client, PrivateKey, AccountCreateTransaction, AccountBalanceQuery, Hbar, TopicCreateTransaction, AccountId, TopicMessageQuery, TopicMessageSubmitTransaction } = require("@hashgraph/sdk");

require("dotenv").config();

async function main() {
    //Create your local client
    const node = {"127.0.0.1:50211": new AccountId(3)};
    const client = Client.forNetwork(node).setMirrorNetwork("127.0.0.1:5600"); //5600 //5551
    client.setOperator(AccountId.fromString("0.0.2"),PrivateKey.fromString("302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137"));
       
    //Create a new topic
	let txResponse = await new TopicCreateTransaction().execute(client);
	//Get the receipt of the transaction
	let receipt = await txResponse.getReceipt(client);
	//Grab the new topic ID from the receipt
	let topicId = receipt.topicId;

	//Log the topic ID
	console.log(`Your topic ID is: ${topicId}`);

	// Wait 5 seconds between consensus topic creation and subscription 
	await new Promise((resolve) => setTimeout(resolve, 5000));

    new TopicMessageQuery()
    .setTopicId(topicId)
    .subscribe(client, null, (message) => {
        let messageAsString = Buffer.from(message.contents, "utf8").toString();
        console.log(`${message.consensusTimestamp.toDate()} Received: ${messageAsString}`);
    });
}
main();

However, I get the following error (the same error is repeated for 10 attempts):

Error subscribing to topic 0.0.1001 during attempt 0. Waiting 250 ms before next attempt: Topic 0.0.1001 does not exist

Am I doing something wrong ?

Make getSymbol of HbarUnit public

Problem

I want to print the symbol of the hbar unit to console for my app, but it is package private.

Solution

Make the getSymbol method public.

Alternatives

No response

Bump relay to v0.2.0

Problem

local node currently uses v0.2.0-rc1 for relay

Solution

Bump relay to v0.2.0

Alternatives

No response

Update Container Versions to v0.25.4

Problem

Need to update the container version of the Node Software v0.25.4 in advance of the next upgrade window.

Solution

  • Update version
  • Test

Alternatives

No response

setting up a hedera local network

Discussed in #11

Originally posted by jigsnptel April 3, 2022
respected sir/madam,
i wish to create a hedera local network of 7 nodes on aws amazon. can you pls provide detailed steps for doing that ? This is urgent. any kind of help is useful.

Local node startup not working on Apple M1

Execution freezes at step Starting the docker containers...

Problem with Haveged container.

Logs:

haveged: ver: 1.9.1; arch: x86; vend: ; build: (gcc 6.4.0 ITV); collect: 128K
haveged: cpu: (VC); data: 16K (D); inst: 16K (D); idx: 12/40; sz: 15728/59215
haveged: tot tests(BA8): A:1/1 B:1/1 continuous tests(B):  last entropy estimate 7.99924
haveged: fills: 0, generated: 0 
haveged: RNDADDENTROPY failed! 

Mac specs:

MacBook Pro (14-inch, 2021)
OS 12.3.1
Chip Apple M1 Pro

Newest docker images(0.26.2) not working on Apple M1

Description
Creating EVM account with HederaSDK.TransferTransaction against hedera-local-node gives the following error:

local-node-2
The transaction is executed successfully but the error comes when it tries to get the tx receipt.
(script causes the error is shown below)

Hedera Local Node
All docker services are up and running, also I am able to generate accounts successfully

local-node-1

NodeJs Script for creating EVM account

async function createAccountFromCompressedPublicKey() {
    const HederaSDK = require('@hashgraph/sdk');
    const ethers = require('ethers');
    const client = HederaSDK.Client
        .forNetwork({
            '127.0.0.1:50211': '0.0.3'
        })
        .setOperator('0.0.2', '302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137');

    const wallet = ethers.Wallet.createRandom();
    const compressedPublicKey = wallet._signingKey().compressedPublicKey.substring(2);
    // console.log('private key', wallet.privateKey);
    // console.log('public key', compressedPublicKey);

    const nodeId = [HederaSDK.AccountId.fromString('0.0.3')];
    const publicKey = HederaSDK.PublicKey.fromString(compressedPublicKey).toAccountId(0, 0);

    const transferTransaction = new HederaSDK.TransferTransaction()
        .addHbarTransfer(client.operatorAccountId, new HederaSDK.Hbar(-1000))
        .addHbarTransfer(publicKey, new HederaSDK.Hbar(1000))
        .setNodeAccountIds(nodeId);
    const tx = await transferTransaction.execute(client);
    console.log('tx: ',tx.toString())
    const receipt = await tx.getReceipt(client);
    console.log('receipt: ', receipt.status.toString());
}

uses "@hashgraph/sdk": "2.15.0"
The script above is working fine on Ubuntu machine.

Once the error "max attempts of 10 was reached for request with last error being: UNKNOWN" is received, the local-node becomes unusable. The command npx hedera-local generate-accounts 2 freezes.

local-node-3

There is no suspicious logs on any docker service.

Haveged(v. 0.26.2)

local-node-5

Network-node(v. 0.26.2)

local-node-4

System specs
MacBook Pro
Chip - Apple M1 Pro

`ghcr.io/hashgraph/hedera-json-rpc-relay:0.2.0` image becomes "unhealthy" a few mins after running docker file

Description

NOTE: Using macOS w/ M1 chipset

What happens:
hashgraph/hedera-json-rpc-relay image goes into and unhealthy state after running the docker file and waiting a few mins

Expected behavior:
hashgraph/hedera-json-rpc-relay image to spin up into healthy state with no issues

Steps to reproduce

  1. run docker compose up -d in root folder
  2. wait a few mins
  3. check the containers docker ps

Additional context

➜  hedera-local-node git:(main) ✗ docker ps           
CONTAINER ID   IMAGE                                                COMMAND                  CREATED          STATUS                             PORTS                                             NAMES
f64e46624365   ghcr.io/hashgraph/hedera-json-rpc-relay:0.2.0        "npm run start"          41 seconds ago   Up 38 seconds (health: starting)   0.0.0.0:7546->7546/tcp                            json-rpc-relay


wait a few mins then run the same command...


➜  hedera-local-node git:(main) ✗ docker ps
CONTAINER ID   IMAGE                                                COMMAND                  CREATED              STATUS                          PORTS                                             NAMES
f64e46624365   ghcr.io/hashgraph/hedera-json-rpc-relay:0.2.0        "npm run start"          About a minute ago   Up About a minute (unhealthy)   0.0.0.0:7546->7546/tcp                            json-rpc-relay
 

Hedera network

other

Version

v1.0.3

Operating system

macOS

No consensus confirmation and missing libraries for json-rpc-relay

Description

A user provided the feedback for improvement regarding doc examples, Hedera local node, and hethers+hardhat. The points below focus on local node:

Using ethers +hardhat + eth I can compile and deploy my libraries, then my main contracts, load my facets , beat them up and recycle as many times and (almost) as fast as I like
Using hethers + hardhat +local Hedera node, I can compile my libraries, and deploy them if I just ignore the wait for a confirmation and take it on trust.
This is the issue I raised about consensus never coming back, now I ignore it I have moved on to the next issue.
Normally the inclusion of libraries would pretty much take care of itself in the hardhat compile, with a libraries array being passed in when needed.
I have had so much issue with the hethers + hardhat that I have reverted to calculating the $hex$ code and doing a substitution on the bytecode before attempting to deploy it.
 ...
All of this is on top of a local hedera system that almost works, i.e. there are still missing libraries in the latest docker pull for the  json-rpc-relay ( requires lerna ) which I results in the container coming up unhealthy (i.e. not running) , which may be why it does not reach consensus, I was actually beyond caring when I noticed that the json-rpc-relay had reverted with the latest pull, I had previously fixed it locally and notified abi, but was back developing on a working eth system to get some work done.

If you have a working local system you take pressure off of the test system, which I know has been having its own issues recently. 
It also allows developers to beat the #### out of their ideas and setups prior to doing that on the test system.
The local system appears to have come along as an afterthought, it needs to be front and centre as an adoption multiplier tool, along with example code that goes beyond the toddler steps and deals with some real world deployment scenarios. Maybe this all exists, but not where I have found it.  If you want people to follow the path, you have to smooth the road.

Steps to reproduce

From feedback above:

  1. Using hethers + hardhat +local Hedera node, I can compile my libraries, and deploy them if I just ignore the wait for a confirmation and take it on trust.
    This is the issue I raised about consensus never coming back, now I ignore it I have moved on to the next issue.

  2. there are still missing libraries in the latest docker pull for the json-rpc-relay ( requires lerna ) which I results in the container coming up unhealthy (i.e. not running) , which may be why it does not reach consensus...

Additional context

No response

Hedera network

other

Version

v1.0.3

Operating system

Windows

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.