Summary
Solana Devnet is a public test cluster for building and testing Solana programs without risking real funds. Its official public RPC endpoint is https://api.devnet.solana.com, but public endpoints are rate-limited and shared, so serious development often uses a managed RPC provider like OnFinality for higher limits and reliability. This article explains the endpoint, how to connect, common pitfalls, and when to move to a dedicated endpoint.
Quick answer: Solana Devnet RPC endpoint
The official public Solana Devnet RPC endpoint is https://api.devnet.solana.com. It is operated by Solana Labs and is free to use, but it is rate-limited and shared by all developers. For heavier testing, you can use a managed RPC provider like OnFinality, which offers dedicated Solana Devnet endpoints with higher throughput and reliability.
Solana Devnet is a public test cluster where you can deploy programs, run transactions, and test your dApp without spending real SOL. It behaves like Mainnet but with free SOL from a faucet. This makes it the standard environment for development and integration testing.
Decision guide: When to use the public endpoint vs a managed provider
Before you start coding, decide which endpoint fits your workflow:
- Quick experiments and simple scripts: The public endpoint
https://api.devnet.solana.comis fine for occasional requests. You can get a feel for the RPC API and test basic calls. - Active development and integration testing: If you are building a dApp, running automated tests, or making many requests, the public rate limits will likely throttle you. A managed RPC provider like OnFinality gives you higher rate limits, dedicated throughput, and better reliability.
- Production-like load testing: If you need to simulate real user traffic or test performance, use a dedicated endpoint. Public endpoints are not designed for sustained load.
If you are unsure, start with the public endpoint to prototype, then move to a managed provider as your testing becomes more demanding. OnFinality offers Solana Devnet RPC with flexible plans, and you can check RPC pricing for details.
Solana clusters at a glance
Solana has three main clusters, each with a different purpose:
| Cluster | Endpoint | Purpose |
|---|---|---|
| Mainnet | https://api.mainnet.solana.com | Live production environment |
| Devnet | https://api.devnet.solana.com | Public testing with free SOL |
| Testnet | https://api.testnet.solana.com | Stress-testing network upgrades |
Devnet is the most commonly used for application development because it is publicly accessible and has a faucet. Testnet is more focused on validator performance and network upgrades.
Connecting to Solana Devnet
You can connect to Solana Devnet using the Solana CLI, JavaScript libraries, or direct JSON-RPC calls. Here are the common ways.
Using the Solana CLI
Set your CLI to use Devnet:
solana config set --url https://api.devnet.solana.com
Then you can check the configuration:
solana config get
You should see the RPC URL set to https://api.devnet.solana.com.
Using @solana/web3.js
In a Node.js or browser environment, you can create a connection:
import { Connection, clusterApiUrl } from '@solana/web3.js';
const connection = new Connection('https://api.devnet.solana.com', 'confirmed');
// or use the helper:
// const connection = new Connection(clusterApiUrl('devnet'), 'confirmed');
// Example: get the current slot
const slot = await connection.getSlot();
console.log('Current slot:', slot);
Direct JSON-RPC call
You can also make a raw HTTP request:
curl https://api.devnet.solana.com -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getSlot"
}
'
This returns the current slot number, confirming connectivity.
Getting free SOL from the Devnet faucet
To pay for transaction fees and rent on Devnet, you need Devnet SOL. You can get it from the official faucet at https://faucet.solana.com or use the CLI:
solana airdrop 1
This airdrops 1 SOL to your configured keypair. Note that the faucet has rate limits, so if you need a lot of SOL, request in smaller amounts or wait between requests.
Common pitfalls and how to debug them
When working with Solana Devnet, you may encounter several issues. Here are common symptoms and fixes:
| Symptom | Likely cause | Fix |
|---|---|---|
429 Too Many Requests | Public endpoint rate limit exceeded | Use a managed RPC provider or reduce request frequency |
Transaction simulation failed | Program error or insufficient funds | Check the error logs, ensure you have Devnet SOL, and verify program logic |
Blockhash not found | Transaction too old or network congestion | Retry with a fresh blockhash or increase timeout |
Connection refused | Network issue or endpoint down | Check your internet, try again, or use an alternative endpoint |
Debugging with logs
When a transaction fails, use the CLI to get more details:
solana confirm -v <transaction-signature>
This shows the transaction status and logs, which often contain the specific error.
When to move to a managed RPC provider
As your project grows, the public Devnet endpoint may become a bottleneck. Here are signs you need a managed provider:
- You are hitting rate limits frequently.
- Your tests are slow because of throttling.
- You need WebSocket subscriptions for real-time data.
- You want higher reliability and uptime for CI/CD pipelines.
OnFinality provides Solana Devnet RPC with dedicated endpoints, higher rate limits, and WebSocket support. You can also explore all supported networks to see if other chains you use are covered.
Key Takeaways
- The official Solana Devnet RPC endpoint is
https://api.devnet.solana.com. - Devnet is for testing with free SOL, while Mainnet is for production.
- Public endpoints are rate-limited; consider a managed provider for serious development.
- Use the Solana CLI,
@solana/web3.js, or direct JSON-RPC to connect. - Get free SOL from the faucet to pay for transactions.
- Debug common issues like rate limits and transaction failures with the right tools.
Frequently Asked Questions
What is the Solana Devnet RPC URL?
The official public URL is https://api.devnet.solana.com. Managed providers like OnFinality offer their own endpoints with higher limits.
Is Solana Devnet free to use?
Yes, the public endpoint is free, and you can get free Devnet SOL from the faucet. However, rate limits apply.
Can I use WebSocket on Solana Devnet?
The public endpoint supports WebSocket at wss://api.devnet.solana.com. Managed providers may offer more reliable WebSocket connections.
How do I get Devnet SOL?
Use the official faucet at https://faucet.solana.com or the solana airdrop command.
What is the difference between Devnet and Testnet?
Devnet is for application development and testing, while Testnet is for stress-testing the network itself. Devnet is more suitable for most developers.