dkg-cli
v1.0.40
Published
A CLI tool to easily install, configure, update, and manage OriginTrail Decentralized Knowledge Graph (DKG) Nodes.
Maintainers
Readme
DKG Node CLI
CLI tool to install, configure, and manage OriginTrail DKG Nodes.
Getting Started
The DKG CLI makes it easy to get your DKG Node up and running. It automates the entire setup process: installing dependencies, setting up databases, generating wallets, configuring your node, and starting services.
What Gets Installed
- DKG Node - AI-powered interface for managing knowledge assets (Web UI + API)
- DKG Engine - Your local DKG engine connected to the OriginTrail network
- Databases - MySQL, Redis, Blazegraph (configured automatically)
System Requirements
- OS: macOS or Linux (Ubuntu 20.04+)
- RAM: 8GB minimum (16GB recommended)
- Storage: 20GB free space
- Node.js: v22 (Download Node.js)
Quick Start
1. Install DKG CLI
npm install -g dkg-cli2. Generate Configuration
Create a project folder and generate configuration with wallets:
mkdir my_dkg_node && cd my_dkg_node
dkg-cli setup-config --testnetThis creates a .env file with:
- Operational wallet - For blockchain operations (requires native token)
- Management wallet - For configuring node parameters (requires native token)
- Publish wallet - For DKG operations (requires TRAC + native token)
- Node configuration and database settings
Network options:
dkg-cli setup-config --testnet --neuroweb # NeuroWeb testnet (default)
dkg-cli setup-config --testnet --base # Base testnet
dkg-cli setup-config --testnet --gnosis # Gnosis testnet
dkg-cli setup-config --mainnet --neuroweb # NeuroWeb mainnet
dkg-cli setup-config --mainnet --base # Base mainnet
dkg-cli setup-config --mainnet --gnosis # Gnosis mainnetNote: DKG Node currently supports single blockchain deployment. Multichain support coming soon.
3. Update Configuration
Edit your .env file to customize settings:
nano .envRequired:
DB_PASSWORD- MySQL root password. If MySQL exists, use its current password. Otherwise, this will be set during installation.
Optional:
NEUROWEB_NODE_NAME- Your node's public name (auto-generated but customizable)- Wallet private keys - You can replace generated wallets with your own
Important: Your .env file contains sensitive data (wallet keys, passwords). Keep it secure and never commit to version control.
4. Fund Your Wallets
DKG Engine requires funded wallets to start. Fund these wallets before installation:
| Blockchain | Operational Wallet | Publish Wallet | |------------|-------------------|----------------| | NeuroWeb | NEURO | NEURO + TRAC | | Base | ETH | ETH + TRAC | | Gnosis | xDAI | xDAI + TRAC |
Get tokens:
- Testnet: https://docs.origintrail.io/useful-resources/test-token-faucet
- Mainnet: https://origintrail.io/technology/trac-token
5. Install DKG Node
Run installation from the directory containing your .env file:
dkg-cli installInstallation takes 10-20 minutes and installs:
- DKG Node →
dkg-node/directory - DKG Engine →
dkg-node/dkg-engine/ - MySQL, Redis, Blazegraph databases
- All dependencies and services
Note for Linux: The installer requests sudo for system packages but installs Node.js packages with your user permissions to prevent ownership issues.
6. Setup LLM Agent
Configure your LLM provider for AI features:
cd dkg-node
dkg-cli agent-setupYou'll be prompted for:
- LLM Provider (OpenAI, Anthropic, Groq, Google GenAI, Mistral AI, xAI)
- API Key
- Model Name
- DKG Environment (must match your setup: testnet or mainnet)
Get API keys:
- OpenAI: https://platform.openai.com/api-keys
- Anthropic: https://console.anthropic.com/
- Groq: https://console.groq.com/keys (free tier available)
- Google GenAI: https://makersuite.google.com/app/apikey
- Mistral AI: https://console.mistral.ai/
- xAI: https://x.ai/
7. Start Development Server
Start DKG Node in development mode:
dkg-cli run-devAccess:
- Web UI: http://localhost:8081
- API Docs: http://localhost:8081/swagger
- DKG Engine: http://localhost:8900
Default credentials:
- Email:
[email protected] - Password:
admin123
Use Ctrl+C to stop the server.
Commands
Service Management
Manage DKG Node services:
dkg-cli start # or: dkg-cli s (start all services)
dkg-cli stop # or: dkg-cli x (stop all services)
dkg-cli restart # or: dkg-cli r (restart all services)
dkg-cli status # or: dkg-cli st (check service status)
# Control specific services (dkg-engine, blazegraph, mysql, dkg-agent)
dkg-cli start dkg-engine # or: dkg-cli s dkg-engine
dkg-cli stop dkg-engine # or: dkg-cli x dkg-engine
dkg-cli restart dkg-engine # or: dkg-cli r dkg-engineService commands can be run from any directory.
Development
Development commands must be run from inside the dkg-node directory:
cd dkg-node
dkg-cli run-dev # or: dkg-cli dev (start dev server on port 8081)
dkg-cli agent-setup # or: dkg-cli as (configure/reconfigure LLM provider)
dkg-cli create-user # Create additional usersCreating users: When prompted, provide:
- Email (valid format required)
- Password
- Permissions (space-separated:
mcp llm blob scope123)
Logs
View and filter service logs:
# Basic usage
dkg-cli logs dkg-engine -f # or: dkg-cli l dkg-engine -f (follow logs)
dkg-cli logs dkg-engine -n 100 # or: dkg-cli l dkg-engine -n 100
dkg-cli logs # or: dkg-cli l (view all services)
# View multiple services
dkg-cli logs dkg-agent,dkg-engine -f # or: dkg-cli l dkg-agent,dkg-engine -f
# Time-based filtering
dkg-cli logs --since "1 hour ago"
dkg-cli logs --since "2023-11-20 10:00"
dkg-cli logs --until "30 minutes ago"
# Search and filter
dkg-cli logs --grep "error" # Search for pattern
dkg-cli logs --level error # Filter by log level
dkg-cli logs --grep "timeout" --context 5
# Export and analysis
dkg-cli logs -o debug.log # Save to file
dkg-cli logs --stats # Show statistics
dkg-cli logs --json # JSON outputUpdates
Keep your CLI up to date:
dkg-cli update --check # or: dkg-cli u --check (check for updates)
dkg-cli update # or: dkg-cli u (update to latest version)Command Aliases
Use short aliases instead of full command names:
| Alias | Full Command | Example |
|-------|-------------|---------|
| sc | setup-config | dkg-cli sc --testnet |
| i | install | dkg-cli i |
| u | update | dkg-cli u --check |
| as | agent-setup | dkg-cli as |
| dev | run-dev | dkg-cli dev |
| s | start | dkg-cli s or dkg-cli s dkg-engine |
| x | stop | dkg-cli x or dkg-cli x dkg-engine |
| r | restart | dkg-cli r or dkg-cli r dkg-engine |
| st | status | dkg-cli st |
| l | logs | dkg-cli l dkg-engine -f |
All aliases work exactly like their full command equivalents.
Troubleshooting
DKG Node Won't Start
Most common cause: LLM not configured.
cd dkg-node
dkg-cli agent-setup # or: dkg-cli as (configure LLM)
dkg-cli run-dev # or: dkg-cli dev (start in dev mode)Or start services:
dkg-cli start # or: dkg-cli sdkg-engine Not Starting
Check if wallets are funded. DKG Engine requires a funded operational wallet to create its blockchain profile.
View logs and restart:
dkg-cli logs dkg-engine -f # or: dkg-cli l dkg-engine -f (check for errors)
dkg-cli restart dkg-engine # or: dkg-cli r dkg-engine (restart service)Database Issues
Check if database exists and recreate if needed:
cd dkg-node
ls -la apps/agent/*.db # Verify database exists
dkg-cli agent-setup # or: dkg-cli as (recreate database)Change LLM Provider or API Key
Re-run agent setup to update configuration:
cd dkg-node
dkg-cli agent-setup # or: dkg-cli asCreate Additional Users
Change default admin password or create new users:
cd dkg-node
dkg-cli create-userPermission Issues (Linux)
If you see "permission denied" or "EACCES" errors:
# Check file ownership
ls -la dkg-node/
# Fix ownership (if files are owned by root)
sudo chown -R $USER:$USER dkg-node/
# Reinstall dependencies
cd dkg-node
npm installPrevention: Always run dkg-cli install as a regular user (not root/sudo). The installer requests sudo only when needed.
Help
Get help for any command:
dkg-cli --help # List all commands
dkg-cli <command> --help # Command-specific helpResources
- Documentation: https://docs.origintrail.io/
- Report Issues: https://github.com/OriginTrail/dkg-node/issues
- Community: https://discord.com/invite/xCaY7hvNwD
