Logo
RPC Assistant

What is a Solana private RPC and when should you use one?

Summary

A Solana private RPC is a dedicated endpoint that gives your application exclusive access to a Solana node, avoiding the rate limits and shared load of public endpoints. This article explains what private RPCs are, how they differ from public and shared options, and how to decide if you need one for your project.

Quick decision guide: do you need a private Solana RPC?

If you are building a production application on Solana, the public endpoints like https://api.mainnet.solana.com are not designed for sustained traffic. They are shared across all users and can return 429 rate-limit errors or 403 blocks when usage spikes. A private RPC gives you a dedicated endpoint that is not shared with other teams, which usually means more consistent latency and higher throughput limits.

Here is a quick way to decide:

  • Prototype or hackathon: Use a public endpoint or a free tier from a provider. You do not need a private RPC yet.
  • Production dApp with real users: You need a private RPC to avoid rate limits and get predictable performance. Look for a provider that offers dedicated or private endpoints.
  • High-frequency trading or bot: You need ultra-low latency and the ability to send many transactions per second. A private RPC with a dedicated node is often the right choice.
  • Data-heavy indexing or analytics: You may need archive data and higher request limits. A private RPC with archive support is useful.

If you are unsure, start with a shared private endpoint (still private to you, but on shared infrastructure) and monitor your usage. Many providers, including OnFinality, offer flexible plans that let you scale up to a dedicated node when needed. Check the RPC pricing page for current options.

What is a Solana private RPC?

A Solana private RPC is an RPC endpoint that is not publicly advertised and is reserved for your use. It can be either:

  • A shared private endpoint: You get a unique URL that only your project uses, but the underlying node is shared with other customers. This is common on managed RPC services.
  • A dedicated node: A full Solana node (or cluster of nodes) is deployed exclusively for your project. You have full control over the node's configuration and resources.

Both types avoid the free public endpoints' rate limits and are more reliable for production traffic. The term "private RPC" is often used interchangeably with "dedicated RPC," but there is a distinction: private means not public, dedicated means exclusively yours.

Why public Solana RPC endpoints are not enough

Solana's public RPC endpoints are provided by the Solana Foundation and are meant for testing and light usage. They have strict rate limits and no SLA. When your dApp grows, you will likely hit these limits, causing failed requests and a poor user experience.

Common issues with public endpoints:

  • Rate limiting: You may receive HTTP 429 responses when you exceed the allowed number of requests.
  • IP blocking: If you make too many requests, your IP can be temporarily blocked (403).
  • No WebSocket guarantees: Public WebSocket endpoints can drop connections under load.
  • No archive data: Public endpoints typically only serve recent state, not historical data.

For any serious project, a private RPC is the recommended path.

How to get a Solana private RPC

You have two main options: run your own node or use a managed provider.

Option 1: Run your own Solana RPC node

Running a Solana RPC node requires significant hardware and operational expertise. You need to:

  • Provision a machine with high CPU, RAM, and NVMe storage (Solana recommends at least 12 cores, 128GB RAM, and 1TB+ NVMe).
  • Install the Solana validator software and sync the ledger (can take days).
  • Maintain the node: monitor, upgrade, and handle forks.
  • Set up load balancing and failover if you need high availability.

This is feasible for teams with DevOps experience, but it is a large time and cost investment.

Option 2: Use a managed RPC provider

Managed providers like OnFinality offer private RPC endpoints without the operational overhead. You get:

  • A dedicated or shared private endpoint with an API key.
  • Access to multiple Solana clusters (mainnet, devnet, testnet).
  • WebSocket support for real-time subscriptions.
  • Scaling options as your traffic grows.

You can start with a free tier or a low-cost plan and upgrade later. See the supported networks page for Solana availability.

Key differences: public vs. private vs. dedicated

The table below summarizes the main differences:

FeaturePublic RPCPrivate (shared) RPCDedicated RPC Node
AccessOpen to everyoneUnique URL for your projectExclusively yours
Rate limitsLow, sharedHigher, but still sharedCustomizable, based on node capacity
LatencyVariable, can spikeMore consistentLowest, as you control the node
ReliabilityNo SLAProvider SLA (varies)Provider SLA (varies)
CostFreeLow to moderateHigher
Setup effortNoneMinimal (API key)Minimal (provider handles it)
ControlNoneLimitedFull (if you run it yourself)

How to connect to a Solana private RPC

Once you have a private RPC URL, you can use it in your Solana dApp. Here is an example using the Solana Web3.js library:

import { Connection, clusterApiUrl } from '@solana/web3.js';

// Replace with your private RPC URL
const privateRpcUrl = 'https://solana-mainnet.g.alchemy.com/v2/YOUR_API_KEY';
const connection = new Connection(privateRpcUrl, 'confirmed');

// Example: get the latest blockhash
const blockhash = await connection.getLatestBlockhash();
console.log(blockhash);

You can also use curl to test your endpoint:

curl -X POST https://solana-mainnet.g.alchemy.com/v2/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getHealth"}'

Make sure to keep your API key secure and never expose it in client-side code. Use environment variables or a backend proxy.

When to choose a dedicated node over a shared private RPC

A shared private RPC is usually sufficient for most dApps. However, you might need a dedicated node if:

  • Your traffic is consistently high and you need guaranteed throughput.
  • You need to run custom RPC methods or use specific Solana features that require node-level access.
  • You want to avoid any "noisy neighbor" effects from other users on the same node.
  • You need archive data or specific historical state.

Dedicated nodes are more expensive but give you peace of mind. OnFinality offers dedicated node options for Solana and other networks.

Common pitfalls and how to avoid them

  • Using a public endpoint in production: This is the most common mistake. Always use a private RPC for anything beyond a demo.
  • Not monitoring your RPC usage: You might hit rate limits without realizing it. Use monitoring tools to track request volume and latency.
  • Ignoring WebSocket connections: If your app uses real-time updates, ensure your provider supports WebSocket and has stable connections.
  • Forgetting about archive data: If you need historical data, make sure your plan includes archive access.

Key Takeaways

  • A Solana private RPC is essential for production applications to avoid rate limits and get reliable performance.
  • You can choose between a shared private endpoint or a dedicated node, depending on your needs and budget.
  • Managed providers like OnFinality simplify the process and offer flexible scaling.
  • Always use a private RPC for production and monitor your usage to avoid surprises.

Frequently Asked Questions

What is the difference between a private RPC and a dedicated node?

A private RPC is any endpoint that is not public and is reserved for your use. A dedicated node is a full node deployed exclusively for you, giving you more control and performance.

Can I use a free Solana RPC for production?

Free public endpoints are not recommended for production due to rate limits and lack of SLA. Some providers offer free tiers for private RPCs, but they also have limits. For serious production, you should pay for a private RPC.

How do I get a Solana private RPC?

You can either run your own node or use a managed RPC provider like OnFinality. Managed providers offer easy setup and scaling.

Does OnFinality support Solana private RPC?

Yes, OnFinality supports Solana RPC endpoints. Check the Solana network page for details and the RPC pricing page for plans.

What is the best Solana private RPC provider?

The best provider depends on your specific needs: latency, throughput, archive data, and budget. Evaluate providers based on your workload and test their endpoints. OnFinality is a solid option to consider.

Next steps

If you are ready to move to a private Solana RPC, start by creating an account on OnFinality and getting an API key. You can then choose a plan that fits your usage. For more guidance on selecting an RPC provider, read our how to choose an RPC provider guide.

RPC Knowledge Base

Related RPC details

Never Worry about Infrastructure Again

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

Get Started