Summary
Learn how to connect to Sui Mainnet RPC endpoints, understand the JSON-RPC methods, and evaluate infrastructure options for production apps. This guide covers chain settings, request examples, and key considerations for choosing between public and dedicated nodes.
Quick recommendation: public endpoint or dedicated node?
Before you write a single request, decide how you will connect to Sui Mainnet. The right choice depends on your workload, not on which endpoint is easiest to copy.
- Prototyping, testing, or low-volume dApps can start with a public RPC endpoint. It is free and fine for light usage, but shared infrastructure means you may hit rate limits during traffic spikes.
- Production applications, indexers, or anything with sustained load should use a managed RPC service or a dedicated node. A dedicated Sui node gives you isolated capacity, consistent performance, and the ability to tune your infrastructure.
If you are evaluating providers, compare them on the criteria in the provider evaluation matrix below. For a quick start, the public endpoint is a reasonable first step, but plan to move to a dedicated node as your traffic grows.
Sui Mainnet chain settings at a glance
Sui is a Layer 1 blockchain built in Rust with a unique object-centric data model. Unlike Ethereum-style chains, Sui does not use a traditional chain ID in the same way, but it does have a network identifier and a specific RPC API.
| Setting | Value |
|---|---|
| Network name | Sui Mainnet |
| RPC transport | HTTP |
| RPC URL (public) | https://sui-mainnet.api.onfinality.io/public |
| Explorer | https://suiscan.xyz |
| Native token | SUI |
Note: The public endpoint is shared and rate-limited. For production workloads, consider a dedicated Sui node or a managed RPC plan from OnFinality.
Understanding Sui JSON-RPC
Sui's RPC API is JSON-RPC based, but it is not Ethereum-compatible. You will use Sui-specific methods like sui_getBalance, sui_getObject, and sui_executeTransactionBlock. The API is documented in the Sui documentation, but here are the essentials.
Common methods
sui_getBalance– get the SUI balance of an addresssui_getObject– fetch an object by its IDsui_executeTransactionBlock– submit a transaction for executionsui_getTransactionBlock– retrieve a transaction by digestsui_getLatestCheckpointSequenceNumber– get the latest checkpoint
Example: get balance with curl
curl -X POST https://sui-mainnet.api.onfinality.io/public \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "sui_getBalance",
"params": ["0x0000000000000000000000000000000000000000"]
}'
Replace the address with a real one. The response will include the total balance and coin breakdown.
Example: get object with JavaScript
const response = await fetch('https://sui-mainnet.api.onfinality.io/public', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'sui_getObject',
params: ['0xobjectid', { showType: true, showContent: true }]
})
});
const data = await response.json();
console.log(data.result);
Provider evaluation matrix
When you move beyond the public endpoint, you need to compare RPC providers. Here is a practical matrix to guide your evaluation.
| Criterion | What to check | Why it matters |
|---|---|---|
| Throughput and rate limits | Request per second (RPS) limits, burst allowances | Avoid throttling during traffic spikes |
| Reliability | Historical uptime, redundancy, failover | Minimize downtime for your users |
| Data availability | Archive data, historical state, pruning policy | Needed for indexers and analytics |
| Transport support | HTTP, WebSocket, gRPC | Match your application's needs |
| Dedicated options | Isolated nodes, custom configuration | Full control and predictable performance |
| Pricing model | Pay-as-you-go vs. subscription | Align with your budget and usage |
OnFinality offers both shared and dedicated Sui RPC options. You can start with the public endpoint and upgrade to a dedicated node when you need more capacity. See RPC pricing for details.
Common pitfalls and how to avoid them
1. Using the wrong network
Sui has separate mainnet and testnet endpoints. Double-check that you are using the mainnet URL, especially if you are copying code from tutorials. The testnet endpoint is https://sui-testnet.api.onfinality.io/public (see Sui Testnet).
2. Ignoring rate limits
Public endpoints are shared. If you send too many requests, you will get 429 errors. Implement retry logic with exponential backoff, and consider a dedicated node for high-volume workloads.
3. Misunderstanding object ownership
Sui's object model is different from Ethereum's account model. You need to understand owned objects, shared objects, and immutable objects to interact with the chain correctly. Read the Sui object documentation before building.
4. Not handling WebSocket for subscriptions
If your app needs real-time updates, use WebSocket subscriptions. The public endpoint supports WebSocket, but for production, ensure your provider offers reliable WebSocket connections.
Debugging your RPC connection
When things go wrong, follow this debug path:
- Check the endpoint – Is it the correct mainnet URL? Test with a simple
sui_getLatestCheckpointSequenceNumbercall. - Check your request format – Are you using the correct JSON-RPC method and parameters? Refer to the Sui API reference.
- Check for rate limiting – Look for
429responses. If you see them, slow down or upgrade your plan. - Check network connectivity – Can you reach the endpoint from your server? Use
curl -vto see the response headers. - Check your code – Are you handling errors correctly? Log the full response body for debugging.
When to move to a dedicated Sui node
A dedicated node gives you exclusive access to a Sui validator or full node. This is useful for:
- High-throughput applications that need consistent performance
- Indexers that need to query historical data without rate limits
- Applications that require custom RPC methods or configuration
OnFinality provides dedicated Sui nodes with isolated resources. You can also use the OnFinality API service for managed access.
Key Takeaways
- Sui Mainnet uses a JSON-RPC API that is different from Ethereum's, so use Sui-specific methods.
- The public endpoint is fine for testing, but production apps should consider a managed or dedicated solution.
- Evaluate providers on throughput, reliability, data availability, and transport support.
- Avoid common pitfalls like using the wrong network or ignoring rate limits.
- Use the debug path to quickly resolve connection issues.
Frequently Asked Questions
What is the Sui Mainnet RPC URL?
The public Sui Mainnet RPC URL is https://sui-mainnet.api.onfinality.io/public. For production, consider a dedicated node or managed RPC service.
Is Sui RPC compatible with Ethereum JSON-RPC?
No, Sui uses its own JSON-RPC methods. You cannot use Ethereum methods like eth_getBalance on Sui.
How do I get a dedicated Sui node?
You can provision a dedicated Sui node through a provider like OnFinality. This gives you isolated capacity and full control.
What is the difference between Sui Mainnet and Testnet RPC?
Mainnet is for real assets and production use, while testnet is for development and testing. They have separate endpoints and token faucets.
Does OnFinality support Sui Mainnet?
Yes, OnFinality supports Sui Mainnet and Testnet. See the Sui network page for details.
For a full list of supported networks, visit supported RPC networks.