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ć <marin.versic101@gmail.com>
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
FindPeersdoesn'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 anothertoriiendpointSolution
/peersAlternatives
I see that we have
/statusand/metrics. I'm not sure why we have both since, from what I can see,/statusis 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: