jito-foundation / stakenet

Jito StakeNet
https://www.jito.network/stakenet/
Apache License 2.0
40 stars 17 forks source link

Feature: Build a StakeNet API that returns stakenet information in JSON format #8

Open buffalu opened 7 months ago

buffalu commented 7 months ago

Is your feature request related to a problem? Please describe. If users want to explore StakeNet data, they need to use solana libraries and anchor. There should be an API implementation that anyone can host that acts as a proxy, cache, and translation layer which allows easily querying of the ValidatorHistoryAccount in a JSON format.

This API can be useful for any website that wants to show historical information on validator performance!

Describe the solution you'd like A rust, axum-based API in this repository that allows one to query StakeNet data over a variety of endpoints to get information on validator performance.

The server arguments should include the bind IP and port, an RPC URL, the stakenet program IDs (validator history for now), and others. It should spin up an HTTP server and host a variety of endpoints that allow querying the performance of validators at given points in time.

Some of these endpoints can look like the following (I am not an API engineer, please take this with a grain of salt):

dhruvsol commented 7 months ago

Hey, Can I take this? @buffalu

buffalu commented 7 months ago

Hey, Can I take this? @buffalu

yes @dhruvsol! feel free to ping us in discord if you need help.

here's a good start for an axum server we previously built leveraging an RPC client as a translation layer: https://github.com/jito-foundation/distributor/blob/97e134a5f3b3da28130648d93da34100726e6dc9/api/src/main.rs#L51