Logo
RPC Assistant

What Are Solana Public RPC Endpoints and Should You Use Them?

摘要

Solana public RPC endpoints are free, shared API gateways that allow developers to interact with the Solana blockchain without running their own node. They are ideal for prototyping, light dApp usage, and development. However, they come with rate limits and no SLA, so production applications often need a private or dedicated RPC provider like OnFinality for reliability and performance.

Solana public RPC endpoints provide a quick way to connect to the Solana network without running your own node. They are maintained by various providers, including the Solana Foundation and infrastructure services like OnFinality. While convenient for development and light usage, public RPCs have rate limits and no reliability expectations, making them unsuitable for high-traffic production applications.

Solana Public RPC Decision Checklist

Consider the following before relying on a public Solana RPC:

  1. Estimate your request volume — Public endpoints typically allow 100-500 requests per second per IP. If your dApp exceeds that, you need a private connection.
  2. Check required methods — Public RPCs usually support standard JSON-RPC methods but may block or rate-limit heavy queries like getProgramAccounts or getSignaturesForAddress.
  3. Assess latency sensitivity — Shared public nodes can suffer from noisy neighbors. If your application is latency-sensitive (e.g., trading bots, real-time games), dedicated nodes are better.
  4. Determine if archive data is needed — Public RPC nodes often run in non-archive mode, meaning historical data may be unavailable. For historical queries, you may need a provider with archive support.
  5. Evaluate failover strategy — Public endpoints can go down without warning. Always have a backup provider or a dedicated node with an SLA.

Available Solana Public RPC Endpoints

Below are common Solana public RPC endpoints. Note that their rate limits and feature sets may change; always check the provider’s documentation.

ProviderEndpoint (Mainnet)Rate Limit (approx.)Archive?WebSocket?
Solana Foundationhttps://api.mainnet-beta.solana.com100 req/10s per IPNoYes (wss://)
OnFinality (Public)https://solana.publicnode.com200 req/s per IPNoYes
Other ProvidersVariousVariesSome offerVaries

For a full list of endpoints and network details, see the Solana network page.

How to Connect to Solana Public RPC

You can test a public RPC endpoint using curl. For example, to get the latest block height:

curl https://api.mainnet-beta.solana.com -X POST -H "Content-Type: application/json" -d '
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getSlot",
  "params": []
}'

Expected response:

{"jsonrpc":"2.0","result":264852345,"id":1}

In JavaScript using @solana/web3.js:

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

const connection = new Connection('https://api.mainnet-beta.solana.com', 'confirmed');
const slot = await connection.getSlot();
console.log(slot);

Public RPC Limitations

While public RPCs are great for quick experiments, they have significant drawbacks for production:

  • Rate limiting: Exceeding the request quota results in HTTP 429 errors or dropped connections.
  • No reliability expectations: Public endpoints can go offline without notice. No SLA exists.
  • No archive data: Most public nodes prune historical state. You cannot query past account balances or old transactions.
  • Limited WebSocket stability: WebSocket connections may drop or have throttling, impacting real-time applications.
  • No priority or dedicated resources: Your requests compete with everyone else's, causing variable latency.

When to Move to a Private or Dedicated Solana RPC Node

As your project grows, the limitations of public RPCs become critical. Consider upgrading when:

  • Your application sees more than 200 requests per second consistently.
  • You need access to historical data (archive node).
  • Your users rely on low-latency responses (e.g., trading, gaming).
  • You require a WebSocket connection that stays open for hours.
  • You want a reliability expectations and support.

Dedicated Solana nodes, like those offered by OnFinality, give you a single-tenant node with no resource contention, configurable rate limits, and access to archive and trace methods if needed. They also provide a WebSocket that can handle persistent connections. For details, visit the dedicated node page.

For a middle ground, OnFinality also offers a shared but still higher-tier RPC service with better limits and reliability. See the RPC pricing page for more.

Key Takeaways

  • Solana public RPC endpoints are free, easy to use, and sufficient for prototyping and small-scale usage.
  • They have rate limits, no SLAs, and limited features (no archive, possible WebSocket instability).
  • For production applications, evaluate your request volume, latency needs, and data requirements.
  • OnFinality provides both public and private Solana RPC options, including dedicated nodes for demanding workloads.
  • Always have a backup provider to ensure high availability.

Frequently Asked Questions

What is the difference between public and private RPC? Public RPCs are shared by many users, while private RPCs allocate resources specifically for your application. Private RPCs offer higher limits, better performance, and often include support.

Can I use a public RPC for my NFT minting dApp? Possibly, but public RPCs are prone to rate limiting and congestion. For high-traffic events like NFT mints, a dedicated Solana RPC node is strongly recommended to avoid failures.

Does OnFinality offer a free Solana public RPC? Yes, OnFinality provides a free public Solana RPC endpoint at https://solana.publicnode.com. It includes WebSocket support and is suitable for development. Upgrade to a paid plan for higher limits and reliability.

How do I switch from a public to a dedicated RPC? Simply replace the endpoint URL in your application code. You may also need to update authentication credentials if your provider uses API keys. OnFinality provides detailed documentation for migration.

What is archive mode and do I need it? Archive nodes retain the full historical state of the blockchain. If your dApp needs to query old account data or past transaction details, you need an archive RPC endpoint. Most public RPCs do not archive.

For more Solana network details, check the Solana network page. For pricing and plans, visit the RPC pricing page.

RPC 知识库

相关 RPC 内容

Rpc Provider Selection

Which RPC provider offers the most reliable Ethereum RPC endpoints?

There is no single provider that is universally most reliable; reliability depends on your workload, geographic region, and required methods. Producti...

Testnet Rpc

Sui Testnet RPC Endpoint: Chain Settings, Faucet, and Debugging

The Sui Testnet RPC endpoint allows developers to test dApps and smart contracts on the Sui blockchain before mainnet deployment. This article covers ...

Network Rpc

BNB RPC Endpoint: Settings, Limits, and Debugging

A developer reference for BNB Smart Chain RPC endpoints. Learn the official RPC URLs, chain ID, rate limits, WebSocket support, and common error troub...

Network Rpc

Phala RPC 端点:链设置、连接指南和开发者资源

Phala Network 是一个 Polkadot 平行链,利用可信执行环境(TEE)提供机密智能合约。要与 Phala 交互,开发者需要可靠的 RPC 端点来读取链上数据、提交交易和部署 Phat Contracts。本文涵盖 Phala RPC 链设置、如何连接以及选择 RPC 提供商时的注意...

Rpc Provider Selection

如何评估面向生产级Web3项目的以太坊RPC可靠性

为生产级dApp、钱包和DeFi协议选择可靠的以太坊RPC提供商至关重要。本文概述了关键标准——正常运行时间、延迟、MEV保护、归档数据和故障转移——并提供了实用的检查清单,帮助团队评估提供商。OnFinality提供以太坊RPC端点,具有可配置的限制和适用于高要求工作负载的专用节点选项。...

Network Rpc

选择 Arbitrum RPC 提供商时应注意什么?

# 选择 Arbitrum RPC 提供商时应注意什么? Arbitrum RPC 提供商至关重要,因为 Web3 应用程序依赖稳定的端点访问来进行读取、交易、仪表盘和后端工作流。正确的设置应匹配您的工作负载,支持您所需的网络和测试网,使限制可见,并在共享 RPC 不再足够时为您提供扩展路径。 对于...

永远不用担心基础设施

OnFinality 消除了 DevOps 的繁重工作,让您能够更聪明、更快地构建。

开始