Installation
Set up CredDAO for local development or production deployment.
System Requirements
| Requirement | Minimum | Recommended |
|---|---|---|
| Node.js | 20.x | 22.x |
| npm | 10.x | 10.x |
| Rust | 1.70+ | 1.75+ |
| Solana CLI | 1.17+ | 1.18+ |
| Anchor | 0.29+ | 0.30+ |
| PostgreSQL | 15.x | 16.x |
Clone the Repository
git clone https://github.com/creddao/creddao.git
cd creddaoInstall Dependencies
Install all workspace dependencies:
npm installEnvironment Setup
Create environment files for each service:
Frontend
Create frontend/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:3001
NEXT_PUBLIC_SOLANA_NETWORK=devnet
NEXT_PUBLIC_PROGRAM_ID=CreDDAo111111111111111111111111111111111111API
Create api/.env:
DATABASE_URL="postgresql://user:password@localhost:5432/creddao"
SOLANA_RPC_URL="https://api.devnet.solana.com"
FRONTEND_URL="http://localhost:3000"
PORT=3001SDK
The SDK uses environment variables at build time:
SOLANA_NETWORK=devnet
PROGRAM_ID=CreDDAo111111111111111111111111111111111111Database Setup
Initialize the PostgreSQL database:
cd api
npx prisma generate
npx prisma migrate devBuild Smart Contracts
Build the Anchor programs:
anchor buildBuilding smart contracts requires the Solana toolchain and Anchor CLI to be properly installed. See the Solana documentation for installation instructions.
Deploy to Localnet
Start a local Solana validator:
solana-test-validatorDeploy the programs:
anchor deployStart Development Servers
Run all services in development mode:
# Terminal 1: API
cd api && npm run dev
# Terminal 2: Frontend
cd frontend && npm run dev
# Terminal 3: SDK (watch mode)
cd sdk && npm run devVerify Installation
Check that everything is running:
# API health check
curl http://localhost:3001/health
# Frontend
open http://localhost:3000Production Deployment
Frontend (Vercel)
cd frontend
vercel --prodAPI (Docker)
docker build -t creddao-api ./api
docker run -p 3001:3001 creddao-apiSmart Contracts (Mainnet)
solana config set --url mainnet-beta
anchor deploy --provider.cluster mainnetDeploying to mainnet requires SOL for rent-exempt accounts and transaction fees. Ensure you have sufficient funds in your deployer wallet.
Troubleshooting
Common Issues
Anchor build fails
Ensure you have the correct Solana CLI version:
solana-install init 1.18.0
anchor --version # Should show 0.30.xDatabase connection errors
Verify PostgreSQL is running and the connection string is correct:
psql -h localhost -U user -d creddaoWallet adapter not connecting
Clear browser storage and ensure you’re on the correct network:
solana config get
# Should show the network you're using