Skip to content

Commit

Permalink
keep peer public keys stable based on hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
billiegoose committed Jun 20, 2024
1 parent b497d68 commit b117f13
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/manual/measure-reconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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())
// })

0 comments on commit b117f13

Please sign in to comment.