Files
modules/consensus-coordination/hyper-p2p-leader-lease
Raven ScottandCursor 67219df1e1 Expand messaging, network, consensus, and platform module APIs.
Add batch helpers, clear utilities, and count methods for qos topics, brokers, probes, leases, locks, and registry modules.

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

hyper-p2p-leader-lease

Lightweight leader election with lease expiry over gossip (term + leader + until timestamp).

Category: Consensus & coordination · Protocol: leader-lease/v1

When to use

Pick a single coordinator for jobs, cron ownership, or write serialization when full Raft is unnecessary.

When not to use

Byzantine fault tolerance, replicated logs, or strict linearizability (use hyper-p2p-raft-lite or hyper-p2p-causal-consensus).

Quick start

const { HyperP2PLeaderLease } = require('hyper-p2p-leader-lease')
const ll = new HyperP2PLeaderLease({ topic: process.argv[2], leaseTtlMs: 30000 })
await ll.ready()
ll.campaign(1)
console.log('leader:', ll.leader())

Docs

docs/api.md · docs/architecture.md

Test

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