Testnet Deployment
Deploy to Stacks testnet to test your dApp with real network conditions before mainnet launch.Prerequisites
- Testnet STX for gas fees
- Testnet sBTC (if your contracts use it)
- Mnemonic in
contracts/settings/Testnet.toml
Get testnet tokens
- Visit Hiro Faucet
- Request STX and sBTC
- Add your mnemonic to
Testnet.toml:
Deploy to testnet
- Generate deployment plan
- Submit transactions to testnet
- Update
deployments.jsonwith addresses
Start frontend
http://localhost:3000 connected to testnet.
Test interactions
- Connect Leather/Xverse wallet (set to Testnet)
- Use debug UI to call contract functions
- Verify wallet prompts and confirmations
Iterate and redeploy
Contracts are immutable, so changes create new versions:Troubleshooting
Transaction failures
- Check gas fees (increase if needed)
- Verify mnemonic and derivation path
- Ensure sufficient testnet balance
Contract errors
- Use
stacksdapp checkfor syntax validation - Test locally first with devnet
- Check contract requirements
Frontend issues
- Verify network configuration in
.env.local - Check browser console for errors
- Ensure wallet is set to testnet