Resumen
A Sui RPC node is an API endpoint that lets your application read from and write to the Sui blockchain without running your own full node. This article covers how to connect to Sui RPC endpoints, what to look for when choosing a provider, and common pitfalls to avoid in production.
Sui RPC Node Decision Checklist
Before integrating a Sui RPC node into your project, evaluate these criteria:
| Criterion | What to Check | Why It Matters |
|---|---|---|
| Network support | Does the provider offer Mainnet, Testnet, and Devnet? | You need separate endpoints for development and production. |
| Rate limits | What is the requests-per-second (RPS) limit? | Public endpoints are heavily rate-limited; production apps need higher limits. |
| WebSocket support | Does the provider offer WSS for real-time subscriptions? | Required for live event streaming (e.g., transaction monitoring). |
| Archive data | Does the provider support historical state queries? | Needed for dApps that access past balances or events. |
| Geographic distribution | Are nodes deployed in multiple regions? | Reduces latency and improves failover. |
| SLA and support | Is there a service-level agreement and 24/7 support? | Critical for production uptime. |
| Redundancy | Can you use multiple providers or endpoints? | Avoids single points of failure. |
What Is a Sui RPC Node?
A Sui RPC (Remote Procedure Call) node is an API endpoint that allows your application to interact with the Sui blockchain. Instead of running your own full node, you connect to a managed endpoint that handles transaction submission, querying balances, reading smart contracts, and subscribing to events. Sui uses a JSON-RPC protocol, similar to Ethereum, but with its own set of methods tailored to Sui's object-centric model.
Sui RPC Endpoint Basics
Sui provides public endpoints for testing, but they are rate-limited (e.g., 100 requests per 30 seconds) and not suitable for production. For production, you should use a dedicated or shared node from an infrastructure provider.
Mainnet Endpoint Example
https://rpc.mainnet.sui.io/
Testnet Endpoint Example
https://rpc.testnet.sui.io/
Devnet Endpoint Example
https://rpc.devnet.sui.io/
How to Connect to a Sui RPC Node
You can interact with a Sui RPC node using any HTTP client. Below is a curl example that queries the latest checkpoint sequence number:
curl -X POST https://rpc.mainnet.sui.io/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "sui_getLatestCheckpointSequenceNumber",
"params": []
}'
For WebSocket subscriptions, use the WSS endpoint:
wss://rpc.mainnet.sui.io/
Choosing a Sui RPC Provider
When selecting a provider, consider the following factors:
- Network Coverage: Ensure the provider supports Mainnet, Testnet, and Devnet. Some providers also offer dedicated nodes for higher throughput.
- Rate Limits: Public endpoints are heavily rate-limited. For production, look for providers that offer higher request limits or dedicated nodes.
- WebSocket Support: If your dApp requires real-time updates, confirm that the provider offers WSS endpoints.
- Archive Data: Some providers support archive nodes that allow querying historical state, which is essential for analytics and compliance.
- Geographic Distribution: Providers with multiple global nodes reduce latency and improve reliability.
- SLA and Support: A service-level agreement and 24/7 support are critical for production applications.
- Redundancy: Use multiple providers or endpoints to avoid single points of failure.
OnFinality offers Sui RPC endpoints with competitive rate limits, WebSocket support, and global node distribution. Check the Sui network page for details.
Common Pitfalls and How to Avoid Them
1. Using Public Endpoints in Production
Public endpoints are rate-limited and may become unavailable during high traffic. Always use a managed provider for production workloads.
2. Ignoring WebSocket for Real-Time Data
If your app relies on live events (e.g., transaction confirmations), use WebSocket instead of polling HTTP endpoints to reduce latency and load.
3. Not Planning for Traffic Spikes
Before high-traffic events (e.g., NFT mints), notify your provider and consider temporarily upgrading your plan or adding redundancy.
4. Single Provider Dependency
Relying on one provider creates a single point of failure. Use multiple providers or a failover strategy.
Sui RPC Methods You Should Know
Sui's JSON-RPC API includes methods for querying objects, transactions, and events. Here are some commonly used ones:
sui_getObject: Get details of a specific object by its ID.sui_getBalance: Get the SUI balance of an address.sui_executeTransactionBlock: Submit a transaction to the network.sui_getTransactionBlock: Get details of a transaction by its digest.sui_subscribeEvent: Subscribe to events matching a filter (WebSocket only).
For a full list, refer to the Sui RPC documentation.
Key Takeaways
- Sui RPC nodes provide API access to the Sui blockchain without running your own full node.
- Public endpoints are rate-limited; use a managed provider for production.
- Evaluate providers based on network support, rate limits, WebSocket, archive data, geographic distribution, SLA, and redundancy.
- Use multiple providers to ensure high availability.
- OnFinality supports Sui RPC endpoints with global coverage and flexible plans. See RPC pricing and supported networks.
Frequently Asked Questions
Q: What is the difference between a Sui full node and an RPC node? A: A full node stores the entire blockchain state and validates transactions. An RPC node is an API endpoint that allows you to interact with the blockchain without running a full node yourself. Managed RPC providers run full nodes on your behalf.
Q: Can I use a Sui RPC node for free? A: Yes, public endpoints are free but rate-limited. For production, you'll need a paid plan from a provider like OnFinality.
Q: Does Sui support WebSocket? A: Yes, Sui supports WebSocket for real-time event subscriptions. Ensure your provider offers WSS endpoints.
Q: How do I get archive data on Sui? A: Some providers offer archive nodes that store historical state. Check with your provider for archive support.
Q: What should I do if my RPC provider goes down? A: Implement redundancy by using multiple providers or endpoints. OnFinality offers failover options; see our dedicated node page for more information.