Files
modules/consensus-coordination/hyper-p2p-leader-lease
Raven ScottandCursor 32f4292036 Expand consensus, discovery, collab, and infrastructure modules
Add leader lease remaining time and follower removal, message envelope
cloning and version config, presence onlineCount fix plus announceNow,
auction open/winning bid helpers, topic announcer bulk revoke, topic lease
releaseAll, and collab room totals and closeRoom.

Co-authored-by: Cursor <[email protected]>
2026-05-21 02:41:28 -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]