npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

dkg-cli

v1.0.40

Published

A CLI tool to easily install, configure, update, and manage OriginTrail Decentralized Knowledge Graph (DKG) Nodes.

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-cli

2. Generate Configuration

Create a project folder and generate configuration with wallets:

mkdir my_dkg_node && cd my_dkg_node
dkg-cli setup-config --testnet

This 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 mainnet

Note: DKG Node currently supports single blockchain deployment. Multichain support coming soon.

3. Update Configuration

Edit your .env file to customize settings:

nano .env

Required:

  • 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 install

Installation 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-setup

You'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-dev

Access:

  • Web UI: http://localhost:8081
  • API Docs: http://localhost:8081/swagger
  • DKG Engine: http://localhost:8900

Default credentials:

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-engine

Service 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 users

Creating 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 output

Updates

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 s

dkg-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 as

Create Additional Users

Change default admin password or create new users:

cd dkg-node
dkg-cli create-user

Permission 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 install

Prevention: 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 help

Resources

  • Documentation: https://docs.origintrail.io/
  • Report Issues: https://github.com/OriginTrail/dkg-node/issues
  • Community: https://discord.com/invite/xCaY7hvNwD