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

evernode-client-cluster-manager

v1.1.3

Published

Drop-in management handler module for HotPocket contracts on Evernode. One require(), all 8 cluster management handlers.

Readme

evernode-client-cluster-manager

Drop-in npm module that adds all 10 cluster management handlers to any HotPocket contract running on Evernode. Designed for use with the Evernode Cluster Manager client tool but works with any HP JS client.

Install

npm install evernode-client-cluster-manager

Usage

const HotPocket = require('hotpocket-nodejs-contract');
const ClusterManager = require('evernode-client-cluster-manager');

const VERSION = '1.0.0';

const contract = async (ctx) => {
  // One line — registers all 10 handlers.
  // Returns true if a management command was handled — return early so your
  // business logic is skipped for that round.
  if (await ClusterManager.init(ctx, VERSION)) return;

  // Your business logic here
};

const hpc = new HotPocket.Contract();
hpc.init(contract);

Then build with ncc and deploy as normal:

npx ncc build src/index.js -o dist

Handlers

| Type | Mode | Description | |------|------|-------------| | status | readonly | Ledger info, contract ID, public key, version, readonly flag | | readCfg | readonly | Full running HP config from /contract/cfg/hp.cfg — includes mesh, user, node sections and known_peers | | readPatchCfg | readonly | Contract override config via ctx.getConfig() | | readEnvVars | readonly | Host environment variables from /contract/env.vars — external ports, quotas, security config | | readLog | readonly | Last N lines of hp.log | | readContractLog | readonly | Last N lines of rw.stdout.log or rw.stderr.log | | upgrade | consensus | Deploy new contract bundle via base64, runs post_exec.sh | | addNode | consensus | Add pubkey to UNL and peer via ctx.updateConfig() / ctx.updatePeers() | | removeNode | consensus | Remove pubkey from UNL and optional peer cleanup | | removePeer | consensus | Remove a peer from known_peers only |

Readonly handlers run on each node independently — no consensus required. Consensus handlers require all UNL nodes to agree before executing.

Input format

All inputs are JSON strings sent via submitContractReadRequest (readonly) or submitContractInput (consensus) from the HP JS client.

// Readonly
{ "type": "status" }
{ "type": "readCfg" }
{ "type": "readPatchCfg" }
{ "type": "readEnvVars" }
{ "type": "readLog", "lines": 100 }
{ "type": "readContractLog", "lines": 100, "logFile": "stdout" }

// Consensus
{ "type": "upgrade", "bundle": "<base64 encoded bundle.zip>" }
{ "type": "addNode", "pubkey": "ed...", "ip": "host.example.com", "peerPort": 22865 }
{ "type": "removeNode", "pubkey": "ed...", "ip": "host.example.com", "peerPort": 22865 }
{ "type": "removePeer", "peerIp": "host.example.com", "peerPort": 22865 }

Critical rules

  • Never use non-deterministic values (Date.now, Math.random) in consensus handler outputs
  • Always keep a VERSION constant and bump it on every upgrade so the cluster manager can track versions
  • Never remove any of the 10 handlers — the cluster manager client depends on all of them
  • The upgrade handler expects a valid bundle.zip containing dist/index.js built with ncc

Requirements

  • hotpocket-nodejs-contract >= 0.7.4
  • Node.js >= 16
  • Deployed on Evernode (requires HotPocket Docker environment with /contract/cfg/hp.cfg and /contract/env.vars)

Related