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

Invert constructor config handling #6276

Merged
merged 4 commits into from
Apr 29, 2019
Merged

Invert constructor config handling #6276

merged 4 commits into from
Apr 29, 2019

Conversation

magik6k
Copy link
Member

@magik6k magik6k commented Apr 29, 2019

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)

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]>
@ghost ghost assigned magik6k Apr 29, 2019
@ghost ghost added the status/in-progress In progress label Apr 29, 2019
License: MIT
Signed-off-by: Łukasz Magiera <[email protected]>
Copy link
Member

@Stebalien Stebalien left a 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)),
Copy link
Member

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))
}
Copy link
Member

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.

@Stebalien Stebalien merged commit dd16b3c into master Apr 29, 2019
@ghost ghost removed the status/in-progress In progress label Apr 29, 2019
@Stebalien Stebalien deleted the feat/core-cfg-handling branch April 29, 2019 23:09
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.

2 participants