Logo

What is a Sui RPC and how do you use it?

Key Takeaways

  • Sui offers three RPC interfaces: JSON-RPC (deprecated, deactivating July 2026), gRPC, and GraphQL.
  • gRPC is the recommended high-performance protocol for production applications.
  • GraphQL provides flexible queries with precise field selection and nested data access.
  • You can run your own Sui full node or use a hosted RPC provider for reliable access.
  • Public endpoints are available for testing but may have rate limits and no uptime guarantees.
  • When choosing a provider, consider latency, reliability, and support for gRPC and GraphQL.
  • OnFinality provides dedicated Sui nodes and RPC endpoints for scalable infrastructure.

What is Sui RPC?

Sui RPC (Remote Procedure Call) is the interface that allows external applications to communicate with Sui full nodes. Through RPC, developers can query blockchain state, submit transactions, and interact with Move smart contracts. Sui provides multiple RPC protocols to accommodate different use cases and performance requirements.

The Sui network is designed for low-latency and high-throughput applications, making RPC performance critical for dApps, wallets, and infrastructure services. Choosing the right RPC interface and provider directly impacts your application's responsiveness and reliability.

Sui RPC Interfaces: JSON-RPC, gRPC, and GraphQL

Sui currently supports three RPC interfaces, each with its own strengths and deprecation status:

JSON-RPC is the original RPC protocol for Sui. It is now deprecated and will be deactivated in July 2026. Developers are strongly encouraged to migrate to gRPC or GraphQL. The Sui documentation provides a migration guide with method mapping and common gotchas.

gRPC is a high-performance, binary protocol that uses Protocol Buffers for efficient serialization. It is ideal for production applications requiring low latency and high throughput. gRPC also supports archive access for historical data beyond 14 epochs.

GraphQL is a flexible query language that allows clients to request exactly the data they need. It is particularly useful for complex queries involving nested objects and relationships. GraphQL is currently in beta but is recommended for new projects.

  • JSON-RPC: Deprecated, deactivating July 2026. Use only for legacy integrations.
  • gRPC: Recommended for production. High performance, supports streaming and archive data.
  • GraphQL: Beta but powerful. Best for complex queries and flexible data retrieval.

How to Connect to Sui RPC

There are two primary ways to connect to the Sui network via RPC: running your own full node or using a hosted RPC provider.

Running your own Sui full node gives you full control over the node configuration, but requires significant hardware, maintenance, and operational expertise. You must enable the desired RPC interfaces (gRPC, GraphQL) on your node.

Hosted RPC providers offer managed endpoints that abstract away node operations. They typically provide high availability, load balancing, and support for multiple interfaces. When selecting a provider, consider factors like latency, uptime guarantees, rate limits, and support for gRPC and GraphQL.

  • Self-hosted: Full control, but high operational overhead.
  • Hosted: Managed infrastructure, easier to scale, but vendor dependency.

Sui RPC Endpoints: Mainnet and Testnet

Sui provides public endpoints for both mainnet and testnet. These are free to use but often have rate limits and no uptime guarantees, making them suitable for development and testing only.

For production applications, a reliable RPC provider is essential. Providers offer dedicated endpoints with higher rate limits, lower latency, and service level agreements (SLAs). OnFinality, for example, provides Sui mainnet and testnet RPC endpoints with gRPC and GraphQL support.

CriterionWhat to checkWhy it matters
NetworkMainnet or TestnetMainnet for production, testnet for development and testing.
InterfaceJSON-RPC, gRPC, or GraphQLgRPC and GraphQL are future-proof; JSON-RPC is deprecated.
ProviderUptime, latency, rate limitsAffects application reliability and user experience.
PricingFree vs paid tiersFree tiers have limitations; paid plans offer dedicated resources.

Choosing a Sui RPC Provider

With many providers offering Sui RPC services, selecting the right one depends on your project's requirements. Key criteria include:

Latency: Geographic proximity to node locations affects round-trip time. Providers with global distribution can offer lower latency.

Reliability: Look for providers with high uptime guarantees and redundant infrastructure.

Interface Support: Ensure the provider supports gRPC and GraphQL, as JSON-RPC is deprecated.

Scalability: For high-traffic applications, dedicated nodes or higher-tier plans may be necessary.

OnFinality offers Sui RPC endpoints with competitive performance and flexible plans, including a free tier for development.

  • Latency: Choose a provider with nodes close to your users.
  • Uptime: Look for SLAs and historical uptime data.
  • Interface: Prefer providers that support gRPC and GraphQL.
  • Scalability: Consider dedicated nodes for production workloads.

Common Sui RPC Use Cases

Sui RPC is used across a variety of applications:

Wallets: Query balances, transaction history, and submit transactions.

dApps: Interact with Move smart contracts, read on-chain data, and execute state changes.

Indexers and Analytics: Fetch large volumes of data for indexing, monitoring, and analysis.

Bots and Automation: Automate trading, staking, and other on-chain operations.

For each use case, the choice of RPC interface and provider can significantly impact performance and cost.

Migrating from JSON-RPC to gRPC or GraphQL

With JSON-RPC being deprecated, all Sui developers should plan migration to gRPC or GraphQL. The Sui Foundation provides a detailed migration guide that includes method mapping, common pitfalls, and code examples.

gRPC is recommended for applications that require high throughput and low latency, while GraphQL is ideal for flexible data queries. Both interfaces are supported by major RPC providers, including OnFinality.

Start by identifying all JSON-RPC calls in your codebase, then map them to the equivalent gRPC or GraphQL methods. Test thoroughly on testnet before deploying to mainnet.

  • Review the official Sui JSON-RPC Migration Guide.
  • Map deprecated JSON-RPC methods to gRPC or GraphQL equivalents.
  • Test migration on testnet before mainnet deployment.
  • Update your RPC provider if they do not support gRPC or GraphQL.

Frequently Asked Questions

What is the difference between Sui JSON-RPC, gRPC, and GraphQL?

JSON-RPC is the original RPC protocol, now deprecated and set to be deactivated in July 2026. gRPC is a high-performance binary protocol using Protocol Buffers, recommended for production. GraphQL is a flexible query language that allows clients to request specific data fields, currently in beta.

Can I still use Sui JSON-RPC after July 2026?

No, JSON-RPC will be deactivated in July 2026. You must migrate to gRPC or GraphQL before then to maintain access to the Sui network.

What are the best Sui RPC providers?

Several providers offer Sui RPC endpoints, including OnFinality, QuickNode, and others. The best provider depends on your needs for latency, uptime, interface support, and pricing. OnFinality provides reliable Sui RPC with gRPC and GraphQL support.

How do I get a Sui RPC endpoint?

You can use public endpoints for testing, but for production, sign up with a hosted RPC provider like OnFinality. They will provide you with a dedicated endpoint URL and API key.

Does Sui have a testnet RPC?

Yes, Sui has a testnet with public RPC endpoints. Providers like OnFinality also offer testnet RPC access for development and testing.

sui rpc
RPC Knowledge Base

Related RPC details

Background

Never Worry about Infrastructure Again

OnFinality takes away the heavy lifting of DevOps so you can build smarter and faster.

Get Started