Summary
A Solana RPC service provides the API endpoints your dApp, indexer, or trading bot needs to read chain state and submit transactions. Choosing the right service depends on your workload, traffic patterns, and whether you need dedicated capacity or shared public endpoints. This article explains what to evaluate and how to match a service to your use case.
Quick recommendation: match the service to your workload
Before comparing providers, decide what your application actually needs. A simple wallet or dApp can often start with a public endpoint, but production apps that depend on consistent performance should evaluate a managed RPC service. Ask yourself:
- What is my request volume? If you expect more than a few requests per second, shared public endpoints may hit rate limits. A managed service with higher throughput or a dedicated node is safer.
- Do I need WebSocket support? Real-time features like token price updates or transaction status require a WebSocket endpoint. Confirm the provider offers one.
- Do I need historical data? If your app fetches old account states or transaction history, you may need an archive node or a provider that supports
getTransactionwith historical data. - What is my tolerance for rate limits and downtime? If your app is user-facing, inconsistent RPC responses translate to a poor experience. A dedicated node gives you full control over capacity.
For many teams, starting with a managed RPC service like OnFinality's Solana RPC is the right balance. You get reliable endpoints without the operational burden of running your own node. As your traffic grows, you can migrate to a dedicated node for guaranteed capacity.
What a Solana RPC service actually does
Solana is a high-performance blockchain designed for fast, low-cost transactions. To interact with it, your application sends JSON-RPC requests to a node. An RPC service runs and maintains those nodes, exposing an API endpoint that you can call.
A typical Solana RPC service provides:
- HTTP endpoints for standard requests like
getBalance,getRecentBlockhash, andsendTransaction. - WebSocket endpoints for real-time subscriptions, such as
accountSubscribeorlogsSubscribe. - Reliable infrastructure with monitoring, failover, and load balancing.
- Developer support and documentation.
Without a service, you would need to run your own Solana validator or RPC node. That means managing hardware, keeping up with network upgrades, and ensuring uptime. For most teams, using an RPC service is more cost-effective and faster to deploy.
Solana RPC service vs. running your own node
Running your own Solana node gives you full control, but it comes with significant costs and complexity. Here is a comparison to help you decide:
| Aspect | Managed RPC service | Self-hosted node |
|---|---|---|
| Setup time | Minutes | Days to weeks |
| Hardware cost | Included in subscription | High (server, storage, bandwidth) |
| Maintenance | Provider handles it | You handle upgrades, monitoring, and fixes |
| Scalability | Easy to upgrade plan | Requires manual provisioning |
| Reliability | Provider SLA (if offered) | Depends on your own operations |
| Cost predictability | Monthly subscription | Variable, but can be lower at scale |
For most projects, the operational overhead of running a node is not worth it unless you have a dedicated infrastructure team. A managed service lets you focus on your product.
How to evaluate a Solana RPC service provider
When comparing providers, look beyond the headline price. Here are the key criteria:
- Throughput and rate limits: What is the maximum requests per second (RPS) allowed? Does the provider enforce limits that could throttle your app?
- WebSocket support: Does the service offer a stable WebSocket endpoint? Are there limits on the number of concurrent connections?
- Archive data: Does the provider offer historical data access? If you need
getTransactionfor old transactions, you may need an archive node. - Geographic distribution: Are endpoints available in multiple regions to reduce latency for your users?
- Uptime and monitoring: Does the provider publish uptime stats? Do they offer proactive monitoring?
- Support: What level of support is included? Is there a dedicated channel for urgent issues?
- Pricing model: Is it based on usage, a flat fee, or a combination? Does it scale with your needs?
OnFinality's RPC pricing is transparent, and you can start with a free tier to test performance.
Public vs. shared vs. dedicated Solana RPC
Solana RPC services generally fall into three categories:
- Public endpoints: Free, but rate-limited and not suitable for production. They are fine for testing and small projects.
- Shared (managed) endpoints: A pool of nodes shared among multiple users. They offer higher throughput than public endpoints and are suitable for most production apps.
- Dedicated nodes: A single node or cluster reserved for your project. This gives you full control over capacity and is ideal for high-traffic or latency-sensitive applications.
For example, OnFinality provides a public Solana endpoint at https://solana.api.onfinality.io/public for testing. For production, you would use a dedicated or shared endpoint from your OnFinality account.
Setting up a Solana RPC connection
Once you have an endpoint, connecting is straightforward. Here is an example using curl to get the current block height:
curl https://solana.api.onfinality.io/public \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"getBlockHeight"}'
For WebSocket subscriptions, you can use a library like @solana/web3.js:
import { Connection, PublicKey } from '@solana/web3.js';
const connection = new Connection('wss://solana.api.onfinality.io/public-ws');
const account = new PublicKey('...');
connection.onAccountChange(account, (accountInfo) => {
console.log('Account changed:', accountInfo);
});
Remember to replace the public endpoint with your own API key or dedicated endpoint when moving to production.
Common pitfalls and how to avoid them
- Rate limiting: Public endpoints have strict limits. If you exceed them, you may get 429 errors. Use a managed service with higher limits.
- WebSocket disconnects: WebSocket connections can drop. Implement reconnection logic in your client.
- Using the wrong endpoint: Make sure you are using the correct endpoint for the network (mainnet vs. devnet).
- Ignoring version compatibility: Solana's RPC API evolves. Keep your client library up to date.
Key Takeaways
- A Solana RPC service provides the API endpoints needed to interact with the Solana blockchain without running your own node.
- Choose between public, shared, and dedicated services based on your workload, reliability needs, and budget.
- Evaluate providers on throughput, WebSocket support, archive data, and pricing.
- For production, use a managed service like OnFinality to avoid rate limits and operational overhead.
- Always test with a public endpoint first, then move to a dedicated or shared endpoint for production.
Frequently Asked Questions
What is the difference between a Solana RPC service and a node?
A node is the software that runs the blockchain. An RPC service runs nodes and exposes an API for you to interact with. Using a service means you don't have to manage the node yourself.
Can I use a free Solana RPC service for production?
Free public endpoints are usually rate-limited and not reliable enough for production. It is recommended to use a paid service with a service-level agreement.
How do I get a dedicated Solana RPC endpoint?
You can provision a dedicated node through a provider like OnFinality. This gives you a private endpoint with guaranteed capacity.
What is the best Solana RPC service?
The best service depends on your needs. Compare providers based on performance, features, and pricing. OnFinality offers a reliable Solana RPC service with flexible plans.
Does OnFinality support Solana devnet?
Yes, OnFinality provides a Solana devnet endpoint for testing. See the Solana Devnet page for details.