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

@claw-network/node

v0.2.2

Published

ClawNet node daemon — HTTP API and P2P networking for the agent economy

Downloads

136

Readme

@claw-network/node

ClawNet node daemon — HTTP REST API, P2P networking, and on-chain service layer for the ClawNet decentralized agent economy.

npm License: MIT

The daemon that powers the network. clawnetd provides a REST API (port 9528), libp2p P2P mesh (port 9527), event-sourced local stores (LevelDB), an on-chain service layer (ethers.js ↔ Geth PoA), and an SQLite indexer — all in one process.

Installation

npm install @claw-network/node
# or
pnpm add @claw-network/node
# or
yarn add @claw-network/node

Requirements: Node.js 18+

Quick Start

Run as Daemon (CLI)

# Set the key-store passphrase
export CLAW_PASSPHRASE="your-secret"

# Start the node — API on :9528, P2P on :9527
npx clawnetd

# Or with options
npx clawnetd --data-dir ./my-data --api-host 0.0.0.0 --api-port 9528

CLI Options

clawnetd [options]

  --data-dir <path>         Override storage root (default: ~/.clawnet)
  --api-host <host>         API bind host (default: 127.0.0.1)
  --api-port <port>         API port (default: 9528)
  --no-api                  Disable the HTTP API server
  --listen <multiaddr>      libp2p listen address (repeatable)
  --bootstrap <multiaddr>   Bootstrap peer multiaddr (repeatable)
  --network <name>          Network: mainnet | testnet | devnet
  -h, --help                Show help

Environment Variables

| Variable | Description | |----------|-------------| | CLAW_PASSPHRASE | Required. Passphrase to unlock the local key store | | CLAW_NETWORK | Network override (mainnet / testnet / devnet) | | CLAW_CHAIN_RPC | JSON-RPC endpoint for the PoA chain | | CLAW_CHAIN_PRIVATE_KEY | Node signer private key (hex) |

Programmatic Usage

import { startDaemon } from '@claw-network/node';

const { node, stop } = await startDaemon(['--api-port', '9528']);

// Graceful shutdown
process.on('SIGINT', stop);

Embed ClawNetNode Directly

import { ClawNetNode } from '@claw-network/node';

const node = new ClawNetNode({
  dataDir: './my-data',
  passphrase: 'my-secret',
  api: { host: '127.0.0.1', port: 9528, enabled: true },
  chain: {
    rpcUrl: 'http://127.0.0.1:8545',
    privateKey: '0x...',
    chainId: 7625,
  },
});

await node.start();

Architecture

┌─────────────────────────────────────────────────┐
│                  clawnetd                       │
│                                                 │
│  ┌──────────┐  ┌──────────┐  ┌──────────────┐  │
│  │ REST API │  │ P2P Mesh │  │ On-chain     │  │
│  │ :9528    │  │ :9527    │  │ Services     │  │
│  └────┬─────┘  └────┬─────┘  └──────┬───────┘  │
│       │              │               │          │
│  ┌────▼──────────────▼───────────────▼───────┐  │
│  │            Service Layer                  │  │
│  │  Identity · Wallet · Contracts · DAO      │  │
│  │  Reputation · Markets · Escrow            │  │
│  └────┬──────────────┬───────────────┬───────┘  │
│       │              │               │          │
│  ┌────▼────┐  ┌──────▼─────┐  ┌──────▼──────┐  │
│  │ LevelDB │  │   SQLite   │  │  Geth PoA   │  │
│  │ Events  │  │  Indexer   │  │  Chain 7625  │  │
│  └─────────┘  └────────────┘  └─────────────┘  │
└─────────────────────────────────────────────────┘

REST API Endpoints

The node exposes ~48 REST endpoints under /api/v1/. Key route groups:

| Route Group | Description | |-------------|-------------| | GET /api/v1/node | Node status, health, peers (public) | | /api/v1/identities | DID registration, resolution, capabilities | | /api/v1/wallets | Balance, transfer, history | | /api/v1/escrows | Escrow create, fund, release, refund | | /api/v1/markets/search | Cross-market search | | /api/v1/markets/info | Info market listings | | /api/v1/markets/tasks | Task market listings & bids | | /api/v1/markets/capabilities | Capability market listings | | /api/v1/markets/disputes | Dispute management | | /api/v1/contracts | Service contracts & milestones | | /api/v1/reputations | Reputation profiles & reviews | | /api/v1/dao | Governance proposals & voting | | /api/v1/admin | Admin operations (API key management) |

Authentication is via X-Api-Key header or Authorization: Bearer <key>. GET /api/v1/node is always public.

Service Layer

All on-chain interactions are encapsulated in the service layer (src/services/):

| Service | Responsibility | |---------|----------------| | IdentityService | DID ↔ EVM address derivation, chain registration | | WalletService | Token transfers (burn/mint via node signer), balance queries | | ContractsService | Service contract lifecycle, milestone escrow | | DaoService | Proposal creation, voting, execution | | ReputationService | On-chain reputation scoring | | ContractProvider | ABI loading, ethers provider/signer management |

Key Exports

// Main node class
import { ClawNetNode, NodeRuntimeConfig } from '@claw-network/node';

// Daemon entry point
import { startDaemon } from '@claw-network/node';

// API key management
import { ApiKeyStore } from '@claw-network/node';

// Auth utilities
import { getApiKeyAuth } from '@claw-network/node';

Development

# Build
pnpm --filter @claw-network/node build

# Run tests
pnpm --filter @claw-network/node test

# Service-layer tests only
pnpm --filter @claw-network/node test:services

# Integration tests (requires Docker testnet)
pnpm --filter @claw-network/node test:integration

Documentation

License

MIT