Summary
A Solana RPC node is a server that exposes the Solana JSON-RPC API, letting applications read chain data and submit transactions. This article explains how Solana RPC nodes work, how to connect to public and dedicated endpoints, and what to evaluate when choosing infrastructure for production apps.
Quick decision guide: which Solana RPC setup fits your app?
Before you dive into endpoints and methods, decide how you want to consume Solana data. The right choice depends on your workload, not on which option is most popular.
| Workload | Recommended setup | Why |
|---|---|---|
| Prototyping, hackathon, low traffic | Public RPC endpoint | Free, zero setup, fine for light reads |
| Production app with moderate traffic | Shared managed RPC | Reliable throughput without running nodes |
| High-throughput trading, indexing, heavy analytics | Dedicated node | Isolated capacity, consistent performance, custom tuning |
| Testing against a live-like environment | Devnet RPC | Free testnet with SOL faucets for development |
If you need predictable performance and your app depends on Solana RPC calls, a dedicated node gives you isolation from noisy neighbors. For most teams, starting with a managed shared RPC and upgrading to dedicated when you hit limits is a pragmatic path.
What is a Solana RPC node?
A Solana RPC node is a server that runs the Solana client software and exposes the JSON-RPC API. Applications use this API to query account balances, transaction status, block data, and to submit signed transactions. Unlike Ethereum's JSON-RPC, Solana uses its own JSON-RPC methods with different naming and response formats.
Solana's architecture is optimized for high throughput, with a proof-of-stake consensus and a central clock called Proof of History. RPC nodes are not validators; they serve data to clients and can be run in different configurations, such as archive nodes that store historical state.
Solana RPC endpoint: chain settings at a glance
When you connect to Solana, you need the correct network settings. Here are the key parameters for Solana mainnet and devnet.
| Setting | Mainnet | Devnet |
|---|---|---|
| Chain name | Solana Mainnet | Solana Devnet |
| Native currency | SOL (9 decimals) | SOL (9 decimals) |
| HTTP RPC URL | https://solana.api.onfinality.io/public | See Solana Devnet |
| WebSocket URL | wss://solana.api.onfinality.io/public-ws | See Solana Devnet |
| Explorer | https://explorer.solana.com | https://explorer.solana.com |
Note: The public endpoint is for testing and light usage. For production, consider a managed or dedicated RPC from a provider like OnFinality.
How to connect to a Solana RPC node
You can interact with Solana RPC using curl, JavaScript libraries like @solana/web3.js, or language-specific SDKs. Here's a basic curl example to get the latest block height:
curl https://solana.api.onfinality.io/public \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"getBlockHeight"}'
Expected response:
{"jsonrpc":"2.0","result":123456789,"id":1}
For JavaScript, use @solana/web3.js:
import { Connection } from '@solana/web3.js';
const connection = new Connection('https://solana.api.onfinality.io/public');
const slot = await connection.getSlot();
console.log('Current slot:', slot);
For WebSocket subscriptions, connect to the WebSocket endpoint:
const wsConnection = new Connection('wss://solana.api.onfinality.io/public-ws');
wsConnection.onAccountChange(accountPublicKey, (accountInfo) => {
console.log('Account changed:', accountInfo);
});
Solana RPC methods you'll use most
Solana's RPC API includes methods for reading accounts, transactions, and blocks. Here are common ones:
| Method | Purpose |
|---|---|
getBalance | Get SOL balance of an account |
getAccountInfo | Get account data and lamports |
getTransaction | Fetch transaction details by signature |
getBlock | Retrieve block data |
sendTransaction | Submit a signed transaction |
getSignaturesForAddress | List transaction signatures for an address |
getLatestBlockhash | Get the latest block hash for transaction signing |
For a full list, see the Solana documentation.
Public vs. dedicated Solana RPC nodes
Public RPC endpoints are convenient but come with rate limits and can be unreliable under load. Dedicated nodes provide a private endpoint with dedicated resources, which is essential for production apps that need consistent performance.
| Factor | Public RPC | Dedicated RPC |
|---|---|---|
| Cost | Free | Paid |
| Rate limits | Yes | Higher or none |
| Performance | Shared, variable | Isolated, predictable |
| Reliability | Depends on provider | Higher uptime potential |
| Customization | None | Possible (e.g., archive, WebSocket) |
OnFinality offers dedicated Solana nodes that you can deploy in minutes, with options for archive data and WebSocket support.
How to choose a Solana RPC provider
When evaluating RPC providers, consider these criteria:
- Reliability: Look for providers with a track record of uptime, but verify with your own monitoring.
- Performance: Test latency and throughput for your specific workload.
- Rate limits: Understand the limits for free and paid tiers.
- Support: Check if the provider offers dedicated support for production issues.
- Network coverage: Ensure the provider supports the networks you need (mainnet, devnet, testnet).
For a deeper dive, see our guide to choosing an RPC provider.
Common pitfalls and troubleshooting
Here are typical issues developers face with Solana RPC nodes and how to resolve them:
| Symptom | Likely cause | Fix |
|---|---|---|
429 Too Many Requests | Rate limit exceeded | Upgrade to a paid plan or use a dedicated node |
Timeout on sendTransaction | Network congestion or invalid transaction | Check transaction fees and retry with a recent blockhash |
| WebSocket disconnects | Idle connection or provider limit | Implement reconnection logic and heartbeat |
Slot skipping | Node is behind | Use a provider with better sync or archive node |
Key Takeaways
- A Solana RPC node exposes the JSON-RPC API for reading data and sending transactions.
- Public endpoints are fine for testing, but production apps need reliable, scalable infrastructure.
- Evaluate providers based on performance, rate limits, and support.
- OnFinality provides both shared and dedicated Solana RPC options, with HTTP and WebSocket support.
Frequently Asked Questions
What is the difference between a Solana RPC node and a validator?
A validator participates in consensus and produces blocks. An RPC node serves data to clients and does not participate in consensus. Some nodes can do both, but they are separate roles.
Can I run my own Solana RPC node?
Yes, you can run a Solana node using the official client. However, it requires significant hardware and maintenance. Managed services like OnFinality handle this for you.
What is an archive node?
An archive node stores the full historical state of the blockchain, allowing queries for historical account data. This is useful for analytics and indexing.
How do I get SOL for devnet?
You can use the devnet faucet to request SOL for testing. See the Solana Devnet page for details.
Does OnFinality support Solana WebSocket?
Yes, OnFinality provides WebSocket endpoints for Solana, as shown in the chain settings above.
For more details on pricing and networks, visit RPC pricing and supported RPC networks.