hyper-p2p-reactive-state
Reactive LWW key–value state with Hyperswarm sync, Protomux snapshots/updates, and optional Hyperbee persistence.
Category: State CRDTs · Protocol: hyper-p2p-reactive-state/v1
When to use
Observable shared config/game state with offline reload, peer subscriptions, and merge by timestamp + peerId tie-break.
When not to use
Simple gossip CRDTs without persistence/events, or strict BFT ordering (use causal consensus).
Quick start
const { HyperP2PReactiveState } = require('hyper-p2p-reactive-state')
const state = new HyperP2PReactiveState({ topic: process.argv[2], memoryOnly: true })
await state.ready()
await state.set('score', 100)
state.subscribe('score', (c) => console.log(c))
Docs
- docs/api.md — full API (constructor, wire, events)
- docs/architecture.md
Test
npm install && npm test
bare examples/basic.js