Summary
Solana Devnet is a testnet for developers to build and test Solana programs without risking real funds. This page explains how to connect to Solana Devnet RPC endpoints, get SOL from the faucet, and debug common issues. It also covers how to choose between public and dedicated RPC infrastructure for your devnet testing.
Quick recommendation: which Solana Devnet RPC should you use?
If you are prototyping a quick script or testing a wallet integration, a public devnet RPC endpoint is usually enough. Public endpoints are free and require no sign-up, but they are shared across many users and can be rate-limited or become slow during peak times.
If you are running a continuous integration pipeline, load testing a dApp, or building a validator or indexer that needs consistent throughput, consider a dedicated RPC node. A dedicated node gives you a private endpoint with predictable performance and no noisy neighbors. OnFinality offers both shared public endpoints and dedicated nodes for Solana Devnet. Check the Solana Devnet network page for current availability and options.
For most development workflows, start with a public endpoint and switch to a dedicated node when you hit rate limits or need more reliability. This article explains the chain settings, how to get test SOL, and how to debug common issues.
What is Solana Devnet?
Solana Devnet is a testnet environment that mimics the Solana mainnet but uses test tokens that have no real value. It is designed for developers to deploy and test Solana programs (smart contracts) and client applications without risking real SOL.
Devnet is distinct from Solana Testnet, which is used for network-wide testing and can be reset frequently. Devnet is more stable and is the recommended environment for application development. It runs the same validator software and supports the same RPC methods as mainnet, so code that works on devnet should work on mainnet with minimal changes.
Chain settings at a glance
Here are the key details for connecting to Solana Devnet:
| Setting | Value |
|---|---|
| Network name | Solana Devnet |
| RPC endpoint | https://api.devnet.solana.com (public) |
| WebSocket endpoint | wss://api.devnet.solana.com/ (public) |
| Chain ID | Not applicable (Solana uses a different model) |
| Native currency | SOL (test tokens) |
| Decimals | 9 |
| Explorer | https://explorer.solana.com/?cluster=devnet |
Note: The public endpoint https://api.devnet.solana.com is operated by Solana Labs and is the default for most tools. OnFinality also provides a public endpoint for Solana Devnet, which you can find on the Solana Devnet network page. When you use a managed provider, you often get a more reliable connection and additional features like analytics and dedicated support.
Getting test SOL from the faucet
To interact with Solana Devnet, you need test SOL to pay for transaction fees and rent. You can get test SOL from the official Solana faucet at https://faucet.solana.com.
- Connect your wallet (e.g., Phantom, Solflare) or paste your wallet address.
- Complete the captcha if required.
- Request SOL. The faucet typically sends a small amount, and you can request more after a cooldown period.
If the faucet is out of funds or not working, you can also request SOL from the Solana Discord in the #devnet-faucet channel, or use a third-party faucet. Some RPC providers also offer a faucet as part of their service.
Connecting to Solana Devnet with common tools
Using Solana CLI
The Solana CLI is the most common way to interact with the network. Set the cluster to devnet and configure your keypair:
solana config set --url https://api.devnet.solana.com
solana config get
To create a new keypair and airdrop test SOL:
solana-keygen new --outfile ~/.config/solana/devnet.json
solana config set --keypair ~/.config/solana/devnet.json
solana airdrop 1
Using web3.js
For JavaScript applications, use @solana/web3.js:
import { Connection, clusterApiUrl } from '@solana/web3.js';
// Use the public devnet endpoint
const connection = new Connection('https://api.devnet.solana.com', 'confirmed');
// Or use a custom RPC endpoint from a provider
// const connection = new Connection('https://your-provider-endpoint', 'confirmed');
async function getBalance(pubkey) {
const balance = await connection.getBalance(pubkey);
console.log(`Balance: ${balance / 1e9} SOL`);
}
Using a wallet
Most Solana wallets (Phantom, Solflare, Backpack) allow you to switch to Devnet in their settings. In Phantom, go to Settings > Developer Settings > Change Network and select "Devnet". The wallet will automatically use the public devnet endpoint.
Debugging common Solana Devnet RPC issues
1. Rate limiting on public endpoints
Public endpoints like api.devnet.solana.com are shared and can rate-limit requests, especially during high traffic. If you see HTTP 429 errors or timeouts, consider:
- Reducing request frequency
- Using a dedicated RPC node
- Implementing retry logic with exponential backoff
2. Transaction simulation failures
When a transaction fails, you often get a Transaction simulation failed error. Use the simulateTransaction RPC method to get more details:
curl https://api.devnet.solana.com -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "simulateTransaction",
"params": [
"<base58-encoded-transaction>",
{
"encoding": "base58",
"replaceRecentBlockhash": true
}
]
}
'
The response will include a logs array that shows the program logs and the error message. Common issues include insufficient funds, invalid account data, or program errors.
3. Blockhash not found
If you get a Blockhash not found error, it means the recent blockhash you used is stale. Fetch a fresh blockhash before sending a transaction:
const { blockhash } = await connection.getLatestBlockhash('confirmed');
const transaction = new Transaction().recentBlockhash = blockhash;
4. WebSocket disconnections
WebSocket connections can drop due to network issues or server restarts. Implement reconnection logic in your client:
function connectWebSocket(url) {
const ws = new WebSocket(url);
ws.onclose = () => {
console.log('WebSocket closed, reconnecting...');
setTimeout(() => connectWebSocket(url), 1000);
};
return ws;
}
Public vs. dedicated RPC for devnet
When you search for "rpc solana devnet", you will find both public and commercial RPC endpoints. Here is a comparison to help you decide:
| Feature | Public endpoint (e.g., api.devnet.solana.com) | Dedicated RPC (e.g., OnFinality) |
|---|---|---|
| Cost | Free | Paid (see pricing) |
| Rate limits | Yes, often aggressive | Higher limits or unlimited |
| Performance | Shared, variable | Dedicated, consistent |
| Reliability | Can be down or slow | Managed with uptime monitoring |
| Support | Community only | Provider support |
| Extra features | None | Analytics, WebSocket, archive data |
For a production dApp, you would never rely on a public devnet endpoint. But for development, a public endpoint is fine until you need more. If you are building a serious project, consider a dedicated node from a provider like OnFinality to avoid surprises.
How to choose a Solana Devnet RPC provider
If you decide to use a commercial RPC provider, evaluate them on these criteria:
- Network coverage: Does the provider support Solana Devnet? Not all do. Check the supported networks list.
- Performance: Look for providers with low latency and high throughput. Some providers offer dedicated nodes that give you a private endpoint.
- Reliability: Check the provider's uptime history and whether they offer SLAs. Avoid providers that make unrealistic guarantees.
- Features: Do you need WebSocket support, archive data, or specific RPC methods? Some providers offer enhanced APIs.
- Pricing: Compare pricing models. Some charge per request, others per node. See RPC pricing for OnFinality's model.
OnFinality is a good option because it supports Solana Devnet and offers both shared and dedicated nodes. You can start with a free public endpoint and upgrade as needed.
Key Takeaways
- Solana Devnet is a testnet for developers to build and test Solana programs without real funds.
- The default public RPC endpoint is
https://api.devnet.solana.com, but it can be rate-limited. - Get test SOL from the official faucet or community channels.
- Use the Solana CLI, web3.js, or a wallet to connect to Devnet.
- Debug common issues like rate limiting, simulation failures, and blockhash errors.
- For serious development, consider a dedicated RPC node from a provider like OnFinality for better performance and reliability.
Frequently Asked Questions
What is the difference between Solana Devnet and Testnet?
Solana Devnet is a stable testnet for application development, while Testnet is used for network-level testing and can be reset frequently. Devnet is recommended for most developers.
How do I get SOL on Solana Devnet?
You can get test SOL from the official faucet at https://faucet.solana.com or from community faucets. You can also request SOL in the Solana Discord.
Can I use the same RPC methods on Devnet as on Mainnet?
Yes, Solana Devnet supports the same JSON-RPC methods as Mainnet, so you can test your code without changes.
Is there a rate limit on the public Solana Devnet RPC?
Yes, public endpoints have rate limits to prevent abuse. If you need higher limits, consider a dedicated RPC node.
Does OnFinality support Solana Devnet?
Yes, OnFinality supports Solana Devnet. Visit the Solana Devnet network page for more details and to get an endpoint.