-
-
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
core: make announced swarm addresses configurable #3948
Conversation
hostopts := &ConstructPeerHostOpts{ | ||
AddrsFactory: addrsFactory, | ||
DisableNatPortMap: cfg.Swarm.DisableNatPortMap, | ||
} | ||
peerhost, err := hostOption(ctx, n.Identity, n.Peerstore, n.Reporter, |
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.
maybe we could also have a ConstructSwarmOpts
that holds all these other arguments.
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 libp2p/go-libp2p#197 is merged I'd like to remove ConstructPeerHostOpts and use basichost.HostOpts, and would like to do the same with regard to swarm.
core/core.go
Outdated
return func(allAddrs []ma.Multiaddr) []ma.Multiaddr { | ||
var addrs []ma.Multiaddr | ||
if len(annAddrs) > 0 { | ||
addrs = annAddrs[:] |
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.
Why the reslice?
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.
yeah good question :) removing that
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.
Oh yeah right. We build annAddrs
once and cache it outside the closure, and the reslice is to prevent multiple calls to the closure from getting back the same slice. It's gonna be equal, but not the same.
@lgierth what is the next step here? |
f003ad0
to
e040009
Compare
This should be good to go -- I rebased, let's see what CI says. |
Oh right this depends on a libp2p update. Will take care of that later today. |
@lgierth you should be unblocked here now :) |
Please rebase. |
0a621b1
to
5ea91ee
Compare
I rebased, and looked at that reslice once more, it's gone now. Jenkins green |
5ea91ee
to
952f658
Compare
License: MIT Signed-off-by: Lars Gierth <[email protected]>
integrate #3948 License: MIT Signed-off-by: vyzo <[email protected]>
@Kubuxu what was it you committed here, just another rebase? |
integrate #3948 License: MIT Signed-off-by: vyzo <[email protected]>
integrate #3948 License: MIT Signed-off-by: vyzo <[email protected]>
Fixes #3613
Overall this is good for CR though.