Files
modules/routing-paths/hyper-p2p-merge-registry/docs/api.md
T
Raven ScottandCursor 17876e6284 Expand category docs and module APIs across the library.
Manual pass adds helpers (listChannels, taskCounts, openProposals), richer getStats with protocol fields, category README hubs, and tightened api.md for core, messaging, network, routing, supercomputer, and consensus modules.

Co-authored-by: Cursor <[email protected]>
2026-05-21 00:54:19 -04:00

1.6 KiB

API: hyper-p2p-merge-registry

Protocol: merge-registry/v1 · Export: HyperP2PMergeRegistry

Overview

HyperP2PMergeRegistry — P2P module. See README.md and architecture.md.

Constructor

const mod = new HyperP2PMergeRegistry(opts)
Option Type Default Description
topic Buffer | string | null null Hyperswarm topic; omit for local-only
keyPair KeyPair random Discovery identity

Methods

register(...)

Public API on HyperP2PMergeRegistry. See index.js for parameters and return types.

lookup(...)

Public API on HyperP2PMergeRegistry. See index.js for parameters and return types.

lookupEntry(...)

Public API on HyperP2PMergeRegistry. See index.js for parameters and return types.

merge(...)

Public API on HyperP2PMergeRegistry. See index.js for parameters and return types.

entries(...)

Public API on HyperP2PMergeRegistry. See index.js for parameters and return types.

toJSON(...)

Public API on HyperP2PMergeRegistry. See index.js for parameters and return types.

getStats() → object

Metrics plus protocol: 'merge-registry/v1'.

async ready()

Joins Hyperswarm when topic is set; opens Protomux channel.

async close()

Tears down swarm and clears local state; emits closed where applicable.

P2P

Gossip / sync over Protomux merge-registry/v1 when topic is configured.

Testing

npm install && npm test