-
Notifications
You must be signed in to change notification settings - Fork 276
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: add /peers API endpoint to torii #5235
Conversation
d7ff3ac
to
d3478d5
Compare
d3478d5
to
a20bc53
Compare
Well, in fact, the What do you think? |
I noticed this. While I agree that introducing a new endpoint is not as nice, my thinking was that |
Mmm, I think we could advise users to use sub-routing at all times. If they don't, well, they'll get a large piece of JSON. Still, even thousands of pubkey strings isn't that enormous, and happens in big production environments. If someone works with a really huge network, they would be probably knowledgeable of sub-routing feature. In addition, it could be useful to not just add |
May I then suggest that |
Code-wise - looking good. Design-wise - also not a fan of additional endpoints.
How about |
Signed-off-by: Marin Veršić <[email protected]>
a20bc53
to
a50578d
Compare
Context
Ever since #5117 clients have lost the ability to find about other nodes in the network except for the node they are connecting to. This is because
FindPeers
doesn't return address anymore, just peers's public key. We can't return data that is not on chain in this query so I've implemented anothertorii
endpointSolution
/peers
Alternatives
I see that we have
/status
and/metrics
. I'm not sure why we have both since, from what I can see,/status
is a superset of `/metrics. Considering this, I can make it so that peers are returned on one of those endpoints instead of adding a new point. I implemented this functionality on a separate endpoint because: