Local, Self-Hosted, or Third-Party? Selecting a JSON RPC Relay for Your Project


By Michiel Mulders
When working with smart contracts on Hedera, one critical decision developers face is how to set up their JSON RPC relay. This relay allows you to deploy, query, and interact with smart contracts on the Hedera network. Let's compare three popular approaches to help you decide the best method for your project.
1. Hedera Local Node with Built-in JSON RPC Relay
Hedera Local Node provides a ready-to-use, self-contained environment ideal for development, testing, and debugging. It simulates the Hedera network locally, enabling developers to rapidly prototype and debug their smart contracts without relying on external networks. In other words, it offers a complete sandboxed environment for thorough testing and experimentation.
Pros:
Ideal for local testing and development.
Isolation from external interference ensures consistent test conditions.
Significantly faster than the testnet (smart contract tests run approximately 5–10x quicker).
Unlimited availability of testnet HBAR to facilitate extensive and repeated tests.
Comes preconfigured, reducing setup complexity.
Easy to reset for repeatable testing scenarios.
Cons:
Only suitable for local environments, not suitable for production.
Limited scalability and inability to simulate live network conditions accurately.
When to Use:
Recommended for local development, integration tests, and end-to-end tests.
Ideal when isolation from external interference is essential.
Requires decent hardware specifications; may not run optimally on older or less powerful machines.
2. Running Your Own JSON RPC Relay
Running your own JSON RPC relay gives developers control and flexibility over their environment, catering specifically to their project's needs.
Pros:
Complete control over the relay configuration and availability.
Flexibility to scale up/down based on project needs.
Ability to switch between different Hedera networks (testnet, previewnet, mainnet), which is especially useful for thorough application testing and validation.
Avoids congestion typically found in shared third-party services.
Cons:
Requires dedicated infrastructure management and maintenance.
Additional overhead in managing the infrastructure and ensuring uptime.
When to Use:
Suitable for projects transitioning from testing to production.
Ideal for DApps requiring high reliability and scalability.
3. Using a Third-Party JSON RPC Relay Service
Hedera supports several paid third-party JSON RPC Relay services, detailed here. These services eliminate the need for infrastructure setup and maintenance, providing a hassle-free way to interact with smart contracts on Hedera.
Pros:
No infrastructure management is required to reduce operational overhead.
Quick setup and easy to start.
Typically include service-level agreements (SLAs) for reliability.
Cons:
Ongoing fees for usage.
Potential downtime or disruptions, depending on the service provider's infrastructure.
Limited control over infrastructure and configurations.
When to Use:
Beneficial for projects prioritizing convenience over infrastructure management.
Suitable for both testing and production, depending on the service provider's reliability guarantees.
Note on Hashio: Hashio is a free, third-party JSON RPC Relay provided by Hashgraph and is intended only for testing. Due to network load, it can occasionally become busy, making it unsuitable for production scenarios but great for devs exploring Hedera.
Comparison Summary
Conclusion
Selecting the right JSON RPC relay approach depends on your project's stage, scalability needs, and resources available. Start with the Hedera Local Node for isolated testing, migrate to your own relay for production control, or leverage third-party services for convenience.
Ultimately, combining these approaches strategically as your project evolves is key to efficient and effective smart contract development on Hedera.
Subscribe to my newsletter
Read articles from Hedera Team directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
