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

Allow access to Components/Registrar from DialOptions/ListenerOptions when creating a new transport #1318

Closed
ckousik opened this issue Aug 5, 2022 · 2 comments
Labels
need/triage Needs initial labeling and prioritization

Comments

@ckousik
Copy link
Contributor

ckousik commented Aug 5, 2022

When creating a new transport, we are unable to register any new streams with the registrar, or fetch handles for any incoming streams. We are also unable to find the list of supported protocols, incoming and outgoing stream limits, and track metrics. Currently, transport implementations implement the MultiaddrConnection interface and use the upgrader for muxing, encryption, and handling streams. This is unnecessary when using transports which inherently contain encryption and stream multiplexing (WebRTC, QUIC). Allowing access to the components or some subset of it containing the registrar would simplify implementing these transports.

@ckousik ckousik added the need/triage Needs initial labeling and prioritization label Aug 5, 2022
@achingbrain
Copy link
Member

If your transport implements Initializable it'll get handed a Components instance after construction - that'll give you access to the Registrar and other libp2p components.

At that point you should be able to do stream/connection gating, encryption, multiplexing, etc in the same way the upgrader does for transports that don't have their own versions of these things.

Hopefully that helps?

@ckousik
Copy link
Contributor Author

ckousik commented Aug 10, 2022

Yes, thank you! We can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

2 participants