-
Notifications
You must be signed in to change notification settings - Fork 60
feat: start random walk and allow configuration for disabling #42
Conversation
src/index.js
Outdated
if (err) { | ||
return callback(err) | ||
} | ||
this.randomWalk.start() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be started just like any other Peer Discovery Service, that means, start it on js-libp2p instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change the PR and create a new one for js-libp2p
! Thanks
3f1abd9
to
45dfb33
Compare
f0bd76c
to
f6577f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vasco-santos the code looks good but it looks like there is an issue with libp2p-mplex that we should fix. Since this is going to be running periodically and by default we need to avoid any uncaught errors.
Looking at the CI error we need to be checking drained
here https://github.com/libp2p/js-libp2p-mplex/blob/v0.8.0/src/internals/index.js#L167-L169. If L160 sets drained
to false, pushing again will error, which is what CI is not happy about.
I will look into that problem @jacobheun . Thanks for finding it out |
@jacobheun it is green now! @diasdavid can we have your feedback to move this forward? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go for it.
In the context of the integration of the DHT to
js-ipfs
js-ipfs#856.I changed the implementation of
randomWalk
. It was using asetInterval
, which was causing this function to run the_walk
function after five minutes. On the contrary,go-libp2p-kad-dht
runs immediately after the node starts and then, each 5 minutes, as we can see in go-libp2p-kad-dht/dht_bootstrap.go#L81-L85Worklist:
random-walk
once the DHT is started