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 🙏

© 2026 – Pkg Stats / Ryan Hefner

dagdev

v1.2.1

Published

CLI tool for DagDev - Hardhat for BlockDAG Networks

Readme

DagDev CLI

DagDev - Development framework for BlockDAG networks. Like Hardhat, but for DAG-based blockchains.

🚀 Quick Start

Installation

Install globally via npm:

npm install -g dagdev

Or use npx without installing:

npx dagdev init my-project

Initialize a New Project

dagdev init my-project
cd my-project

This creates:

  • contracts/ - Solidity smart contracts
  • scripts/ - Deployment scripts
  • test/ - Test files
  • dagdev.config.js - Configuration file

📚 Commands

dagdev init <directory>

Create a new DagDev project

dagdev init my-dag-project

dagdev compile

Compile Solidity contracts

dagdev compile
# Outputs: artifacts/ directory with compiled contracts

dagdev node

Start a local DagDev node

dagdev node
# Starts node on http://127.0.0.1:8545
# Mining enabled by default

dagdev run <script>

Run a deployment or interaction script

dagdev run scripts/deploy.js --network local
dagdev run scripts/deploy.js --network testnet

dagdev test

Run tests

dagdev test
dagdev test test/mytest.test.js

dagdev visualize

Launch DAG visualizer

dagdev visualize
# Opens http://localhost:3000

⚙️ Configuration

Create dagdev.config.js in your project:

module.exports = {
  solidity: {
    version: "0.8.30",
    settings: {
      optimizer: {
        enabled: true,
        runs: 200
      }
    }
  },
  networks: {
    local: {
      url: "http://127.0.0.1:8545",
      mining: {
        enabled: true,
        interval: 2000  // ms between blocks
      }
    },
    testnet: {
      url: "https://testnet.kas.fyi",
      chainId: 10222,
      accounts: ["0xYOUR_PRIVATE_KEY"]
    }
  },
  paths: {
    sources: "./contracts",
    tests: "./test",
    cache: "./cache",
    artifacts: "./artifacts"
  }
};

🎯 Example Workflow

# 1. Create project
dagdev init my-dapp
cd my-dapp

# 2. Add a contract
cat > contracts/Storage.sol << EOF
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;

contract Storage {
    uint256 value;
    
    function store(uint256 _value) public {
        value = _value;
    }
    
    function retrieve() public view returns (uint256) {
        return value;
    }
}
EOF

# 3. Compile
dagdev compile

# 4. Start local node (in separate terminal)
dagdev node

# 5. Deploy
cat > scripts/deploy.js << EOF
async function main() {
  const Storage = await dag.getContractFactory("Storage");
  const storage = await Storage.deploy();
  await storage.waitForDeployment();
  console.log("Storage deployed to:", await storage.getAddress());
}
main();
EOF

dagdev run scripts/deploy.js

# 6. Test
dagdev test

🔧 Features

  • DAG-based blockchain - Supports BlockDAG consensus
  • EVM compatible - Run Solidity smart contracts
  • Local development node - Built-in node for testing
  • Transaction signing - Full wallet management with private keys
  • Multi-network support - Deploy to local, testnet, or custom networks
  • Testing framework - Built-in test runner with Mocha/Chai
  • DAG visualizer - Visualize the DAG structure in real-time
  • Hardhat-like API - Familiar developer experience

📖 API Reference

Runtime Environment (DRE)

Available in scripts and tests as dag:

// Get contract factory
const Factory = await dag.getContractFactory("MyContract");

// Deploy contract
const contract = await Factory.deploy(arg1, arg2);
await contract.waitForDeployment();

// Get signer
const [signer] = await dag.getSigners();

// Get network
const network = await dag.getNetwork();
console.log(network.name, network.chainId);

// DAG-specific
const dagGraph = await dag.getDAGGraph();
const tips = await dag.getTips();
const blueSet = await dag.getBlueSet();

🧪 Testing

const { expect } = require("chai");

describe("Storage", function() {
  it("Should store and retrieve value", async function() {
    const Storage = await dag.getContractFactory("Storage");
    const storage = await Storage.deploy();
    await storage.waitForDeployment();
    
    await storage.store(42);
    expect(await storage.retrieve()).to.equal(42);
  });
  
  // DAG-specific matchers
  it("Should be in blue set", async function() {
    const tx = await contract.someFunction();
    expect(tx.hash).to.beInBlueSet();
  });
});

🌐 Networks

Local Network

dagdev node  # Start local node
dagdev run scripts/deploy.js --network local

Testnet (BlockDAG/Kaspa Testnet)

// dagdev.config.js
module.exports = {
  networks: {
    testnet: {
      url: "https://testnet.kas.fyi",
      chainId: 10222,
      accounts: [process.env.PRIVATE_KEY]
    }
  }
};
dagdev run scripts/deploy.js --network testnet

🔑 Account Management

Load accounts from private keys:

// In scripts/deploy.js
const [deployer] = await dag.getSigners();
console.log("Deploying with:", deployer.address);

const balance = await dag.provider.getBalance(deployer.address);
console.log("Balance:", balance.toString());

Set private key in .env:

PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE

📦 Package Structure

When installed, you get access to:

  • dagdev - CLI tool (this package)
  • @dagdev/core - Core DAG implementation
  • @dagdev/runtime - Runtime environment (DRE)
  • @dagdev/compiler - Solidity compiler wrapper
  • @dagdev/config - Configuration system

🐛 Troubleshooting

"Failed to connect to node"

Make sure the local node is running:

dagdev node  # In separate terminal

"Command not found: dagdev"

Install globally:

npm install -g dagdev

Or use npx:

npx dagdev --version

Compilation errors

Check Solidity version in dagdev.config.js matches your contracts:

module.exports = {
  solidity: {
    version: "0.8.30"  // Match pragma version
  }
};

📚 Resources

  • GitHub: https://github.com/virtualconnekt/dag-dev
  • Documentation: https://github.com/virtualconnekt/dag-dev#readme
  • Issues: https://github.com/virtualconnekt/dag-dev/issues
  • BlockDAG Testnet: https://testnet.kas.fyi

📄 License

MIT License - see LICENSE file for details

🤝 Contributing

Contributions welcome! See our GitHub repository for guidelines.


Built with ❤️ for the BlockDAG ecosystem