Running a Local Dev Environment
This guide walks you through spinning up the entire OmniSocial stack locally for development.
It includes smart contract deployment, subgraph indexing, and launching the frontend interface with live data.
🛠 Prerequisites
Make sure you have the following installed:
Node.js ≥ v18
Yarn (or npm)
Docker & Docker Compose
Hardhat
Graph CLI (
npm install -g @graphprotocol/graph-cli)Foundry (optional, for contract fuzzing/tests)
📁 Project Structure
Assuming the monorepo layout:
omnisocial/
├── contracts/ # Hardhat smart contracts
├── subgraph/ # The Graph subgraph definitions
├── apps/
│ └── frontend/ # Next.js frontend app
├── scripts/ # Deployment & helper scripts
└── .env.example # Environment variables template⚙️ Step 1: Launch Hardhat Node
Start a local blockchain with in-memory state.
cd contracts
npx hardhat nodeKeep this running in a dedicated terminal window.
🚀 Step 2: Deploy Contracts
In a new terminal, deploy to the local network:
npx hardhat run scripts/deployAll.ts --network localhost✅ This will deploy:
OmniWalletFactoryPersonaNFTRepModuleDAOFactorySupporting modules (e.g., Recovery, Tip, EditionDrop)
🔍 Step 3: Run The Graph Indexer
Spin up the Graph Node stack:
cd subgraph
docker-compose upThen generate and deploy the subgraph:
yarn codegen
yarn build
yarn create-local
yarn deploy-localMake sure your subgraph is pointing to http://localhost:8545 and syncing properly.
💻 Step 4: Launch Frontend
Start the Next.js frontend:
cd apps/frontend
cp .env.example .env.local
# Fill in addresses, subgraph URL, etc.
yarn install
yarn devThen open your browser to:
http://localhost:3000📈 Test Workflow
Create a wallet via the UI or script
Mint a PersonaNFT
Post or tip content
Create a DAO
Vote on proposals
View results via subgraph queries
🧪 Optional: Run Tests
cd contracts
npx hardhat test🧰 Troubleshooting Tips
Graph node doesn't start
Check Docker memory limit; it needs ~2–4 GB
Subgraph not indexing
Ensure contracts are deployed and addresses match in config
Frontend errors on GraphQL requests
Double-check .env.local for correct subgraph endpoint
Last updated
Was this helpful?
