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.
Keep this running in a dedicated terminal window.
π Step 2: Deploy Contracts
In a new terminal, deploy to the local network:
β This will deploy:
OmniWalletFactoryPersonaNFTRepModuleDAOFactorySupporting modules (e.g., Recovery, Tip, EditionDrop)
π Step 3: Run The Graph Indexer
Spin up the Graph Node stack:
Then generate and deploy the subgraph:
Make sure your subgraph is pointing to http://localhost:8545 and syncing properly.
π» Step 4: Launch Frontend
Start the Next.js frontend:
Then open your browser to:
π 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
π§° 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?
