substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Include runtime API defs into metadata

Open xlc opened this issue 3 years ago • 5 comments
trafficstars

Context: https://github.com/polkadot-js/api/issues/4930

This will help client to query the available runtime APIs and able to invoke them with correct data.

xlc avatar Jun 12 '22 11:06 xlc

cc @ascjones

This should be added to the sp_api::decl_runtime_apis! proc macro. It is essentially the same that ink! does for its messages minus selector generation.

athei avatar Jul 06 '22 12:07 athei

Given that we're pushing more people to use state Call on the grounds that runtime api calls are on-chain upgradable (unlike rpc calls), we really do need to include them in the metadata. It's currently not a great dev experience that people code them up and then don't see them in the polkadot-js when they run it against their new chain.

gilescope avatar Jul 21 '22 13:07 gilescope

I agree. However, the same is true for RPCs. So it doesn't make it worse at least.

athei avatar Jul 21 '22 15:07 athei

Yeah, you also only see available rpc calls, but that is all. You don't see parameters that you need to pass and that you get back.

bkchr avatar Jul 26 '22 15:07 bkchr

No but RPCs were never on chain upgradable so this is very much an awesomeness unlock.

On Thu, 21 Jul 2022 at 16:29, Alexander Theißen @.***> wrote:

I agree. However, the same is true for RPCs. So it doesn't make it worse at least.

— Reply to this email directly, view it on GitHub https://github.com/paritytech/substrate/issues/11648#issuecomment-1191631766, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGEJCFUAT7G5XMKYMD6753VVFUELANCNFSM5YRS5S6Q . You are receiving this because you commented.Message ID: @.***>

gilescope avatar Oct 11 '22 07:10 gilescope

addressed in https://github.com/paritytech/substrate/pull/13302

agryaznov avatar Feb 14 '23 12:02 agryaznov

The PR which added RuntimeAPI support for the metadata

  • https://github.com/paritytech/substrate/pull/13302

Stabilization PR for the Metadata V15 (features added to the V15 included in the PR description for more details):

  • https://github.com/paritytech/substrate/pull/14481

lexnv avatar Jul 19 '23 10:07 lexnv