Files
modules/storage-hyperdrive/hyper-p2p-drive-gc-sweep
Raven ScottandCursor 3af23c0d34 Add toJSON() serialization helpers across all module categories on main.
Fourth pass: toJSON() delegates to snapshot() (or exportSnapshot/stateSnapshot) for JSON export and logging across agents, applications, consensus, core, encoding, experimental, indexes, media, messaging, network, observability, pear-platform, routing, scheduling, storage, supercomputer, trust, measurement, oracles, and time-ordering modules.

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

hyper-p2p-drive-gc-sweep

Marks stale drive paths and sweeps them in batches over gossip; coordinate exclusive sweep windows with hyper-p2p-topic-lease. Hyperswarm gossip when topic is set.

Category: Storage (Hyperdrive)

Composes with: hyper-p2p-topic-lease

Protocol: drive-gc-sweep/v1

When to use

Orphaned paths must be collected consistently across mirroring peers.

When not to use

GC is purely local or drive has no shared replication topic.

Quick start

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

Docs

Test

npm install && npm test