-
-
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
PNet take 2 #3697
PNet take 2 #3697
Conversation
a70886b
to
74305d4
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.
Overall looks good to me. I'd like to see it squashed into two commits, the first just updating deps, and the second making all the code changes, then i'll review again.
core/commands/swarm.go
Outdated
@@ -14,7 +14,7 @@ import ( | |||
"github.com/ipfs/go-ipfs/repo/fsrepo" | |||
iaddr "github.com/ipfs/go-ipfs/thirdparty/ipfsaddr" | |||
pstore "gx/ipfs/QmQMQ2RUjnaEEX8ybmrhuFFGhAwPjyL1Eo6ZoJGD7aAccM/go-libp2p-peerstore" | |||
swarm "gx/ipfs/QmY8hduizbuACvYmL4aZQbpFeKhEQJ1Nom2jY6kv6rL8Gf/go-libp2p-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.
lets keep all the dep updates in the same commit
2077a9d
to
b217609
Compare
Done. |
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.
LGTM, Just one weird merge conflict thing with the dependency updating commit. Gotta make sure every commit at least builds
core/core.go
Outdated
@@ -174,7 +176,25 @@ func (n *IpfsNode) startOnlineServices(ctx context.Context, routingOption Routin | |||
|
|||
tpt := makeSmuxTransport(mplex) | |||
|
|||
<<<<<<< HEAD |
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.
Merge conflict here.
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.
Sorry that I have missed it.
case <-t.C: | ||
if ph := n.PeerHost; ph != nil { | ||
if len(ph.Network().Peers()) == 0 { | ||
log.Warning("We are in private network and have no peers.") |
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.
Rather unfortunate that these warnings won't show up by default... I wonder if we should look at turning on warning messages by 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.
I think it might be good idea, there doesn't seem that much of a spam on warning level.
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.
I take it back, there is a lot of spam on global warning channel.
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.
Hrm... definitely out of scope for this PR, but we should look at reducing spam there and think about setting the default level to be warning
df2ae38
to
4acf869
Compare
Fixed the merge conflict and rebased. |
Coverage is a bit low, as the lack of peer warning isn't tested. There is no clean way to test it and as it is just a log I don't think it matters. |
cmd/ipfs/daemon.go
Outdated
@@ -347,6 +348,11 @@ func daemonFunc(req cmds.Request, res cmds.Response) { | |||
} | |||
node.SetLocal(false) | |||
|
|||
if node.PNetFingerpint != nil { | |||
fmt.Println("Swarm is limited to private network of peers with the swarm key") | |||
fmt.Printf("Swarm key fingerprint: %s\n", hex.EncodeToString(node.PNetFingerpint)) |
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.
you can just use %x
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
|
||
var DefaultHostOption HostOption = constructPeerHost | ||
|
||
// isolates the complex initialization steps | ||
func constructPeerHost(ctx context.Context, id peer.ID, ps pstore.Peerstore, bwr metrics.Reporter, fs []*net.IPNet, tpt smux.Transport) (p2phost.Host, error) { | ||
func constructPeerHost(ctx context.Context, id peer.ID, ps pstore.Peerstore, bwr metrics.Reporter, fs []*net.IPNet, tpt smux.Transport, protec ipnet.Protector) (p2phost.Host, error) { |
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.
At some point (not now) I want to make this more simply composed
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, we should probably change it to be struct instead of function args.
LGTM, lets ship this in 0.4.7 |
No description provided.