Mainnet Deployment
Deploy your production dApp to Stacks mainnet.
Mainnet deployments are permanent and costly. Test thoroughly on testnet first.
Prerequisites
- Mainnet STX for deployment fees
- Mainnet sBTC (if needed)
- Mnemonic in
contracts/settings/Mainnet.toml
Security checklist
Configure mainnet settings
Add your mainnet mnemonic to Mainnet.toml:
[accounts.deployer]
mnemonic = "your mainnet seed phrase"
derivation = "m/44'/5757'/0'/0/0"
Deploy to mainnet
stacksdapp deploy --network mainnet
Run a dry-run first to review estimated fees and contract list:
stacksdapp deploy --network mainnet --dry-run
Monitor deployment on Stacks Explorer.
Start production frontend
stacksdapp dev --network mainnet
Post-deployment
- Update frontend with mainnet addresses
- Announce launch on social media
- Monitor contract interactions
- Plan for future upgrades
Emergency procedures
If issues arise:
- Pause contract functions (if implemented)
- Assess impact
- Deploy fixes as new contract versions
- Communicate with users
Costs
- Deployment: ~0.1-1 STX per contract
- Function calls: Variable based on complexity
- Storage: Paid by contract owner initially
Monitor fees on Stacks Explorer.