In short
RPC is the HTTP/JSON API your code uses to read from and send to the network. Use public endpoints for testing and a provider in production.You’ve used this in: Payments Step 3 Pay-per-call Step 3 Tokenized asset Step 3
Solana RPC provides methods to read network state, send transactions, simulate
execution, and subscribe to live updates.
- Applicationyour client or backend
- RPC endpointHTTP and WebSocket APIs
- Validatorstate reads and relay
- Networkaccounts and programs
Choose an RPC Provider
Compare production RPC infrastructure.
HTTP Methods
Request-response RPC methods.
WebSocket Methods
Subscription methods.
SDKs
TypeScript, Rust, Python, Java, Go, and game engines.
Solana CLI reference
Command index and practical examples for the Agave Solana CLI.
SPL Token CLI reference
Command index and examples for SPL Token and Token-2022 mints and accounts.
Network constants
Every runtime constant: accounts, transactions, fees, compute units, PDAs, and CPIs.
JSON structures
The JSON structures that RPC methods return.
Removed methods
Migrate from JSON-RPC methods removed in Agave v2.0 to supported methods.
Code samples on the HTTP and WebSocket reference pages run on both web3.js v3
and web3.js (legacy). web3.js v3 returns
bigint for numeric fields such as
slots, lamports, and counts (legacy returns number), and returns readonly
arrays.The Rust samples target solana-client 4.4 with solana-sdk 5, which needs
Rust 1.98.1 or later. They also build with solana-client 4.3 and
solana-sdk 4. Keep solana-transaction-status-client-types and
solana-account-decoder on the same version as solana-client, and add
solana-commitment-config 3, tokio (with the full feature), and
anyhow. Some samples also use solana-system-interface 3 (with the
bincode feature), futures, base64, and bincode.Cluster Endpoints
The endpoint you call decides which cluster you read from and send to.| Cluster | Public RPC endpoint | Description |
|---|---|---|
| Mainnet | https://api.mainnet.solana.com | Production network using real SOL. |
| Devnet | https://api.devnet.solana.com | Developer testing network. Use the Solana Faucet to get Devnet SOL. |
| Testnet | https://api.testnet.solana.com | Validator testing network. |
Public endpoints are shared and rate-limited, and aren’t meant for production.
They return
429 when you exceed rate limits and 403 when traffic is
blocked. For production, choose an RPC provider
and follow the production readiness guide,
starting with RPC infrastructure.solana-test-validator use these default
localhost endpoints:
| Interface | Endpoint |
|---|---|
| HTTP RPC | http://localhost:8899 |
| WebSocket | ws://localhost:8900 |
Configuring State Commitment
Many methods and subscriptions accept acommitment parameter: how final a
block must be before the node returns data or sends a notification.
| Commitment | Description |
|---|---|
processed | The node’s most recent processed block. This is the newest view, but the block can still be skipped. |
confirmed | The same block as finalized. Kept for compatibility and planned for removal in a later release. |
finalized | A block with a finalization certificate: votes from 80% of stake in one round, or from 60% of stake in each of two rounds. |
confirmed and finalized return the same data, roughly 150 milliseconds
after a block is produced on mainnet; prefer finalized in new code. See
settlement and finality.
If a method or subscription accepts commitment and you omit it, the default is
typically finalized.