create-datadao
v1.1.4
Published
A CLI tool to generate and deploy DataDAOs on the Vana network
Maintainers
Readme
create-datadao
Launch a DataDAO on Vana in minutes. This CLI tool automates the entire DataDAO creation workflow—from smart contracts to data validation.
Quick Start
Setup Modes
Quick Setup (5 minutes):
create-datadao create my-datadao
# Choose "Quick Setup" when prompted- Auto-generates wallet and uses smart defaults
- Minimal prompts with automated flow
- Perfect for development and testing
- Skips external service setup initially
Full Setup (30-45 minutes):
create-datadao create my-datadao
# Choose "Full Setup" when prompted- Complete configuration with explanations
- Step-by-step guidance with confirmations
- Sets up all external services (Pinata, Google OAuth)
- Production-ready deployment
Both modes execute the same underlying deployment steps - the difference is in user interaction. Quick mode automates decisions while Normal mode explains and asks for confirmation at each step.
Basic Usage
npx create-datadao my-first-daoFollow the prompts. You'll have a DataDAO deployed in ~15 minutes.
What This Tool Does
- Deploys smart contracts - Token, liquidity pool, and vesting contracts on Vana testnet
- Registers your DataDAO - Makes it discoverable on the network
- Sets up data validation - Configures proof-of-contribution and data refinement
- Creates a UI - Deploys a contribution interface for your users
Prerequisites
Required:
- Node.js 18+
- GitHub account (for proof/refiner repos)
- Pinata account for IPFS storage (https://pinata.cloud)
- Google OAuth credentials (https://console.cloud.google.com)
- GitHub CLI for automated repository setup (https://cli.github.com)
Installation
# Global installation
npm install -g create-datadao
# Or use npx (recommended)
npx create-datadaoCommands
Create a New DataDAO
create-datadao my-datadaoOptions:
--config <path>- Use a JSON configuration file--quick- Skip optional features for faster setup
Check Status
create-datadao status # Lists all projects
create-datadao status my-dao # Specific project statusDeploy Individual Components
create-datadao deploy:contracts [project-path]
create-datadao register [project-path]
create-datadao ui [project-path]Configuration
Interactive Mode (Default)
The CLI guides you through setup:
? DataDAO name: Weather Data Collective
? Token name: Weather Token
? Token symbol: WEATHER
? Private key (or press enter to generate):Config File Mode
Create a config file for automated deployment:
{
"projectName": "weather-dao",
"privateKey": "0x...",
"dlpName": "Weather Data Collective",
"dlpToken": "WEATHER",
"tokenName": "Weather Token",
"tokenSymbol": "WEATHER",
"githubUsername": "your-username",
"googleClientId": "your-client-id",
"googleClientSecret": "your-secret",
"pinataApiKey": "your-key",
"pinataApiSecret": "your-secret"
}Deploy with:
create-datadao --config weather-config.jsonProject Structure
After creation, your project contains:
my-datadao/
├── contracts/ # Smart contract code
├── proof/ # Data validation logic
├── refiner/ # Data transformation pipeline
├── ui/ # Contribution interface
├── scripts/ # Deployment scripts
└── deployment.json # Deployment stateDeployment Flow
Contract Deployment (~3 minutes)
- Deploys token contract
- Deploys DataLiquidityPool proxy
- Sets up vesting wallet
DataDAO Registration (~1 minute)
- Registers with Vana network
- Requires 1 VANA fee
- Returns unique dlpId
Proof & Refiner Setup (~5 minutes)
- Creates GitHub repositories
- Configures validation rules
- Sets up data pipeline
UI Deployment (~5 minutes)
- Deploys to Vercel
- Configures authentication
- Enables data contributions
Common Issues
Insufficient Funds
Error: Insufficient funds for transactionFix: Get testnet VANA from https://faucet.vana.org
Registration Failed
Error: Transaction revertedFix: Ensure contracts deployed successfully. Run create-datadao status to check.
GitHub Repository Exists
Warning: Repository already existsFix: The tool continues with existing repos. No action needed.
Recovery
If deployment fails midway:
create-datadao status my-dao # Check current state
npm run deploy:contracts # Resume from failure pointAll progress is saved in deployment.json.
Advanced Usage
Custom Templates
Fork template repositories before creation:
- Proof: https://github.com/vana-com/dlp-proof-template
- Refiner: https://github.com/vana-com/vana-data-refinement-template
Manual Deployment
Each step can be run independently:
cd my-datadao
npm run deploy:contracts
npm run register:datadao
npm run deploy:proof
npm run deploy:refiner
npm run deploy:uiState Management
View deployment state:
cat deployment.json | jqKey fields:
tokenAddress- Your DataDAO tokenproxyAddress- DataLiquidityPool addressdlpId- Network registration IDstate- Deployment progress
Environment Variables
Optional configuration via .env:
PRIVATE_KEY=0x...
GITHUB_USERNAME=your-username
PINATA_API_KEY=your-key
PINATA_API_SECRET=your-secret
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-secretNetwork Information
Vana Moksha Testnet
- Chain ID: 14800
- RPC: https://rpc.moksha.vana.org
- Explorer: https://moksha.vanascan.io
- Faucet: https://faucet.vana.org
Key Contracts
- DataRegistry:
0xd0fD0cFA96a01bEc1F3c26d9D0Eb0F20fc2BB30C
Support
- Issues: https://github.com/vana-com/create-datadao/issues
- Docs: https://docs.vana.org
- Discord: https://discord.gg/vanabuilders
Contributing
We welcome contributions! Whether you're fixing bugs, adding features, or improving documentation, your help makes this project better.
Getting Started
Prerequisites for Development
- Node.js 18+ and npm
- Git and GitHub account
- GitHub CLI (recommended):
brew install ghornpm install -g @github/cli - Basic familiarity with CLI tools and Node.js
Development Setup
Fork and Clone
# Fork the repository on GitHub first, then: git clone https://github.com/YOUR_USERNAME/create-datadao cd create-datadaoInstall Dependencies
npm installLink for Local Testing
npm link # Now you can test with: create-datadao create test-projectVerify Setup
# Test the CLI works create-datadao --help # Run the test suite npm test
Project Structure
create-datadao/
├── bin/
│ └── create-datadao.js # CLI entry point
├── lib/
│ └── templates/ # Script templates for generated projects
│ ├── config.js # Configuration management
│ └── formatting.js # String formatting helpers
│ ├── generator.js # Project template generation
│ ├── index.js # Core generator logic
│ ├── wallet.js # Blockchain wallet utilities
│ ├── validation.js # Input validation
├── __tests__/
│ ├── lib/ # Unit tests
│ ├── integration/ # Integration tests
│ └── production/ # End-to-end tests
└── package.jsonTesting
We use Jest for testing with multiple test suites:
# Run all tests
npm test
# Unit tests only (fast)
npm run test:unit
# Integration tests (medium speed)
npm run test:integration
# Production tests (slow, requires network)
npm run test:production
# Watch mode for development
npm run test:watch
# Coverage report
npm run test:coverageTesting Your Changes
Unit Tests: Test individual functions in isolation
npm run test:unitIntegration Tests: Test CLI commands end-to-end
npm run test:integrationManual Testing: Test the full user experience
create-datadao create test-dao create-datadao status test-dao
Making Changes
Code Style
- Use consistent formatting (we recommend Prettier)
- Follow existing naming conventions
- Add JSDoc comments for public functions
- Keep functions focused and testable
Adding Features
Create a branch
git checkout -b feature/your-feature-nameWrite tests first (TDD approach recommended)
# Add tests in __tests__/lib/ for new utilities # Add integration tests in __tests__/integration/Implement the feature
- Follow existing patterns in the codebase
- Update CLI help text if adding commands
- Update README if user-facing
Test thoroughly
npm test npm run test:coverage # Ensure good coverage
Bug Fixes
- Reproduce the bug with a test case
- Fix the issue while keeping tests passing
- Add regression tests to prevent future occurrences
Submitting Changes
Pull Request Process
Ensure tests pass
npm testUpdate documentation if needed
- README.md for user-facing changes
- JSDoc comments for code changes
- Add examples for new features
Create Pull Request
- Use a clear, descriptive title
- Reference any related issues
- Describe what changed and why
- Include testing instructions
PR Template
## What Changed Brief description of your changes ## Why Explanation of the problem this solves ## Testing - [ ] Unit tests pass - [ ] Integration tests pass - [ ] Manually tested with: `create-datadao create test-project` ## Checklist - [ ] Documentation updated - [ ] Tests added/updated - [ ] No breaking changes (or clearly marked)
Reporting Issues
Bug Reports
Include:
- Steps to reproduce
- Expected vs actual behavior
- Environment details (Node version, OS)
- CLI command and output
- Error logs if any
Feature Requests
Include:
- Use case description
- Proposed solution
- Alternative approaches considered
- Willingness to implement
Development Tips
Testing Changes Locally
# Link your development version
npm link
# Test create command
create-datadao create test-project
# Test status command
create-datadao status test-project
# Clean up test projects
rm -rf test-project
# Unlink when done
npm unlink -g create-datadaoDebugging
# Add debug logs to your code
console.log(chalk.gray('DEBUG:'), 'variable value:', variable);
# Run with verbose output
DEBUG=* create-datadao create test-projectCommon Gotchas
- File paths: Use
path.join()for cross-platform compatibility - Async operations: Always handle Promise rejections
- User input: Validate and sanitize all inputs
- Error messages: Make them actionable and user-friendly
Release Process
We use semantic-release for automated releases:
- fix: Patch version (0.0.1)
- feat: Minor version (0.1.0)
- BREAKING CHANGE: Major version (1.0.0)
Use conventional commits:
git commit -m "feat: add support for custom templates"
git commit -m "fix: resolve Windows path issues"
git commit -m "docs: update installation instructions"Need Help?
- Questions: Open a discussion on GitHub
- Chat: Join our Discord community
- Issues: Search existing issues before creating new ones
Thank you for contributing to create-datadao! 🚀
License
MIT
