-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Conversation
@@ -1,5 +1,6 @@ | |||
'use strict' | |||
|
|||
const Bootstrap = require('libp2p-bootstrap') |
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 noticed that Bootstrap is only required in components/libp2p
. Is this a bundle optimization?
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.
cc @achingbrain
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.
AFAIK the inline requires are to speed up node start-up time.
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.
ok, so I will add a comment for that and keep the Bootstrap as it was and only use the tag for the other one
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.
iirc the inline requires were done to reduce the cli execution time, not startup time (ie: if it's not needed for interacting with the running daemon, avoid requiring it). Not sure if this is still a problem with how things are setup internally.
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.
Should I change the comment to: Requiring bootstrap inline in components/libp2p to reduce the cli execution time
?
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 don't think that's really accurate though. In reality the whole libp2p component should be ignored in CLI, as I don't think it's used at all (unless I'm mistaken). I'd leave it for now, and we can clean that all up when we update libp2p configuration.
8d24506
to
9fe4afb
Compare
@@ -35,13 +35,13 @@ module.exports = () => { | |||
config: { | |||
peerDiscovery: { | |||
autoDial: true, | |||
// Optimization | |||
// Requiring bootstrap inline in components/libp2p to reduce the cli execution time |
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 is browser config, the reference to cli execution time isn't relevant here.
Tests are failing:
Is the |
Yeah, we cannot use the tag in webrtc after all 😞 I will have this stuff properly addressed when we improve the libp2p config. For now we can include a comment to let users know where the tag comes from |
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.
LGTM
This PR removes the websocketStar discovery configuration, since it is not used anymore.
In addition, I have changed the discovery keys to use the modules tag from the module. This has created some confusion to libp2p users, and we would like people to use the tag instead of magic keys that might also be changed in the future: libp2p/js-libp2p#664 (comment)