Environment Files
Each package has its own.env file:
Copy from examples:
Server Environment
Required
Optional
Solana Configuration
SOLANA_DEPLOYER_PRIVATE_KEY is automatically decoded and written to:
~/.config/solana/id.json(Solana CLI default location)deployer-keypair.json(legacy location)
scripts/decode-key.ts.
Client Environment
Required
Production
AI Agent Environment
PM2 Production Deployment
The production duel stack uses PM2 for process management with automatic restarts:PM2 Configuration
PM2 Commands
Stream Key Management
Stream keys must be explicitly unset and re-exported before PM2 start to avoid stale environment variables:- Vast.ai servers can have stale stream keys in their environment from previous deployments
- These stale values override the .env file values
- Explicitly unsetting ensures clean environment before sourcing .env
- Prevents streams from going to wrong channels/accounts
Maintenance Mode
The server provides a maintenance mode API for graceful deployments without data loss.Environment Variables
API Endpoints
Enter Maintenance Mode:What Maintenance Mode Does
When maintenance mode is entered:- Pauses new duel cycles - Current cycle completes, no new cycles start
- Locks betting markets - No new bets accepted
- Waits for resolution - Current market resolves before reporting safe to deploy
- Reports status - API returns
safeToDeploy: truewhen ready
- Not in active duel phase (FIGHTING, COUNTDOWN, ANNOUNCEMENT)
- No pending betting markets (or all markets resolved)
- Maintenance mode active
Helper Scripts
CI/CD Integration
The Vast.ai deployment workflow automatically uses maintenance mode:- Prevents data loss during deployments
- Avoids market inconsistency
- Ensures clean duel cycle boundaries
- No interrupted streams or broken markets
AssetForge Environment
Website Environment
Port Allocation
All services have unique default ports:Zero-Config Development
Default values work out of the box for local development:.env files when:
- Using Privy authentication
- Connecting to external database
- Deploying to production
- Running AI agents
Debug Controls
FPS Debug Panel
Toggle the FPS debug panel with:- F5 (matches Minecraft’s debug screen)
- Backslash (\) (alternative keybind)
- FPS (frames per second)
- Frame time (ms)
- Memory usage
- Entity count
- Network stats
The F5 keybind was added to match Minecraft’s familiar debug screen shortcut.
Privy Configuration
- Create account at dashboard.privy.io
- Create a new app
- Copy App ID and App Secret
- Set in both client and server
.envfiles
Without Privy, the game runs in anonymous mode with temporary identities.
Security Updates
Dependency Vulnerability Fixes (commit a390b79)
Resolved 14 of 16 npm audit vulnerabilities in February 2026: Playwright (high severity):bigint-buffer: No patched version available upstreamelliptic: No patched version available upstream
ESLint ajv Compatibility (commit b344d9e)
Fixed ESLint crash caused by forcing ajv@8 on @eslint/eslintrc: Problem:- Forcing
ajv>=8.18.0override caused TypeError crash - @eslint/eslintrc requires ajv@6 for JSON Schema Draft-04 support
- ajv@8 removed Draft-04 support, breaking ESLint initialization
- ESLint now works correctly
- Security fix for ajv (GHSA-2g4f-4pwh-qvx6) still applied where compatible
- @eslint/eslintrc uses ajv@6 as required
Content Security Policy
CSP Headers
The client includes Content Security Policy headers to mitigate XSS attacks:'unsafe-inline'is required for Privy SDK (injects inline styles for modals)'unsafe-eval'is required for Privy SDK (uses eval for authentication flows)report-urisends CSP violations to the server for monitoring- Consider migrating to CSP nonces when Privy SDK adds support
CSP violations are throttled and reported to
/api/csp-report for security monitoring.Dependency Versions
Recent dependency updates (February 2026):TypeScript Ecosystem
Three.js and Graphics
ElizaOS
Development Tools
UI Libraries
Validation and Utilities
Blockchain
All dependency updates were merged via automated Dependabot PRs in commits 7a60135e through 55c57ed5.
GitHub Actions
The repository includes automated workflows for code quality and documentation:Claude Code Review
Automatically reviews pull requests for bugs and code quality issues:- Automated code review on every PR
- Checks for bugs and CLAUDE.md compliance
- Posts review comments directly on PRs
Claude PR Assistant
Responds to@claude mentions in issues and PRs:
- Comment
@claudein any issue or PR - Claude will respond with code suggestions
- Can read CI results and provide context-aware help
Documentation Updates
Automatically updates documentation when manifests change:- Triggers on pushes to main branch
- Analyzes recent commits for manifest changes
- Creates PRs with documentation updates