This guide walks you through deploying Mova Store to the Stellar mainnet for production use.
Warning: Mainnet transactions use real funds. Triple-check all addresses and amounts before submitting transactions.
Before deploying to mainnet, ensure you have:
- Completed testnet testing with no critical bugs
- Performed a security audit of the smart contract
- Set up monitoring and alerting
- Prepared incident response procedures
- Configured proper backup and recovery processes
-
Generate a new keypair for your merchant wallet:
stellar keys generate merchant-mainnet
-
Back up your secret key securely (hardware wallet, encrypted storage, etc.)
-
Fund your account with at least 10 XLM for reserves and deployment fees:
- Purchase XLM from an exchange
- Transfer to your new merchant address
-
Verify the account is funded:
stellar account info --network mainnet --source-account merchant-mainnet
- Use a hardware wallet (Ledger) for the merchant key
- Enable multi-signature if managing significant funds
- Never share or commit your secret key
- Store backups in multiple secure locations
cd contracts/checkout
# Build with release optimizations
stellar contract build
# The optimized wasm is at:
# target/wasm32-unknown-unknown/release/movastore_checkout.wasm# Run all tests before deployment
cargo test
# Check the wasm size (should be under 64KB)
ls -la target/wasm32-unknown-unknown/release/movastore_checkout.wasmstellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/movastore_checkout.wasm \
--source-account merchant-mainnet \
--network mainnetSave the returned contract ID (starts with C).
Initialize with your merchant wallet address:
stellar contract invoke \
--id <CONTRACT_ID> \
--source-account merchant-mainnet \
--network mainnet \
-- \
initialize \
--merchant <YOUR_MERCHANT_PUBLIC_KEY>stellar contract invoke \
--id <CONTRACT_ID> \
--network mainnet \
-- \
merchantShould return your merchant address.
Get the mainnet USDC contract ID from Circle's documentation or the Stellar Asset List.
# Mainnet USDC (verify this address before using!)
stellar contract invoke \
--id <CONTRACT_ID> \
--source-account merchant-mainnet \
--network mainnet \
-- \
add_token \
--token <MAINNET_USDC_CONTRACT_ID># Mainnet native XLM SAC
stellar contract invoke \
--id <CONTRACT_ID> \
--source-account merchant-mainnet \
--network mainnet \
-- \
add_token \
--token CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMAstellar contract invoke \
--id <CONTRACT_ID> \
--network mainnet \
-- \
is_token_allowed \
--token <TOKEN_CONTRACT_ID>Update your .env.local (or production environment variables):
# Switch to mainnet
NEXT_PUBLIC_STELLAR_NETWORK=mainnet
# Mainnet RPC endpoint (use a reliable provider)
NEXT_PUBLIC_STELLAR_RPC_URL=https://soroban-rpc.mainnet.stellar.gateway.fm
# Mainnet passphrase
NEXT_PUBLIC_STELLAR_NETWORK_PASSPHRASE=Public Global Stellar Network ; September 2015
# Your deployed mainnet contract
NEXT_PUBLIC_CHECKOUT_CONTRACT_ID=<YOUR_MAINNET_CONTRACT_ID>
# Mainnet USDC contract ID
NEXT_PUBLIC_USDC_CONTRACT_ID=<MAINNET_USDC_CONTRACT_ID>
# Mainnet native XLM SAC
NEXT_PUBLIC_NATIVE_ASSET_CONTRACT_ID=CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA- Connect your repository to Vercel
- Add environment variables in the Vercel dashboard
- Deploy
Build and deploy the Next.js app:
npm run build
npm start- Create a test order with a small amount (e.g., $1 USDC)
- Complete the payment
- Verify the order appears in the admin dashboard
- Test dispatch (release funds to merchant)
- Test refund with another small order
Use Stellar Expert or StellarChain to monitor:
- Contract invocations
- Token transfers
- Event emissions
Before going live, verify:
- Contract is initialized with correct merchant address
- Only intended tokens are whitelisted
- Merchant wallet is securely stored
- Admin emails are correctly configured
- Rate limiting is in place
- Error monitoring is configured (e.g., Sentry)
- Backup procedures are documented
- Incident response plan is ready
- Ensure the user has enough tokens plus XLM for fees
- Check that the user has a trustline for USDC
- Verify the contract ID is correct
- Check that the token is whitelisted
- Ensure the merchant wallet is the one that initialized the contract
- Freighter must be set to "Mainnet"
- User must have XLM for transaction fees
- Do NOT process new orders (disable checkout)
- Document the issue
- Assess impact on existing orders
- Decide on manual refunds if needed
- Deploy a fix or migrate to a new contract
Only the current merchant can transfer ownership:
stellar contract invoke \
--id <CONTRACT_ID> \
--source-account merchant-mainnet \
--network mainnet \
-- \
set_merchant \
--new_merchant <NEW_MERCHANT_ADDRESS>For issues specific to:
- Mova Store: Open a GitHub issue
- Stellar/Soroban: Stellar Discord
- Freighter: Freighter Support
Remember: Mainnet is production. Test thoroughly on testnet first, and start with small transaction amounts when going live.