How to Run a Hedera Local Node with GitPod

The Hedera Local Node project enables developers to establish their own local network for development and testing. The local network comprises the consensus node, mirror node, JSON-RPC relay, and other Hedera 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.


Prerequisites


Set Up Gitpod Permissions

Enable public_repo permission for GitHub provider on Gitpod’s Git integrations page.


Running the Hedera Local Node

The hedera-local-node project repository already has a Gitpod configuration file (.gitpod.yml), which makes it easy to run it within a workspace on Gitpod. Open the Hedera Local Node repo. Click on the Gitpod Open button.

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 Hedera Local Node in your cloud environment.

Available Services

The Hedera local node comes with various services, each serving different functions, and accessible locally. These are the endpoints for each service:

TypeEndpoint

Consensus Node Endpoint

Mirror Node GRPC Endpoint

Mirror Node REST API Endpoint

JSON RPC Relay Endpoint

JSON RPC Relay Websocket Endpoint

Mirror Node Explorer (HashScan)

Grafana UI

Prometheus UI

You may access these services on localhost, and these endpoints are set up to be accessed from your own computer as if they were running locally. Since this setup is on Gitpod (a cloud-based development environment), “localhost” here refers to a virtual environment on Gitpod's servers that you're accessing through your browser. Gitpod redirects these local addresses to your cloud workspace, making it feel as though you're working on a local setup.

Testing the Setup

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).

Mirror Node REST API

The following command queries the Mirror Node for a list of accounts on your Hedera network.

curl "http://localhost:5551/api/v1/accounts" \
  -X GET

See the Mirror Node interact API docs for a full list of available APIs.

JSON RPC Relay

The following command queries the RPC Relay for the latest block on your Hedera network.

curl "<http://localhost:7546>" \\
  -X POST \\
  -H "Content-Type: application/json" \\
  --data '{"method":"eth_getBlockByNumber","params":["latest",false],"id":1,"jsonrpc":"2.0"}'

See the endpoint table in hedera-json-rpc-relay for a full list of available RPCs.

Mirror Node Explorer (Hashscan)

Visit the local mirror node explorer endpoint (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.

Shut Down the Gitpod Workspace

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.


Conclusion and Additional Resources

Congrats on successfully setting up your Gitpod workspace and running a Hedera Local Node!

Hedera Local Node Repository

Gitpod Documentation

If you have any feedback on this tutorial, please let us know, and feel free to reach out on Discord!

Last updated

Change request #2591: #631 HashioDAO docs