Summary
Learn how to connect to Solana Devnet RPC endpoints, get test SOL from the faucet, and debug common issues. This guide covers chain settings, request examples, and how to choose between public and dedicated RPC infrastructure for development.
Quick decision guide: which Solana Devnet RPC should you use?
Before you start building on Solana Devnet, decide how you want to connect. Your choice affects reliability, rate limits, and how much infrastructure you manage.
- Public RPC endpoints (like the official Solana public endpoint) are fine for quick tests and simple scripts, but they are shared and can be rate-limited or unstable under load.
- Managed RPC services (like OnFinality) provide dedicated or shared endpoints with better reliability, higher throughput, and support for WebSocket subscriptions. They are a good fit for development teams that need consistent access.
- Running your own validator/RPC node gives you full control but requires hardware, maintenance, and ongoing monitoring. It is usually overkill for devnet unless you are testing validator behavior.
For most development work, a managed RPC endpoint is the right balance. OnFinality offers a Solana Devnet RPC endpoint that you can use for free during development. If you need dedicated capacity or higher rate limits, check our RPC pricing and supported networks.
What is Solana Devnet?
Solana Devnet is a testnet environment that mimics the Solana mainnet but uses test tokens (devnet SOL) that have no real value. Developers use it to deploy and test programs (smart contracts), practice client integration, and validate transaction flows without risking real funds.
Devnet is not the same as Solana Testnet. Testnet is used for network-wide testing and can be reset frequently. Devnet is more stable and is the recommended environment for application development.
Solana Devnet chain settings
Here are the key parameters you need to configure your wallet or dApp:
| Setting | Value |
|---|---|
| Network name | Solana Devnet |
| RPC URL | https://api.devnet.solana.com (public) or your managed provider's URL |
| WebSocket URL | wss://api.devnet.solana.com/ (public) or your managed provider's WS URL |
| Chain ID | devnet |
| Native currency | SOL (test) |
| Decimals | 9 |
| Explorer | https://explorer.solana.com/?cluster=devnet |
Note: The public endpoint is rate-limited and not recommended for production or heavy testing. For a more reliable devnet RPC, consider using a managed service like OnFinality. You can find the official OnFinality public endpoint on our Solana Devnet network page.
Getting test SOL from the faucet
To interact with devnet, you need devnet SOL. The official faucet is available at https://faucet.solana.com. You can also use the Solana CLI:
solana airdrop 1 <YOUR_WALLET_ADDRESS> --url https://api.devnet.solana.com
If the airdrop fails due to rate limits, wait a few minutes and try again. Some faucets require a minimum balance or have daily caps.
Connecting to Solana Devnet RPC: code examples
Using Solana Web3.js (JavaScript)
import { Connection, clusterApiUrl } from '@solana/web3.js';
// Use the public devnet endpoint or your managed provider's URL
const endpoint = 'https://api.devnet.solana.com';
const connection = new Connection(endpoint, 'confirmed');
async function getBalance(publicKey) {
const balance = await connection.getBalance(publicKey);
console.log('Balance:', balance / 1e9, 'SOL');
}
Using curl with JSON-RPC
curl https://api.devnet.solana.com -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getBalance",
"params": ["<YOUR_PUBLIC_KEY>"]
}
'
Wallet configuration (Phantom, Solflare, etc.)
In most wallets, you can add a custom RPC endpoint:
- Network: Devnet
- RPC URL:
https://api.devnet.solana.com(or your managed endpoint) - Chain ID:
devnet
Common RPC methods for Solana Devnet
Here are the most frequently used JSON-RPC methods:
getBalance– get SOL balance of an accountgetRecentBlockhash– get a recent blockhash for transaction signingsendTransaction– submit a signed transactiongetTransaction– fetch transaction detailsgetSignaturesForAddress– list transaction signatures for an addressgetAccountInfo– get account datagetProgramAccounts– fetch accounts owned by a program
Debugging common devnet RPC issues
1. Rate limiting (HTTP 429)
Public endpoints often return 429 when you exceed request limits. Solutions:
- Add exponential backoff to your requests.
- Use a managed RPC provider with higher rate limits.
- Cache responses where possible.
2. Transaction simulation errors
If sendTransaction fails, simulate first:
const simulation = await connection.simulateTransaction(transaction);
console.log(simulation.value.err);
Common errors include insufficient balance, invalid account, or wrong blockhash.
3. WebSocket disconnections
WebSocket connections can drop. Implement reconnection logic with exponential backoff.
4. Blockhash not found
If you get a "blockhash not found" error, the blockhash expired. Fetch a new one and rebuild the transaction.
Public vs. managed RPC for devnet
| Feature | Public RPC | Managed RPC (e.g., OnFinality) |
|---|---|---|
| Rate limits | Low, shared | Higher, configurable |
| Reliability | Variable | Consistent |
| WebSocket support | Limited | Full support |
| Setup time | Instant | Minimal |
| Cost | Free | Free tier available; paid plans for higher usage |
| Support | Community | Dedicated support |
For development, a managed RPC saves time and reduces friction. OnFinality provides a Solana Devnet endpoint that you can use immediately. If you need dedicated capacity, explore our dedicated node options.
Key Takeaways
- Solana Devnet is a stable test environment for building and testing Solana applications.
- Use the official public endpoint for quick tests, but be aware of rate limits.
- Managed RPC services like OnFinality offer better reliability and support for development.
- Always use a recent blockhash and simulate transactions to avoid errors.
- Monitor your RPC usage and choose a plan that matches your development needs.
Frequently Asked Questions
What is the difference between Solana Devnet and Testnet?
Devnet is a stable test environment for application development, while Testnet is used for network-level testing and can be reset frequently.
How do I get free SOL on devnet?
Use the official faucet at https://faucet.solana.com or the solana airdrop CLI command.
Can I use the same RPC endpoint for mainnet and devnet?
No, they are separate networks with different endpoints. Make sure your application uses the correct endpoint for the environment.
Is devnet SOL worth anything?
No, devnet SOL has no real value and is only for testing.
How do I choose between public and managed RPC for devnet?
If you are doing serious development, a managed RPC like OnFinality provides better reliability and rate limits. For quick experiments, the public endpoint is fine.
What is the OnFinality public endpoint for Solana Devnet?
You can find the official public endpoint on our Solana Devnet network page. We recommend using a managed endpoint for production development.