Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation assumes tranpsorts inclue a discover #829

Closed
Gozala opened this issue Dec 9, 2020 · 2 comments
Closed

Implementation assumes tranpsorts inclue a discover #829

Gozala opened this issue Dec 9, 2020 · 2 comments
Labels
kind/enhancement A net-new feature or improvement to an existing feature status/ready Ready to be worked

Comments

@Gozala
Copy link
Contributor

Gozala commented Dec 9, 2020

As per https://github.com/libp2p/js-libp2p/pull/802/files#diff-bfe9874d239014961b1ae4e89875a6155667db834a410aaaa2ebe3cf89820556R648 implementation makes assumption that Transport includes a discovery but that assumption is not supported by the interface definition.

We should either iterate on an interface or an implementation so that assumptions made by the implementation are supported by the defined interface.

@Gozala Gozala mentioned this issue Dec 10, 2020
1 task
@vasco-santos
Copy link
Member

vasco-santos commented Dec 10, 2020

Regarding this, this will probably get into libp2p configuration improvements effort. This is not really interface related issue as the Transport Interface should not need to know about any discovery.

This is currently a hack that enables us to do:

const WebrtcStar = require('libp2p-webrtc-star')

const libp2p = await Libp2p.create({
  modules: {
    transport: [WebrtcStar]
  }
})

Enabling its built in discovery. Webrtc-star is the only transport using this transport.discovery.

It should really go into discovery

const WebrtcStar = require('libp2p-webrtc-star')

const libp2p = await Libp2p.create({
  modules: {
    transport: [WebrtcStar],
    peerDiscovery: [WebrtcStar]
  }
})

But this currently is not possible, as we would need to construct WebrtcStar before, which requires libp2p's upgrader.

@vasco-santos vasco-santos added kind/enhancement A net-new feature or improvement to an existing feature status/ready Ready to be worked labels Dec 10, 2020
@maschad
Copy link
Member

maschad commented Sep 28, 2023

Closing due to staleness

@maschad maschad closed this as completed Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature status/ready Ready to be worked
Projects
None yet
Development

No branches or pull requests

3 participants