DEV Community

OnFinality
OnFinality

Posted on Originally published at onfinality.io

Sui Mainnet RPC: Endpoints, Methods & Provider Selection

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 address
  • sui_getObject – fetch an object by its ID
  • sui_executeTransactionBlock – submit a transaction for execution
  • sui_getTransactionBlock – retrieve a transaction by digest
  • sui_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"]
  }'
Enter fullscreen mode Exit fullscreen mode

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);
Enter fullscreen mode Exit fullscreen mode

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:

  1. Check the endpoint – Is it the correct mainnet URL? Test with a simple sui_getLatestCheckpointSequenceNumber call.
  2. Check your request format – Are you using the correct JSON-RPC method and parameters? Refer to the Sui API reference.
  3. Check for rate limiting – Look for 429 responses. If you see them, slow down or upgrade your plan.
  4. Check network connectivity – Can you reach the endpoint from your server? Use curl -v to see the response headers.
  5. 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.

Related resources

Originally published at OnFinality.

Top comments (0)