Skip to content

Conversation

@vasco-santos
Copy link
Member

Discovery modules within Transports automatically added to discovery if enabled

@vasco-santos vasco-santos force-pushed the feat/discovery-modules-from-transports-should-be-enabled branch from 78040ca to 7f216a9 Compare December 11, 2019 15:10
src/index.js Outdated

if (config.enabled) {
if (config.enabled &&
!this._discovery.filter((service) => service.tag === DiscoveryService.tag).length) { // not already added
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just make this._discovery a Map? They require a tag, it might be easier for checking existence and getting specific ones should we need to do that.


await libp2p.start()

expect(libp2p._discovery).to.have.lengthOf(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should verify this is the discovery service we expect. Making libp2p. _discovery a map would make this easy to do.

Copy link
Contributor

@jacobheun jacobheun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor thing, otherwise this is gtg! 🎉

@jacobheun jacobheun merged commit 1ee1787 into refactor/async-await Dec 11, 2019
@jacobheun jacobheun deleted the feat/discovery-modules-from-transports-should-be-enabled branch December 11, 2019 16:06
jacobheun added a commit that referenced this pull request Dec 12, 2019
* feat: discovery modules from transports should be added

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <[email protected]>

* chore: address review

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <[email protected]>
jacobheun added a commit that referenced this pull request Jan 24, 2020
* feat: discovery modules from transports should be added

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <[email protected]>

* chore: address review

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants