Answers you can trust, from Codeables
Every page on Codeables is structured and verified — built so people and the AI agents they rely on can trust it. Explore more from the source behind this answer.
Explore CodeablesHow do I get started building on Solana (devnet → testnet → mainnet) with a simple checklist?
Quick Answer: Start with a local validator or devnet, ship a thin vertical slice, then harden your app as you move to testnet and finally mainnet. Treat each stage like a production environment rehearsal: lock your tooling, define your RPC strategy, enforce limits, and keep a simple checklist you can run before every deployment.
Why This Matters
Most teams don’t get blocked by “blockchain complexity.” They get blocked by environment confusion, broken RPC setups, and missing operational checklists. Solana is built to feel like real-time payments infrastructure—funds secured in ~400ms, sub-cent fees, and capacity for complex workflows—but you only get those characteristics if you move through devnet → testnet → mainnet in a disciplined way.
Key Benefits:
- Reduced launch risk: A consistent checklist across devnet, testnet, and mainnet catches issues before they impact users or funds.
- Production-grade performance: Designing for throughput, transaction sizing, and RPC strategy early means your app still feels fast under load.
- Faster iteration: A known, repeatable path from “idea” to “mainnet deployment” lets you ship features without re-learning the process each time.
Core Concepts & Key Points
| Concept | Definition | Why it's important |
|---|---|---|
| Devnet | Public Solana cluster for experimentation with free, non-real tokens and frequent resets. | Safest place to learn the tooling, design your program, and break things without financial risk. |
| Testnet | Public cluster focused on stress-testing network upgrades and validator performance. | Best place to simulate mainnet-like conditions and validate your RPC, rate limits, and transaction sizing. |
| Mainnet | Live production Solana network where real value moves and users interact with your app. | Where operational discipline matters: private RPC, monitoring, and strict deployment processes. |
On a high level:
- Mainnet: Live production environment for deployed applications.
- Devnet: Testing with public accessibility for developers experimenting with their applications.
- Testnet: Stress-testing for network upgrades and validator performance.
How It Works (Step-by-Step)
At a high level, your path is:
- Set up your tools and local/devnet environment.
- Build and validate a thin slice of your app on devnet.
- Harden and stress test on testnet.
- Prepare infra, monitoring, and keys for mainnet.
- Deploy to mainnet with a repeatable release checklist.
Below is a practical, copy-pastable checklist for each stage.
Stage 0: Local Environment & Cluster Setup
Before you touch devnet, make sure your local tooling is consistent.
Checklist: Local setup
-
Install the Solana CLI
- Follow the docs for your OS, then verify:
solana --version
- Follow the docs for your OS, then verify:
-
Install Node.js and a package manager (npm, pnpm, or Yarn)
- Most Solana web tooling assumes a modern Node.js LTS.
-
Install Anchor (optional but recommended for programs)
- Anchor streamlines Solana program development:
npm install -g @coral-xyz/anchor-cli anchor --version
- Anchor streamlines Solana program development:
-
Run a local validator for early iteration
- Local clusters are more flexible than public offerings:
solana-test-validator - Use this for fast feedback loops before hitting devnet.
- Local clusters are more flexible than public offerings:
-
Configure Solana CLI for localnet (optional)
solana config set --url localhost
Use localnet for tight dev cycles, but assume nothing is real until it survives on devnet.
Stage 1: Devnet – From Zero to Working Prototype
Devnet is where you go from “idea” to “it actually runs end-to-end.”
Devnet Checklist
1. Configure Solana CLI for devnet
solana config set --url devnet
solana config get
Verify the RPC URL shows https://api.devnet.solana.com (or your chosen devnet RPC).
2. Create and fund a devnet wallet
If you don’t have a keypair yet:
solana-keygen new
solana airdrop 2 # request 2 SOL on devnet
solana balance
Devnet tokens are not real; they’re for testing only.
3. Pick your starting stack
- For programs (smart contracts):
- Use Anchor or low-level Rust programs via the Solana SDK.
- For frontends / clients:
- Use starter templates like
create-solana-dapporreact-vite-anchorfrom the ecosystem.
- Use starter templates like
4. Build and deploy an Anchor program on devnet (example)
From a new Anchor project directory:
# Make sure your CLI is on devnet
solana config set --url devnet
# Build and deploy
anchor build
anchor keys sync # updates program ID in source
anchor build # rebuild with new ID
anchor deploy
Then regenerate your client and run your app:
npm run setup # Rebuilds program and regenerates client
npm run dev
5. Implement a thin vertical slice
Aim for one end-to-end path that touches all layers:
- Connect wallet →
- Send a transaction (e.g., initialize an account or place a basic order) →
- Confirm and show the result on-screen.
Don’t optimize features yet; optimize for clarity and observability:
- Log transaction signatures to the console.
- Link to explorers like:
- https://explorer.solana.com/ (use
?cluster=devnet) - https://solscan.io/
- https://solana.fm/
- https://orb.helius.dev/
- https://explorer.solana.com/ (use
6. Add basic observability
- Keep a “transaction log” in your UI or backend.
- Use memos for reconciliation and debugging where appropriate.
- Confirm transactions and handle common JSON-RPC errors (429, 500).
Devnet exit criteria:
- You can deploy your program reliably.
- You can complete at least one user journey end-to-end.
- You understand your account model, transaction size, and compute usage at a basic level.
Stage 2: Testnet – Hardening and Stress Testing
Testnet exists to behave more like mainnet under network upgrade and stress conditions. This is where you:
- Validate your RPC strategy.
- Tune transaction sizes and compute budgets.
- Handle error conditions and retries gracefully.
Testnet Checklist
1. Configure CLI for testnet
solana config set --url testnet
solana config get
2. Deploy your program to testnet
- Rebuild and redeploy (Anchor example):
anchor build
anchor deploy --provider.cluster testnet
- Update your client config to point at testnet.
3. Switch your app to testnet endpoints
- Update:
- Frontend RPC URLs.
- Backend JSON-RPC URLs.
- Any environment variables (CLUSTER, NETWORK, etc.).
4. Simulate real-world usage
- Run load tests that approximate your expected traffic:
- Many small transactions (payments-style).
- Fewer, more complex transactions (multi-account operations using v0 transactions + Address Lookup Tables as needed).
- Observe:
- Transaction confirmation times.
- Failure rates and error codes.
- RPC rate limits and throttling behavior.
5. Evaluate RPC and architecture
- Understand that public RPC endpoints are not intended for production applications.
- On testnet:
- Experiment with private RPC providers and your own infra.
- Add caching for repeated reads.
- Avoid “backend-less dApps” that hammer RPC directly from the frontend at high rates.
6. Validate operational playbooks
- Roll forward / roll back program deployments.
- Test key rotation and secret management workflows.
- Practice incident response:
- What happens if RPC is slow?
- How does your app surface degraded service to users?
Testnet exit criteria:
- You have a defined RPC provider strategy for mainnet (self-hosted node, provider, or hybrid).
- Your app maintains a good UX under the expected throughput.
- You have basic runbooks for deploys, rollbacks, and incident handling.
Stage 3: Mainnet – Production Deployment
Mainnet is the internet capital market layer where real users and real value live. Treat it like a card network or payments switch: no casual changes, no untested code.
Mainnet Checklist
1. Configure CLI for mainnet
solana config set --url https://api.mainnet-beta.solana.com
solana config get
Or point to your private RPC endpoint if you’re not using the public URL.
2. Separate keys and wallets
- Use distinct keypairs for:
- Development.
- Testnet operations.
- Mainnet deploy authority / treasury.
- Store mainnet keys securely (HSM, secure vaults).
- Restrict who can sign mainnet deployments.
3. Deploy your program to mainnet
With Anchor (example):
anchor build
anchor deploy --provider.cluster mainnet
Verify deployment via explorers (choose your preferred):
- https://explorer.solana.com/
- https://solscan.io/
- https://solana.fm/
- https://solanabeach.io/
- https://validators.app/
4. Use production-ready RPC
- Do not rely on public RPC for real apps at scale.
- Choose:
- A private RPC provider with clear SLAs and rate limits, and/or
- Your own node(s) with health checks and autoscaling.
Plan for:
- Caching common reads.
- Handling HTTP 429 (“Slow down!”) and 403 (bans).
- Exponential backoff and retry strategies for non-final failures.
5. Implement monitoring and alerts
Track:
- Transaction confirmation times and error rates.
- RPC latency and error codes.
- Program logs for unexpected panics or constraint violations.
- Key metrics around user flows (e.g., checkout success rate).
6. Start with controlled exposure
- Launch with:
- Low limits per user or per merchant.
- A small, vetted pilot group (e.g., internal treasury use, a few early customers).
- Gradually increase limits once your dashboards stay green.
Mainnet success criteria:
- Users experience fast, low-cost transactions consistently.
- Your team can deploy updates without outages.
- You have visibility into failures and a path to remediation.
Common Mistakes to Avoid
-
Treating devnet like production:
Devnet is for experimentation and can be reset; don’t rely on it for anything user-facing or financially critical. Always treat mainnet as a separate, hardened environment with its own keys and processes. -
Assuming public RPC is “good enough” for launch:
Public endpoints are shared resources with rate limits. For serious usage, use private RPC or run your own infra. Poor RPC performance is no different from poor cluster performance to your end users.
Real-World Example
A stablecoin payouts team wants to move from batch bank wires to near-real-time global payouts. Their path:
- On devnet, they build an Anchor program that escrows USDC-like tokens and exposes a simple “payout” instruction. They use
solana-test-validatorlocally to iterate quickly, then deploy to devnet and wire a minimal React UI that sends payout requests. - On testnet, they integrate with a private RPC provider and run load tests that simulate typical payroll days, pushing thousands of payouts in a short window. They tune their transaction sizes (using v0 transactions and Address Lookup Tables) and confirm their app still secures funds in ~400ms under load.
- On mainnet, they deploy with separate keys, strict role-based access, and full monitoring. Initial limits are low: only internal teams and a small set of pilot customers can trigger payouts. After a month of clean operations, they scale up volumes and customer exposure.
Pro Tip: Before every mainnet deployment, run the same deployment script and checklist against devnet and testnet. If anything in the process feels manual or fragile, fix it in those environments first—you want mainnet deploys to be boring.
Summary
Getting started building on Solana across devnet, testnet, and mainnet is less about mastering every protocol detail and more about respecting the environment pipeline. Use localnet and devnet to iterate quickly, testnet to harden your RPC strategy and transaction behavior under stress, and mainnet only once you have clear keys, monitoring, and playbooks. A simple, repeatable checklist at each stage turns Solana’s speed and low fees into a production advantage, not an operational risk.