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 node
Keep 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:
OmniWalletFactory
PersonaNFT
RepModule
DAOFactory
Supporting modules (e.g., Recovery, Tip, EditionDrop)
π Step 3: Run The Graph Indexer
Spin up the Graph Node stack:
cd subgraph
docker-compose up
Then generate and deploy the subgraph:
yarn codegen
yarn build
yarn create-local
yarn deploy-local
Make 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 dev
Then 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?