Deployment
BazaarFi deploys as three services: Solana program, indexer (Node.js + WebSocket), and web app (Next.js). Postgres is shared between the indexer and web API.
Solana program
anchor build
pnpm test:program
anchor deploy --provider.cluster devnet # ~2.5 SOL
anchor deploy --provider.cluster mainnet # ~5 SOLAfter deploy, run initialize_config once with the upgrade authority. Default fee: 50 bps (0.5%).
Environment
| Variable | Purpose |
|---|---|
DATABASE_URL | Postgres connection |
HELIUS_API_KEY | DAS metadata + portfolio |
NEXT_PUBLIC_CLUSTER | devnet or mainnet-beta |
NEXT_PUBLIC_RPC_URL | Solana RPC endpoint |
NEXT_PUBLIC_WS_URL | Indexer WebSocket URL |
INDEXER_WS_PORT | WS listen port (8788) |
Indexer
pnpm --filter @bazaarfi/indexer startRun as a persistent process (systemd, Docker, VPS). Use a dedicated RPC with high rate limits — polling every 3s is RPC-intensive.
Web app
pnpm --filter @bazaarfi/web build
pnpm --filter @bazaarfi/web startDeployable to Vercel with monorepo build config. The indexer must run separately.
Mainnet checklist
- Deploy program to mainnet
- Initialize config
- Flip
NEXT_PUBLIC_CLUSTER=mainnet-beta - Run migrations on production Postgres
- Start indexer on mainnet RPC
- Deploy web with updated env
Full deployment guide: docs/deployment.md