This guide covers the full local development flow for Flashix, from environment preparation to running the demo UI and supporting services.
- macOS
- Linux
- WSL2 on Windows
- Python 3.12 or higher
- Node.js 18 or 20
- Git
Make sure the following commands work on your machine:
python3 --version
node --version
npm --version
git --versionIf Python or Node is missing, install them before continuing. Flashix assumes a modern Python runtime for the backend and a current Node runtime for the frontend and scripts.
agent/contains the consolidated FastAPI backend, execution engine, risk logic, settlement helpers, and pipeline tracing services.frontend/contains the React application with the dashboard, opportunities queue, execution view, risk center, settlement view, market data screen, and compute proof page.compute/contains TEE-related inference, signature, and validation helpers.contracts/contains the Hardhat workspace and deployment artifacts for the 0G contracts.scripts/contains bootstrap, health-check, test, and deployment helpers.docs/contains the operational and architectural documentation.mempool-listener/contains the live or simulated opportunity ingestion pipeline.
Flashix commonly needs four classes of configuration:
- Backend and agent runtime settings.
- Compute and TEE credentials.
- Market data and mempool provider settings.
- Contract deployment and verification keys.
Typical variables include:
GEMINI_API_KEYTEE_MODETEE_ENDPOINTTEE_API_KEYTEE_ATTESTATION_CERT_PATHMEMPOOL_MODEMEMPOOL_PROVIDERMEMPOOL_WEBSOCKET_URLMEMPOOL_API_KEYRPC_URL
Use the provider- and environment-specific docs when you need the exact values for each of those groups.
git clone https://github.com/swanandi-bhende/flashix.git
cd flashixpython3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pipInstall the runtime dependencies first, then the development extras if you plan to run tests or local tooling.
pip install -r requirements.txt
pip install -r requirements-dev.txtcd frontend
npm install
cd ..If you want to compile, test, or deploy the Hardhat contracts, install the contract workspace dependencies as well.
cd contracts
npm install
cd ..Flashix expects local configuration via .env-style files. Keep secrets out of version control.
Recommended files:
- Root
.envfor backend and agent runtime settings. frontend/.envfor frontend API base URLs if needed.contracts/.envfor Hardhat deployment credentials and explorer keys.
Useful values include:
PERSISTENCE_URLRPC_URLTEE_SIGNER_ADDRESSDEPLOYER_PRIVATE_KEYBLOCK_EXPLORER_API_KEY
If you are using live 0G Compute access, also store:
TEE_ENDPOINTTEE_API_KEYTEE_ATTESTATION_CERT_PATHTEE_MODE
If you are using the mempool pipeline, also store:
MEMPOOL_MODEMEMPOOL_PROVIDERMEMPOOL_WEBSOCKET_URLMEMPOOL_API_KEYMEMPOOL_SUBSCRIPTION_TOPICS
The exact values depend on whether you are running locally, deploying to a testnet, or connecting to the public demo.
Start the support services in separate terminals.
python3 scripts/tee_service.pyThis service persists demo artifacts such as overrides, exports, and replay evidence.
source .venv/bin/activate
python -m agent.backend_appThe backend exposes the consolidated API that powers the UI pages and demo actions.
npm --prefix frontend run devVite prints the local URL after startup. In most environments this is http://localhost:5173.
npm run mempool:listenUse this when you want to drive the live opportunity pipeline rather than only the seeded demo flow.
If you are using the remote 0G Compute provider instead of the local simulation path, confirm the provider secret and attestation cert are present before starting the agent. The compute docs contain the provisioning flow and security notes.
Run these checks after installation:
./scripts/health_check.sh
./scripts/run_tests.shIf you are validating the compute or agent reasoning path, also review the replay and signature verification docs before changing signal logic.
For contract verification:
cd contracts
npx hardhat compile
npx hardhat test- Use the deployed demo at https://flashix-mu.vercel.app/ if you only need the walkthrough and proof artifacts.
- Use the local app when you need to inspect logs, adjust environment variables, or validate changes in source.
- Keep private keys and API secrets local. Do not commit them.
Check that the backend is running and that the frontend is pointed at the correct API base URL.
Ensure scripts/tee_service.py is running before you generate exports from Settlement.
Verify that Node dependencies are installed in contracts/ and that your Hardhat network configuration matches the target chain.
Confirm that your virtual environment is active and that you installed both requirements.txt and requirements-dev.txt.
Confirm TEE_MODE=0g-compute, the endpoint is reachable, and the attestation certificate path is valid.
Confirm the provider credentials, WebSocket URL, and subscription topics are correct, then restart the listener.
Once the environment is working, open Demo.md and follow the guided walkthrough page by page.