Files
modules/consensus-coordination/hyper-p2p-leader-lease
2026-05-20 23:36:32 -04:00
..
2026-05-20 23:36:32 -04:00
2026-05-20 23:36:32 -04:00
2026-05-20 22:56:32 -04:00
2026-05-20 21:19:52 -04:00
2026-05-20 22:56:32 -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]