Environments
LightChallenge supports three environments: Local, UAT, and Production.
Domain Architecture
| Environment | App | Docs | Explorer |
|---|---|---|---|
| Local | localhost:3000 | — | — |
| UAT | uat.lightchallenge.app | uat.docs.lightchallenge.app | testnet.lightscan.app |
| Production | app.lightchallenge.app | docs.lightchallenge.app | TBD |
Chain Configuration
| Environment | Chain | Chain ID | RPC |
|---|---|---|---|
| Local | Lightchain Testnet | 8200 | https://rpc.testnet.lightchain.ai |
| UAT | Lightchain Testnet | 8200 | https://rpc.testnet.lightchain.ai |
| Production | Lightchain Mainnet | TBD | TBD |
Database
Each environment uses a separate PostgreSQL database (Neon):
| Environment | Variable | Notes |
|---|---|---|
| Local | DATABASE_URL in webapp/.env.local | Developer’s local or Neon branch |
| UAT | DATABASE_URL in Vercel (Preview) | Shared UAT database |
| Production | DATABASE_URL in Vercel (Production) | Production database (separate Neon project) |
Key Environment Variables That Differ
| Variable | Local | UAT | Production |
|---|---|---|---|
NEXT_PUBLIC_BASE_URL | http://localhost:3000 | https://uat.lightchallenge.app | https://app.lightchallenge.app |
DATABASE_URL | Local/dev DB | UAT Neon DB | Production Neon DB |
LCAI_WORKER_PK | Dev wallet | UAT operator wallet | Production operator wallet |
LCAI_FINALIZE_PK | Dev wallet | UAT operator wallet | Production operator wallet |
NEXT_PUBLIC_CHAIN_ID | 8200 | 8200 | TBD (mainnet) |
Vercel Configuration
Single Vercel project (lightchallenge) with environment-scoped variables:
- Preview deployments → UAT environment variables
- Production deployments → Production environment variables
- Root directory:
webapp - Framework: Next.js
- GitHub auto-deploy:
mainbranch
iOS Collector
| Environment | Server URL | Default |
|---|---|---|
| Local | http://<MAC_IP>:3000 | No |
| UAT | https://uat.lightchallenge.app | Yes (testnet phase) |
| Production | https://app.lightchallenge.app | Yes (mainnet phase) |
The iOS app defaults to UAT during the testnet phase. Users can switch environments in the app UI.
Local Development Setup
# 1. Clone and install
git clone https://github.com/marinom2/lightchallenge.git
cd lightchallenge
npm install
cd webapp && npm install && cd ..
# 2. Configure environment
cp .env.example webapp/.env.local
# Edit webapp/.env.local with your DATABASE_URL and keys
# 3. Run database migrations
npx tsx db/migrate.ts
# 4. Start the webapp
cd webapp && npm run dev
# 5. Start workers (separate terminals)
npx tsx offchain/workers/evidenceEvaluator.ts
npx tsx offchain/workers/challengeDispatcher.ts
npx tsx offchain/workers/challengeWorker.ts
npx tsx offchain/workers/autoDistributeWorker.tsContract Addresses (LightChain testnet v2 — chain ID 8200)
| Contract | Address |
|---|---|
| ChallengePay | 0xeC651C299E978667fCDeF706Ef5Dd285e56EFd0b |
| Treasury | 0xF8E32344CC311A82f20112484F686b1038122FF3 |
| MetadataRegistry | 0x21455872fc8529b3d91fB6d7Cb0E578c6817ef8D |
| EventChallengeRouter | 0x08BA527C65FeD4653E8569fd26C582A72F4157d8 |
| ChallengeTaskRegistry | 0x46f02E5e058B7Cdeee35fcf7E389E4F5C4632240 |
| ChallengePayLightchainAttestor | 0xb400770550Db25Af86b1c3CC380e92BC777E3360 |
| ChallengeAchievement | 0xd4949186434C2F2b186A7E20Fcbe58ae1939a630 |
| TrustedForwarder | 0xc7C5F8f498158b2cdeaA9c91CBf79AE9d4251991 |
| MultiSigWallet | 0xd9e56435290A2e8f93D6F8a0e329478D8E851469 |