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

feat: discover nodes from a specific peer #920

Merged
merged 3 commits into from
May 20, 2019
Merged

feat: discover nodes from a specific peer #920

merged 3 commits into from
May 20, 2019

Conversation

moshababo
Copy link
Collaborator

Discover nodes from a specific peer, apply new connections, and return the list to the client.

@moshababo moshababo requested a review from sangaman April 27, 2019 16:12
@ghost ghost assigned moshababo Apr 27, 2019
@ghost ghost added the in progress label Apr 27, 2019
@@ -374,6 +377,14 @@ class Service extends EventEmitter {
return this.orderBook.removePair(pairId);
}

/** Removes a trading pair. */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment doesn't match up with the method.

string peer_pub_key = 1 [json_name = "peer_pub_key"];
}
message DiscoverNodesResponse {
repeated NodeConnectionInfo nodes = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conceptually I'm wondering whether we want to actually return all the connection info we get from the peer. I am not sure whether that would be useful.

I'm thinking this call would be used to tell xud to find new peers, but the caller can't actually act on the nodepubkeys and all the addresses we discover, that's all handled internally. Instead we could just return the number of nodes that we discovered, or maybe just a list of pub keys (which can then be used to call getnodeinfo if we want more details). Thoughts @kilrau?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "Discovered X new nodes" as response would be good. If the delta of "new nodes" is hard to calculate just go with "Discovered X nodes".

Copy link
Collaborator Author

@moshababo moshababo May 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first option would require some infra work, so I went for the latter, since the use-case is quite limited.

@sangaman sangaman added grpc gRPC API p2p Peer to peer networking labels Apr 29, 2019
@moshababo moshababo requested a review from sangaman May 7, 2019 13:36
Copy link
Collaborator

@sangaman sangaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just needs a rebase to resolve conflicts. Thanks.

@moshababo moshababo merged commit 1caa2a7 into master May 20, 2019
@moshababo moshababo deleted the discovernodes branch May 20, 2019 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grpc gRPC API in progress p2p Peer to peer networking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants