Files
modules/storage-autobase/hyper-p2p-autobase-fork-choice
Raven ScottandCursor 7cb1612e71 Giant pass: storage API docs, trust/consensus/routing code, category guides
Complete manual documentation cleanup for the storage stack and expand
category-level guides across the library.

Documentation (23 storage modules):
- Rewrite Methods sections in all storage-hypercore, storage-hyperbee,
  storage-autobase, and storage-hyperdrive api.md files from index.js
- Remove every "module-specific (see implementation)" placeholder in storage
- Fix bitfield-scheduler, bee-batch-write, bee-range-watch, drive-gc-sweep APIs

Category READMEs (modules/):
- trust-security, consensus-coordination, routing-advanced — tables + hub links
- MODULE_CATEGORIES.md typo fix (scaffold tier description)

Code:
- hyper-p2p-trust-graph: hasEdge(), nodeCount(), getStats with protocol
- hyper-p2p-circuit-breaker: listCircuitIds(), reset()
- hyper-p2p-distributed-lock: getStats merges metrics + active lock counts

Parent workspace (not in this repo) also received doc hubs for all 29
categories in docs/README.md and MODULE_DOC_PASS.md giant-pass tracker.

Co-authored-by: Cursor <[email protected]>
2026-05-21 00:27:46 -04:00
..

hyper-p2p-autobase-fork-choice

Registers Autobase view forks over gossip and picks the best by weight/version; align with hyper-p2p-causal-consensus for writer ordering. Hyperswarm gossip when topic is set.

Category: Storage (Autobase)

Composes with: hyper-p2p-causal-consensus

Protocol: autobase-fork-choice/v1

When to use

Multiple Autobase views compete and peers must converge on one fork id.

When not to use

Single linear Autobase with no fork hints.

Quick start

const { HyperP2PAutobaseForkChoice } = require('hyper-p2p-autobase-fork-choice')
const topic = process.argv[2] // 64-char hex or string
const mod = new HyperP2PAutobaseForkChoice({ topic })
await mod.ready()   // joins swarm when topic set
// ... application logic ...
await mod.close()

Docs

Test

npm install && npm test