Prerequisites, installation, and configuration for local development.
Prerequisites
- Node.js >= 20
- pnpm (package manager)
- Foundry (
curl -L https://foundry.paradigm.xyz | bash)
Installation
# Clone the repository
git clone https://github.com/your-org/meridian.git
cd meridian
# Install dependencies
pnpm install
Building
# Build contracts
cd packages/contracts
forge build
forge test
# Build agent
cd packages/agent
pnpm build
# Run web UI (development)
cd packages/web
pnpm dev
Environment Variables
Agent Server (packages/agent/.env)
| Variable | Description |
|---|
PRIVATE_KEY | Deployer/agent wallet private key |
BASE_SEPOLIA_RPC_URL | Base Sepolia RPC endpoint |
BASE_MAINNET_RPC_URL | Base Mainnet RPC endpoint (for swaps) |
OG_TESTNET_RPC | 0G Galileo testnet RPC |
FACTORY_ADDRESS | Deployed QuantumMarketFactory address |
HOOK_ADDRESS | Deployed QuantumMarketHook address |
REGISTRY_ADDRESS | Deployed AgentRegistry address |
UNISWAP_API_KEY | API key from developers.uniswap.org |
FACILITATOR_URL | x402 facilitator URL |
TREASURY_ADDRESS | Base wallet for x402 fee collection |
Web Frontend (packages/web/.env.local)
| Variable | Description |
|---|
NEXT_PUBLIC_FACTORY_ADDRESS | QuantumMarketFactory address |
NEXT_PUBLIC_HOOK_ADDRESS | QuantumMarketHook address |
NEXT_PUBLIC_REGISTRY_ADDRESS | AgentRegistry address |
NEXT_PUBLIC_AGENT_URL | Agent server URL (default: http://localhost:4021) |
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID | WalletConnect project ID |
Running Tests
# Contract tests (26 tests across 4 suites)
cd packages/contracts
forge test -vv
# Test suites:
# - QuantumMarketFactoryTest
# - LSMRTest
# - AgentRegistryTest
# - QuantumMarketLifecycleTest