Coder Social home page Coder Social logo

Comments (4)

niklasad1 avatar niklasad1 commented on August 16, 2024 1

we already got an issue for that paritytech/jsonrpsee#737 but just a matter to get someone working on it :)

from capi.

niklasad1 avatar niklasad1 commented on August 16, 2024

It's really tricky because these rpc's can be defined in so many places in substrate, frame, runtime APIs, RPC extensions and similar.

Ideally, I would want to have a method e.g. "rpc_methods/rpc.discover" to have all information from a node which RPC methods it exposes to generate the RPC API with parameters and return types.

There is this https://spec.open-rpc.org/#openrpc-document which is a standard how to this in JSON-RPC v2 which looks cool
but we haven't looked into it and how well it works with all the generics stuff in substrate.

from capi.

harrysolovay avatar harrysolovay commented on August 16, 2024

There is this https://spec.open-rpc.org/#openrpc-document which is a standard how to this in JSON-RPC v2 which looks cool

This spec looks fantastic; in fact, it seems trpc––a popular TS dev tool––complies with the OpenRPC specification. Very promising.

As we build out more libraries, utilizing a single source of truth for RPC types (and devising an approach to handle variation across chains) will become a necessity. The rpc.discover method would address this need quite well; it would even enable the generation of narrow typings for errors of each method.

I can imagine that this would entail a non-trivial amount of work. Perhaps a first pass could omit the method result content descriptors / reference objects. Meanwhile, params are usually just numbers / hex-encoded strings; these would be simpler to represent than the complex generic types of Substrate.

^ might not be helpful, just hoping to get the ball rolling. Let me know if I should transfer this issue to one of your repos. Might make for a good backlog item.

from capi.

tjjfvi avatar tjjfvi commented on August 16, 2024

We'll be using state_call, so we won't need these types.

from capi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.