Development and deployment
Requirements#
- Python 3.12 or newer on Linux. The scoring and media workers use POSIX resource limits.
- Node.js 22 or newer and npm.
- FFmpeg/ffprobe for the optional separate video worker.
- A server-side Monad RPC endpoint for live reads and financial preflight. Trace-capable RPC is required to verify wrapped smart-account execution.
The main client is native JavaScript, not a Next.js application. The server owns API, session and media delivery. The optional Privy bridge is the separate React bundle under auth-client/.
On this page
Installation#
python3 -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip==26.2
pip install -r requirements.txt
npm ci
npm run build
npm run build:authnpm run build compiles both Solidity groups and produces runtime contract artifacts, then bundles the main JS/CSS with a content-addressed manifest. Compiler 0.8.28, optimizer 100, via-IR and Shanghai target are explicit. Test artifacts include mock contracts; runtime manifests contain only Rally contracts.
Generated bytecode and browser bundles are ignored by Git and built from the included source/lockfiles. The auth bridge uses its own lockfile and generates a versioned entry module plus a validated manifest. No environment secret is injected into browser bundles by these scripts.
Configuration#
Copy .env.example to an untracked .env and load it into the process environment:
set -a
. ./.env
set +a
python3 live_server.pyThe default loopback origin is http://127.0.0.1:4186. The state directory is created privately on first startup. It contains databases, media and private integration mappings and must never be served as a static directory or committed.
| Variable | Role |
|---|---|
RALLY_PORT | Loopback HTTP port |
RALLY_PUBLIC_ORIGIN | Exact external origin used for cookies, OAuth audience and redirects |
RALLY_STATE_DIR | Durable private state directory |
RALLY_RPC_URL | Server-side Monad JSON-RPC endpoint; authenticated URLs stay private |
RALLY_COMPAT_ORIGINS | Explicit comma-separated additional origins, when genuinely needed |
RALLY_PRIVY_APP_ID, RALLY_PRIVY_CLIENT_ID, RALLY_PRIVY_ANDROID_CLIENT_ID | Optional public Privy application, web client and Android client configuration |
RALLY_COMMUNITY_FACTORY | Independently verified compatible deployed factory address |
RALLY_COMMUNITY_DEPLOYER | Optional authorized public deployment address, with no server signing key |
RALLY_AGENT_BRIDGE_CONFIG | Private pre-existing owner/address/origin pairing file |
RALLY_MM_CLI, RALLY_MM_RUNTIME, RALLY_MM_PLUGIN_ROOT, RALLY_MM_WORKDIR | Optional official CLI identity adapter paths |
An empty factory configuration leaves the custom launch path unavailable until a compatible deployment is configured or independently activated. It does not silently deploy or send funds. A private wallet pairing is optional and absent from this repository.
Privy login requires a separately configured application and allowed origin, enabled authentication methods and the required identity-token data. The backend verifies public signing keys; no Privy secret is hardcoded into source.
Workers#
Run the media worker separately with the same private state path and a minimal environment:
python3 media_worker.pyThe web service starts bounded market/reconciliation/background-image threads. community_keeper.py supplies community-state observation; it is not evidence of a funded autonomous signing service. agent_wallet_worker.py is optional and identity-only; it must use an already authenticated official CLI and a private approved pairing. Do not run it with arbitrary wallet material or broaden its allowed commands.
HTTPS deployment#
Run the Python process as an unprivileged service behind a TLS reverse proxy. Keep the service bound to loopback and set RALLY_PUBLIC_ORIGIN to the externally reachable HTTPS origin. Forward the observed host and client address; do not trust arbitrary client-supplied forwarded headers.
Allow streaming responses without buffering and support controlled media byte ranges. Keep HTML/API authorization-aware responses uncached and public versioned assets immutable. Optional CDN delivery has a deployment-specific allowed origin in live_server.py; a self-hosted deployment can omit it or explicitly adapt that validation to its own controlled CDN. Merely pointing the frontend at a static host does not deploy the backend or preserve SQLite/media state.
Persist the state volume, provide database/media backups, and reload a new build only after verifying its source/output manifest. External venue deployment pins fail closed when code or proxy identity changes; review them against current official interfaces before replacing them.
Tests#
npm test
npm run test:contracts
npm run test:auth-dependencies
npm run audit
pip-audit -r requirements.txt
npx playwright install chromium
npm run test:uiscripts/test.py creates separate disposable state per Python suite. tests/community.mjs and tests/nad-revenue.mjs start disposable Anvil processes bound to loopback on dynamically allocated ports, with no fork URL and explicit mock venues. tests/browser.mjs starts the actual HTTP handlers with fresh state and providers disabled; it checks representative pages at three sizes and rejects network writes.
Install pip-audit in a separate verification environment for the Python dependency check. npm run audit checks both complete lockfiles, including development dependencies, and fails on any reported advisory. Wallet dependency compatibility tests do not connect accounts or request signatures.
For an already installed browser, set RALLY_CHROME_PATH; for a Python virtualenv, activate it or set RALLY_PYTHON for the browser harness. Do not point tests at production state.
The optional GitHub workflow is manually triggered and targets a dedicated disposable Linux runner labelled rally-isolated. No runner registration or production credentials are included. Public pull requests do not automatically execute on a self-hosted host. Install/configure a suitably isolated runner before using that workflow; the command-line checks work independently.