Environment Setup (Developers)
🧑💻 1. Prerequisites
To work with the OmniSocial codebase locally, make sure you have the following installed:
Node.js v18+ (https://nodejs.org)
Yarn (https://yarnpkg.com) or npm
Git (https://git-scm.com)
Hardhat (for contract development)
Foundry (optional, for Solidity-based testing)
The Graph CLI (optional, for subgraph development)
Docker (optional, for running local nodes or IPFS)
📦 2. Clone the Repository
git clone https://github.com/OmniSocialBlockchain/dapp.git
cd dapp📁 3. Install Dependencies
Install all project dependencies using Yarn (preferred) or npm:
yarn install
# or
npm install⚙️ 4. Configure Environment Variables
Copy the example environment file and fill in the required variables:
cp .env.example .envSet your PRIVATE_KEY, RPC URLs, and any API keys (e.g. IPFS, Alchemy).
For local testnets or custom deployments, you may configure a localhost network in hardhat.config.ts.
🔧 5. Compile Smart Contracts
Compile the smart contracts:
yarn hardhat compileYou can also test them:
yarn hardhat test🚀 6. Run the Local Frontend
yarn devThen open http://localhost:3000 in your browser.
The app connects to testnets or local networks based on your wallet and .env config.
🧪 7. Deploy Contracts (Optional)
If you want to deploy contracts locally or to a testnet:
yarn hardhat run scripts/deploy.ts --network <network-name>Supported networks are configured in hardhat.config.ts (e.g., localhost, polygonZkEvmTestnet).
🔍 8. Optional Tools & Features
🧠 Subgraph Development: Setup The Graph locally or deploy to a hosted service to index on-chain events. Subgraph config is in
/subgraph.🧰 TypeChain Support: Auto-generates TypeScript types from Solidity contracts for safer integration.
🧪 Simulated Transaction Testing: Use
useTransactionSimulation.tsand the security hooks infeatures/security/.
✅ 9. Verify Setup
After setup, you should be able to:
Connect your wallet to the app
Mint a test Persona
View contract interactions in the browser console
Run unit tests for contracts
Explore subgraph data (if enabled)
Last updated
Was this helpful?
