Devnet to Mainnet Promotion
Promoting a Solana program and dApp from devnet to mainnet-beta is a staged gate process: each cluster has different economics, key material, and risk. Skipping a stage ships surprises at scale.
Search across all documentation pages
Promoting a Solana program and dApp from devnet to mainnet-beta is a staged gate process: each cluster has different economics, key material, and risk. Skipping a stage ships surprises at scale.
Quick-reference recipe card - copy-paste ready.
anchor build --verifiable
anchor test
solana program deploy --url devnet target/deploy/my_program.so
# After checklist: deploy same .so hash to mainnet via multisigWhen to reach for this:
#!/usr/bin/env bash
set -euo pipefail
PROGRAM_SO="target/deploy/vault.so"
DEVNET_HASH=$(solana-verify get-executable-hash "$PROGRAM_SO")
anchor deploy --provider.cluster devnet
echo "Devnet smoke..."
pnpm run smoke:devnet
echo "Hash for mainnet promotion: $DEVNET_HASH"
# Squads proposal attaches this hashWhat this demonstrates:
| Stage | Cluster | Purpose |
|---|---|---|
| 1 | Surfpool / localnet | Fast CI, exploit replay |
| 2 | Devnet | Integration, airdrop testing |
| 3 | Mainnet-beta | Real economics and fees |
.env files: RPC_URL, PROGRAM_ID, CLUSTER never copied blindly between envs| Alternative | Use When | Don't Use When |
|---|---|---|
| Mainnet shadow deploy | Read-only canary | First ever deploy |
| Immutable skip devnet | Tiny throwaway demo | Any user funds |
| Feature-flagged mainnet | Gradual user exposure | Core logic untested |
Minimum one full sprint with integration tests; high-risk protocols add external audit.
Usually different IDs per env; document mapping in ADR.
Tech lead + security + product; multisig signers for deploy.
Top user flows simulate and send on devnet with CI wallet.
Use Surfpool 0.12.0 for CI; devnet for manual QA when needed.
Pre-funded ops wallet; alert below threshold.
Publish same IDL hash as verifiable build release.
Required in promotion ticket - link runbook.
Coordinate deploy, frontend, and comms in one change window.
Validator and CLI align to 4.1.1 per manifest.
Stack versions: This page was written for Agave 4.1.1, Solana CLI 3.0.10, Anchor 0.32.1, anchor-lang 0.32.1, Rust 1.91.1, @solana/kit 7.0.0, Surfpool 0.12.0, and LiteSVM 0.6.x.
Reviewed by Chris St. John·Last updated Jul 16, 2026