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

Implement ListPeers in the node API #8288

Merged
merged 21 commits into from
Jan 20, 2021
Merged

Conversation

rkapka
Copy link
Contributor

@rkapka rkapka commented Jan 19, 2021

What type of PR is this?

Feature

What does this PR do? Why is it needed?

This PR implements Node API's ListPeers method according to the spec: https://ethereum.github.io/eth2.0-APIs/#/Node/getPeers

Which issues(s) does this PR fix?

Part of #7510

Other notes for review

Currently ethpb.PeersRequest's State and Direction fields are string arrays. I would like them to be ethpb.ConnectionState and ethpb.PeerDirection arrays, respectively. I will test if this is possible once @0xKiwi's PR with v1 gateway code is merged. I added a new checkbox to #7510, so that it's not forgotten about.

@rkapka rkapka requested a review from a team as a code owner January 19, 2021 13:56
@rkapka rkapka added API Api related tasks Ready For Review labels Jan 19, 2021
}

// PeerCount retrieves retrieves number of known peers.
func (ns *Server) PeerCount(ctx context.Context, _ *ptypes.Empty) (*ethpb.PeerCountResponse, error) {
Copy link
Contributor Author

@rkapka rkapka Jan 19, 2021

Choose a reason for hiding this comment

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

Side-effect of prysmaticlabs/ethereumapis#214 - I had to add this function to conform to the new proto definitions.

@codecov
Copy link

codecov bot commented Jan 19, 2021

Codecov Report

❗ No coverage uploaded for pull request base (develop@4b14fa4). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             develop    #8288   +/-   ##
==========================================
  Coverage           ?   57.12%           
==========================================
  Files              ?      449           
  Lines              ?    31524           
  Branches           ?        0           
==========================================
  Hits               ?    18007           
  Misses             ?    10723           
  Partials           ?     2794           

rauljordan
rauljordan previously approved these changes Jan 20, 2021
@prylabs-bulldozer prylabs-bulldozer bot merged commit 1537378 into develop Jan 20, 2021
@delete-merged-branch delete-merged-branch bot deleted the list-peers-node-api branch January 20, 2021 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Api related tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants