The Anchor Workflow
Use this decision workflow from idea to deployed instruction: local build, test, simulate, then promote to devnet and mainnet.
Search across all documentation pages
Use this decision workflow from idea to deployed instruction: local build, test, simulate, then promote to devnet and mainnet.
Yes → edit programs/*/src/lib.rs, update account structs, and add tests.
No → client-only change: update TS client against existing IDL; skip redeploy.
If yes, plan migration or realloc. Add space on init and version your account struct. See realloc in Anchor.
anchor buildFix compile errors and macro expansion issues. Confirm target/idl/*.json updated.
anchor test locallySurfpool or local validator exercises deploy + TS tests. Add cases for new errors and edge seeds.
No → fix program or test fixtures; use solana logs or Surfpool traces.
Yes → proceed to devnet.
anchor deploy --provider.cluster devnet. Run integration tests against devnet RPC or LiteSVM with fetched accounts.
Publish IDL, run Codama/declare_program! refresh, bump npm package if applicable.
New signers, CPIs, or init_if_needed → request review. See CPI Safety.
Verifiable build, audited diff, funded upgrade authority, and rollback plan. Deploy with same anchor deploy flow on mainnet provider.
0.32.1 for anchor-lang, Anchor CLI, and examples in this section.
Yes. Solana CLI 3.0.10 handles keypairs, airdrops, and solana program inspection.
target/idl/<program>.json in your workspace.
Yes, but every unchecked field needs explicit constraints or handler checks.
Use anchor test with Surfpool 0.12.0 or LiteSVM 0.6.x in CI.
Anchor account discriminator; do not strip it when sizing space.
Yes, or publish on-chain IDL so clients have a canonical source.
Run with logs; Anchor prints constraint name and account index.
Yes. This stack targets Agave validators with Solana CLI 3.0.10.
See sibling articles linked in Related for deeper workflow topics.
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