This commit is contained in:
Raven Scott
2026-05-20 23:36:32 -04:00
parent a020270cb1
commit be94546cd3
218 changed files with 9189 additions and 3078 deletions
@@ -2,7 +2,8 @@ require('bare-process/global')
const { HyperP2PRaftLite } = require('../index.js')
async function main () {
const raft = new HyperP2PRaftLite({ peerId: 'n1' })
const raft = new HyperP2PRaftLite({ topic: process.argv[2] || null, peerId: 'n1' })
await raft.ready()
raft.appendLog({ cmd: 'ping' })
raft.becomeLeader(1)
console.log(raft.role(), raft.getStats())