From b117f13b9b252a86d6b56bf8ae1d70dda9b467cf Mon Sep 17 00:00:00 2001 From: Billie Hilton <587740+billiegoose@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:33:01 -0400 Subject: [PATCH] keep peer public keys stable based on hostname --- test/manual/measure-reconnect.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/manual/measure-reconnect.js b/test/manual/measure-reconnect.js index 276797f..15af75a 100644 --- a/test/manual/measure-reconnect.js +++ b/test/manual/measure-reconnect.js @@ -18,10 +18,10 @@ const relayThrough = (force) => force ? DEV_RELAY_KEYS : null const Hyperswarm = require('../..') -const seed = Buffer.alloc(32).fill('billie-fast-reconnect') -const topic = seed +const topic = Buffer.alloc(32).fill('measure-reconnect') +const seed = Buffer.alloc(32).fill('measure-reconnect' + require('os').hostname()) -const swarm = new Hyperswarm({ relayThrough }) +const swarm = new Hyperswarm({ seed, relayThrough }) swarm.dht.on('network-change', () => { console.log('NETWORK CHANGE') @@ -47,3 +47,7 @@ swarm.on('connection', async (conn) => { console.time('INITIAL CONNECTION TIME') swarm.join(topic) + +// process.on('SIGINT', () => { +// swarm.leave(topic).then(() => process.exit()) +// })