OpenRPC Support #4177
Replies: 2 comments
-
Thank you for the suggestion we will revisit it once we are through the Phase 2 launch, see our timeline: https://near.org/blog/near-mainnet-genesis/ |
Beta Was this translation helpful? Give feedback.
-
@vgrichina @khorolets @chefsale @thisisjoshford @mikedotexe @miraclx I want to bring this proposal to our attention. OpenRPC is a mix of JSON RPC and OpenAPI (Swagger, mostly RESTful-focused API spec and tooling). Currently, we have JSON RPC and RosettaRPC implemented in nearcore. RosettaRPC implementation is much cleaner, but it hides the internal nearcore concepts, and cannot operate on nodes that don't track all shards, so we cannot proclaim RosettaRPC as our "new API". What is interesting, RosettaRPC defines an OpenAPI spec where endpoints are matched against HTTP path, and inputs/outputs are in JSON; this is quite similar to what OpenRPC offers and uses existing OpenAPI tooling. FYI, OpenRPC forked OpenAPI and it has a focus on RPC-like APIs, but overall, OpenAPI has community support while OpenRPC is a relatively new initiative. Both OpenAPI and OpenRPC can solve our pains with using a regular HTTP load-balancers which can have rules based on the URL path. Both OpenAPI and OpenRPC address the documentation side of things if we have an integrated solution which would auto-generate a spec out of our code (I used paperclip for RosettaRPC and it played very well!). OpenAPI spec discovery tooling (web UI which displays the spec in a user-friendly way, and lets users to play with the API right from their web-browser) is not great for JSON inputs (the last time I checked, it was useless and required a user to write down JSON in a plain textarea), and I find the UI quite bloated, so I constantly miss "Try it out" and "Execute" buttons. OpenRPC spec discovery tooling is aware of the challenge and helps users, but the UI is not super intuitive to my taste. What do you think? |
Beta Was this translation helpful? Give feedback.
-
Since this project uses JSON-RPC, I think this project could benefit from integration with OpenRPC which provides a base foundation for service discovery and tooling such as documentation and client generation for JSON-RPC akin to OpenAPI/Swagger.
Here is an example of an ethereum node with the OpenRPC playground, it gets the OpenRPC Document via calling the rpc.discover method:
https://playground.open-rpc.org/?schemaUrl=https://services.jade.builders/core-geth/mainnet/1.11.2
Let me know how I can help.
Beta Was this translation helpful? Give feedback.
All reactions