8.4 KiB
โ Final Deployment Checklist - BetFun Arena
Status: Ready to Deploy! ๐
Prerequisites Installed
- Node.js 20+ or Bun installed
- Solana CLI installed (
sh -c "$(curl -sSfL https://release.solana.com/stable/install)") - Anchor CLI installed (
cargo install --git https://github.com/coral-xyz/anchor avm) - Git installed
- Vercel CLI (optional):
npm i -g vercel - Railway CLI (optional):
npm i -g @railway/cli
Phase 1: Smart Contract Deployment
1.1 Build Contracts
cd packages/anchor
anchor build
Expected: Build succeeds, creates target/deploy/betfun.so
1.2 Configure Wallet
# Check current wallet
solana address
# Check balance
solana balance
# If devnet, request airdrop
solana config set --url devnet
solana airdrop 2
# For mainnet, ensure you have ~2 SOL for deployment
solana config set --url mainnet-beta
1.3 Deploy
# Deploy to devnet first (recommended)
anchor deploy --provider.cluster devnet
# OR deploy to mainnet
anchor deploy --provider.cluster mainnet
1.4 Save Program ID
# Get deployed program ID
solana address -k target/deploy/betfun-keypair.json
# SAVE THIS - you'll need it everywhere!
# Example: BetFunArenaPredictionMarketGameV1111111111111
โ Checkpoint: Smart contract deployed, Program ID saved
Phase 2: Environment Configuration
2.1 Frontend Environment
cd apps/web
cp .env.example .env.local
Edit .env.local:
# REQUIRED
NEXT_PUBLIC_SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
NEXT_PUBLIC_PROGRAM_ID=<YOUR_PROGRAM_ID_FROM_STEP_1.4>
NEXT_PUBLIC_SUPABASE_URL=<YOUR_SUPABASE_URL>
NEXT_PUBLIC_SUPABASE_ANON_KEY=<YOUR_ANON_KEY>
# REQUIRED for Moddio (or use demo-world as placeholder)
NEXT_PUBLIC_MODDIO_WORLD_ID=<YOUR_MODDIO_WORLD_ID>
# OPTIONAL (for full features)
INDIE_FUN_API_KEY=<YOUR_KEY>
NEXT_PUBLIC_PLAY_SOLANA_PROJECT_ID=<YOUR_PROJECT_ID>
PLAY_SOLANA_API_KEY=<YOUR_KEY>
NEXT_PUBLIC_SENTRY_DSN=<YOUR_DSN>
2.2 Indexer Environment
cd packages/indexer
cp .env.example .env
Edit .env:
# REQUIRED
SUPABASE_URL=<YOUR_SUPABASE_URL>
SUPABASE_SERVICE_KEY=<YOUR_SERVICE_KEY>
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
PROGRAM_ID=<YOUR_PROGRAM_ID_FROM_STEP_1.4>
# REQUIRED for webhooks (add after Helius setup)
HELIUS_WEBHOOK_SECRET=<ADD_AFTER_STEP_5>
# OPTIONAL
INDIE_FUN_API_KEY=<YOUR_KEY>
PLAY_SOLANA_API_KEY=<YOUR_KEY>
SENTRY_DSN=<YOUR_DSN>
PORT=3001
2.3 Update SDK
Edit packages/sdk/src/index.ts:
export const PROGRAM_ID = new PublicKey('<YOUR_PROGRAM_ID_FROM_STEP_1.4>');
โ Checkpoint: All environment files configured
Phase 3: Database Setup
3.1 Create Supabase Project
- Go to https://supabase.com
- Create new project
- Wait for provisioning (~2 mins)
- Copy URL and keys to env files
3.2 Apply Migrations
- Go to Supabase Dashboard โ SQL Editor
- Open
packages/indexer/supabase/migrations/001_init_schema.sql - Copy contents and run in SQL Editor
- Open
packages/indexer/supabase/migrations/002_add_indexes.sql - Copy contents and run in SQL Editor
3.3 Verify Tables
Check these tables exist in Supabase:
arenasparticipantsleaderboardprocessed_transactions
โ Checkpoint: Database configured and migrations applied
Phase 4: Moddio Setup (Optional but Recommended)
4.1 Create Moddio World
- Go to https://www.moddio.com
- Sign up / Log in
- Click "Create World"
- Copy your World ID
- Add to
NEXT_PUBLIC_MODDIO_WORLD_IDin.env.local
4.2 Configure World (Optional)
- Add custom scripts for event handling
- Design arena visualization
- Configure teams/sides
Note: Can use demo-world as placeholder if skipping Moddio
โ Checkpoint: Moddio configured (or placeholder set)
Phase 5: Test Locally
5.1 Install Dependencies
# From project root
bun install
5.2 Start Frontend
cd apps/web
bun dev
Expected: Frontend runs on http://localhost:3000
5.3 Start Indexer
# In new terminal
cd packages/indexer
bun dev
Expected: Indexer runs on http://localhost:3001
5.4 Test Flow
- Open http://localhost:3000
- Connect wallet (use devnet if testing)
- Create arena
- Join arena with another wallet
- Check Moddio iframe loads
- Resolve arena (as creator)
- Claim winnings (as winner)
โ Checkpoint: Local testing successful
Phase 6: Deploy Frontend (Vercel)
6.1 Push to GitHub
git add .
git commit -m "Ready for deployment"
git push origin main
6.2 Deploy via Vercel Dashboard
- Go to https://vercel.com
- Click "New Project"
- Import GitHub repository
- Configure:
- Framework: Next.js
- Root Directory:
apps/web - Build Command:
cd ../.. && bun install && cd apps/web && bun run build - Install Command:
bun install
- Add all environment variables from
.env.local - Click "Deploy"
OR Deploy via CLI
cd apps/web
vercel --prod
6.3 Verify Deployment
- Visit deployed URL
- Connect wallet
- Test creating arena
โ Checkpoint: Frontend deployed to Vercel
Phase 7: Deploy Indexer (Railway)
7.1 Deploy via Railway Dashboard
- Go to https://railway.app
- Click "New Project"
- Select "Deploy from GitHub repo"
- Select repository
- Configure:
- Root Directory:
packages/indexer - Start Command:
bun run start
- Root Directory:
- Add all environment variables from
.env - Deploy
OR Deploy via CLI
cd packages/indexer
railway login
railway init
railway up
7.2 Get Indexer URL
- Copy deployed URL from Railway dashboard
- Example:
https://betfun-indexer.railway.app
โ Checkpoint: Indexer deployed to Railway
Phase 8: Configure Helius Webhook
8.1 Create Helius Account
- Go to https://dashboard.helius.dev
- Sign up / Log in
- Create new webhook
8.2 Configure Webhook
- Webhook URL:
https://your-indexer.railway.app/webhook/transaction - Webhook Type: Enhanced Transaction
- Transaction Types: All
- Account Addresses: Add your Program ID
- Webhook Secret: Generate and copy
8.3 Update Indexer
- Go to Railway dashboard
- Add environment variable:
HELIUS_WEBHOOK_SECRET=<YOUR_SECRET>
- Redeploy indexer
โ Checkpoint: Helius webhook configured
Phase 9: Final Verification
9.1 Test Production Flow
- Visit production frontend (Vercel URL)
- Connect wallet
- Create arena
- Verify arena appears in Supabase
- Join arena with another wallet
- Check Moddio iframe loads
- Check indexer logs in Railway
- Resolve arena
- Claim winnings
- Verify payout received
9.2 Check Monitoring
- Check Vercel logs for errors
- Check Railway logs for errors
- Check Supabase logs
- Check Sentry for errors (if configured)
9.3 Health Checks
# Test indexer health
curl https://your-indexer.railway.app/health
# Expected: {"status":"healthy",...}
โ Checkpoint: Production deployment verified
Phase 10: Post-Deployment
10.1 Update Documentation
- Update README with production URLs
- Document any deployment issues
- Update API documentation if needed
10.2 Monitor First 24 Hours
- Check for errors in Sentry
- Monitor transaction volume
- Watch for unusual activity
- Verify indexer is syncing
10.3 Social Announcement
- Tweet launch announcement
- Share in Discord
- Post on relevant forums
- Update hackathon submission
โ Checkpoint: BetFun Arena is LIVE! ๐
Emergency Contacts & Resources
Troubleshooting
- Vercel Issues: Check build logs in dashboard
- Railway Issues: Check deployment logs
- Solana Issues: Check https://status.solana.com
- RPC Issues: Try alternative RPC provider
Support
- ๐ Docs:
/docsfolder - ๐ Issues: GitHub Issues
- ๐ฌ Discord: Join server
- ๐ง Email: team@betfun.arena
Key URLs (Update After Deployment)
- Frontend: https://_______.vercel.app
- Indexer: https://_______.railway.app
- Program: https://explorer.solana.com/address/<PROGRAM_ID>
๐ Congratulations!
BetFun Arena is now live on Solana mainnet!
Next Steps:
- Monitor performance
- Gather user feedback
- Iterate and improve
- Prepare hackathon submission
Good luck with the Indie.fun Hackathon! โ๏ธ๐