-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Invert constructor config handling #6276
Conversation
License: MIT Signed-off-by: Łukasz Magiera <[email protected]>
License: MIT Signed-off-by: Łukasz Magiera <[email protected]>
License: MIT Signed-off-by: Łukasz Magiera <[email protected]>
License: MIT Signed-off-by: Łukasz Magiera <[email protected]>
5f194ed
to
e133058
Compare
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 a very nice improvement (IMO).
I hope we can eventually start seeing negative diffstats but we may have to wait for some libp2p refactoring first.
fx.Provide(libp2p.AddrsFactory(cfg.Addresses.Announce, cfg.Addresses.NoAnnounce)), | ||
fx.Provide(libp2p.SmuxTransport(bcfg.getOpt("mplex"))), | ||
fx.Provide(libp2p.Relay(cfg.Swarm.DisableRelay, cfg.Swarm.EnableRelayHop)), | ||
fx.Invoke(libp2p.StartListening(cfg.Addresses.Swarm)), |
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.
We can handle this later but I wonder if this should go elsewhere; somewhere higher up the stack.
|
||
if quic { | ||
opts.Opts = append(opts.Opts, libp2p.DefaultTransports, libp2p.Transport(libp2pquic.NewTransport)) | ||
} |
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.
Small note: Once libp2p starts using fx, this will go away. At that point, we should be able to just pull in the transports group.
See #6232
The diff is slightly larger that I initially thought it would be, but it looks reasonably good (there is still room for improvement, but I wanted to keep the PR size down)