-
Notifications
You must be signed in to change notification settings - Fork 957
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
feat(libp2p): add SwarmBuilder
#4120
Conversation
//CC @DougAnderson444 since this is related to https://github.com/DougAnderson444/libp2peasy. |
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.
Great work Max!
Before you continue supporting more transports, I'd appreciate some exploration on how this can be turned into a SwarmBuilder
.
Specifically, we should make it possible to pass the identity in there but also generate a new one and then pass it to the Swarm
as well.
- Allow providing or generating identity - Use V1Lazy - Make NetworkBehaviour constructor take relay Behaviour in case with_relay was called - Rename to AuthenticatedMultiplexedTransport
Thank you for the input @thomaseizinger. What do you think of the most recent commit? |
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 looking very nice already. I'd say that is worth a blog-post once we ship it :)
Some good content for TWIR!
I suggest shipping a minimal Builder at first. Users that need advanced features can use the `with_other_transport` method or build a `Transport` without the builder.
- Make tls and noise configurable. - Prevent accidental behavior change through feature change. E.g. enabling "noise" feature should not make ones transport automatically offer noise. Instead one needs to explicitly call `with_noise` and `without_noise`.
In regards to the recent comments, happy to add shortcut methods to the various |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Support for QUIC draft 29 was removed with libp2p#4467. libp2p#4120 reintroduced it as a faulty merge. This commit removes it again.
interop-tests/src/arch.rs
Outdated
.with_websocket(tls::Config::new, mplex::MplexConfig::default) | ||
.with_websocket(noise::Config::new, mplex::MplexConfig::default) |
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.
Once more, great catch @thomaseizinger.
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.
Interop tests made this one easy :)
Thank you @thomaseizinger for the last commits and the reviews in general. As always, very helpful. |
Version bump missed in libp2p#4120.
Description
Introduce the new
libp2p::SwarmBuilder
. Users should use the newlibp2p::SwarmBuilder
instead of the now deprecatedlibp2p::swarm::SwarmBuilder
. Seelibp2p::SwarmBuilder
docs on how to use the new builder.Fixes #3657.
Fixes #3563.
Fixes #3179.
Notes & open questions
Change checklist