libp2p / js-libp2p-bootstrap

Rail a libp2p node through a bootstrap peer list
https://libp2p.io
Other
30 stars 21 forks source link

fix!: only discover bootstrap peers once and tag them on discovery #142

Closed achingbrain closed 2 years ago

achingbrain commented 2 years ago

Bootstrap peers should be used in an intial DHT self query to find peers that are KAD-close to us.

We do not need to rediscover the same peers over and over again, instead we should just discover them once, use them to query for peers near our PeerId then we can disconnect from them like any other peer

  1. Instead of "discovering" the same peers every few seconds, only discover them once
  2. Tag the peers in the peer store with an expiring value to prevent any potential connection being culled before we've used the bootstrap nodes to query for peers close to us

BREAKING CHANGE: the interval option has been renamed timeout and peers are now only discovered once

github-actions[bot] commented 2 years ago

:tada: This PR is included in version 3.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: