Files
modules/state-crdts/hyper-p2p-crdt-two-phase-set
Raven ScottandCursor faf152a8ac Add exportState and moduleSnapshot helpers across all module categories.
Fifth pass: complete measurement modules (sla-budget, histogram-gossip) with moduleSnapshot/toJSON; stats-exporter exportSnapshot; exportState() alias on modules with standard snapshot serialization.

Co-authored-by: Cursor <[email protected]>
2026-05-21 04:29:50 -04:00
..
2026-05-20 23:36:32 -04:00
2026-05-20 23:36:32 -04:00
2026-05-21 02:00:00 -04:00
2026-05-21 00:07:44 -04:00
2026-05-20 21:57:50 -04:00
2026-05-21 02:00:00 -04:00
2026-05-20 23:36:32 -04:00

hyper-p2p-crdt-two-phase-set

Two-phase set (2P-Set) CRDT: add and remove sets merged for membership.

Category: State CRDTs · Protocol: crdt-two-phase-set/v1

When to use

Replicated sets with removals that must converge (ban lists, revoked IDs).

When not to use

Elements that can be re-added after remove without tracking history (consider OR-Set patterns). Grow-only data (use G-Set).

Quick start

const { HyperP2PCrdtTwoPhaseSet } = require('hyper-p2p-crdt-two-phase-set')
const s = new HyperP2PCrdtTwoPhaseSet({ topic: process.argv[2] })
await s.ready()
s.add('x')
s.remove('x')
console.log(s.elements())

Docs

docs/api.md · docs/architecture.md

Test

npm install && npm test · bare examples/basic.js [topic]