Deployment Guide
Step-by-step instructions for deploying Oracle AI.
Local Development
Prerequisites
- Node.js 18+
- npm 9+
- Git
Step 1: Clone and Install
git clone https://github.com/your-org/oracleai.git
cd oracleai
npm install
Step 2: Start Local Blockchain
cd contracts
npx hardhat node
This starts a local node at http://127.0.0.1:8545.
Step 3: Deploy Contracts
In a new terminal:
cd contracts
npx hardhat run scripts/deploy.ts --network localhost
Save the output addresses!
Step 4: Configure Frontend
cd frontend
cp .env.example .env.local
Update contract addresses in src/config/contracts.ts.
Step 5: Start Frontend
npm run dev
Step 6: Configure MetaMask
-
Add network:
- RPC URL: http://127.0.0.1:8545
- Chain ID: 31337
-
Import test account (first Hardhat account)
Testnet Deployment (Sepolia)
Step 1: Get Testnet ETH
Visit sepoliafaucet.com
Step 2: Configure Hardhat
// hardhat.config.ts
networks: {
sepolia: {
url: process.env.SEPOLIA_RPC_URL,
accounts: [process.env.DEPLOYER_PRIVATE_KEY]
}
}
Step 3: Deploy
npx hardhat run scripts/deploy.ts --network sepolia
Step 4: Verify Contracts
npx hardhat verify --network sepolia <CONTRACT_ADDRESS>
Production Deployment
Pre-Deployment Checklist
- Smart contract audit completed
- All tests passing
- Multisig wallet set up
- Monitoring configured
- Documentation complete
- ETH for liquidity prepared
- ORACLE allocation for liquidity decided
Contract Deployment
- Use hardware wallet
- Deploy during low gas periods
- Verify all contracts on Etherscan
- Transfer ownership to multisig
Uniswap V3 Liquidity Setup
After deploying contracts, set up DEX trading:
# 1. Add liquidity to Uniswap V3
npm run liquidity:mainnet -- --oracle 100000000 --eth 10
# 2. Enable trading (after liquidity is added)
npm run trading:enable:mainnet
Liquidity Options:
| Flag | Description | Default |
|---|---|---|
| --oracle | ORACLE tokens to add | 100,000,000 |
| --eth | ETH to pair with | 10 |
| --fee | Fee tier (500, 3000, 10000) | 3000 (0.3%) |
Important: Trading is disabled by default. Only enable after liquidity is added.
Frontend Deployment
cd frontend
npm run build
vercel --prod
Backend Deployment
cd backend
npm run build
pm2 start dist/index.js
Resolver Deployment
pm2 start dist/run-resolver.js --name "resolver"
Environment Variables
Frontend (.env.local)
NEXT_PUBLIC_WC_PROJECT_ID=xxx
NEXT_PUBLIC_CHAIN_ID=1
Backend (.env)
PORT=3001
RPC_URL=https://mainnet.infura.io/v3/xxx
MARKET_FACTORY_ADDRESS=0x...
RESOLVER_REGISTRY_ADDRESS=0x...
ORACLE_TOKEN_ADDRESS=0x...
RESOLUTION_ENGINE_ADDRESS=0x...
Resolver (.env)
RESOLVER_PRIVATE_KEY=0x...
AI_API_KEY=sk-...
AI_PROVIDER=openai
STAKE_PERCENTAGE=10
POLL_INTERVAL=60
Was this page helpful?