Skip to main content

Overview

Prophet has three codebases: Solidity contracts (Foundry), TypeScript agents (Node.js), and a Next.js frontend. This guide walks through setting up all three from scratch.

System Requirements

Verify your setup:

Clone and Install


Environment Variables

contracts/.env

Only needed if you are deploying contracts. Skip if using the live deployment.

agent/.env

frontendV2/.env.local


Run the Test Suite


Run 0G Diagnostics

If test:storage fails: check that OG_INDEXER_URL points to the turbo indexer. If test:compute fails:
  • Check that COMPUTE_PROVIDER_ADDRESS is set correctly
  • Verify your oracle wallet has enough 0G tokens (the broker needs to submit billing transactions)
  • Testnet inference can time out under load — retry

Start the Frontend

Type check without running:
Build for production:

Start the Agents


Troubleshooting

You are hitting the standard indexer. Change OG_INDEXER_URL to:
The standard indexer is unreliable on testnet. Always use turbo.
Testnet inference via Qwen 2.5 7B takes 45–90 seconds normally. It can hang if the provider is overloaded. The agent has a timeout and retry — wait for the retry, or restart the agent. This is a testnet reliability issue, not a code bug.
Run forge install from the contracts/ directory to download OpenZeppelin and forge-std dependencies.
Both agent wallets need 0G tokens. Get them from faucet.0g.ai. The oracle wallet also needs to top up the 0G Compute billing ledger.
All USDT uses 6 decimal places. If you see amounts 10^12 times too large, you are passing amounts formatted for 18 decimals. Always use ethers.parseUnits("100", 6) — never ethers.parseEther("100").
Check that NEXT_PUBLIC_PROPHET_FACTORY_ADDRESS in frontendV2/.env.local matches the deployed factory address. If using a fresh deployment, ensure the market-maker has seeded at least one market.
Ensure MetaMask is connected to 0G Galileo (Chain ID 16602). The frontend will prompt you to switch if you are on the wrong network, but sometimes the prompt is missed.
On testnet, the Qwen provider may not always pass TEE attestation under high load. Set COMPUTE_REQUIRE_TEE=0 for local development. Enable it for production/mainnet only.

Next Steps

Contract Development

Foundry commands, test patterns, and deployment guide

Agent Development

How to extend the oracle and market-maker agents

Frontend Development

Next.js structure, hooks, and API routes

Deployment

Deploy a fresh contract instance to 0G Galileo