0

I was checking the rpc methods in polkadot explorer and I see a lot of rpc shown as output when queried rpc-> methods. But I don't see some of them inside the rpc field. for example rpc methods returned chain_getRuntimeVersion but when I checked through field chain it shows only chain_getBlock, chain_getFinalizedHeadetc but no chain_getRuntimeVersion.

Is there any particular reason behind this?

5
  • By default there are some RPC methods that are manually enforced to be included there: github.com/paritytech/smoldot/blob/…
    – Alex Bean
    Commented Oct 24, 2022 at 10:29
  • I see. But this is actually incase of smoldot right, I'm talking more in terms of polakdot/api because when I queried api.rpc.chain.getRuntimeVersion() it failed. But api.rpc.chain.getBlock() is working so a bit confused on that
    – kroos47
    Commented Oct 24, 2022 at 11:20
  • yes, because from chain the only methods that are available to execute as api.rpc.chain are chain_getBlock, chain_getBlockHash, chain_getFinalisedHead and chain_getHeader
    – Alex Bean
    Commented Oct 24, 2022 at 11:26
  • Sorry for the link above, the code for substrate is defined here: github.com/paritytech/substrate/blob/master/client/rpc-api and your specific pallet: github.com/paritytech/substrate/blob/master/client/rpc-api/src/…
    – Alex Bean
    Commented Oct 24, 2022 at 11:31
  • yeh makes sense, so if I want to query chain_getRuntimeVersion, through polkadot-js or chain what do I need to enable that? Or is that not at all possible, I see that chain_getRuntimeVersion is a runtime api.
    – kroos47
    Commented Oct 25, 2022 at 5:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.