5

I added some custom RPC endpoints to a substrate blockchain, but when I connect to the node with a simple script it prints:

API/INIT: RPC methods not decorated: ...

The RPCs work, but don't show up in the polkadot Apps.

How can I decorate my custom RPC endpoints and will they show up in the polkadot Apps afterwards?

1
  • i am sure there is a command to run but you can add the the custom rpc types in spec/typeBundle.js in polkadot Apps directory Jan 5 at 8:47

1 Answer 1

8

The only information that is exposed to APIs are the names of the RPCs, this excludes -

  • the actual description of the method (optional, but useful in some case)
  • the actual input parameters and their types
  • the actual return type

So in this case the API is correct - it can see that there is a methods, but if has no idea how to "decorate" it since it has no information about the input and output parameters. (This is unlike anything exposed by the runtime, e.g. state/extrinsics/errors since with metadata v14 we have all the pertinent information on these, including the types)

You would need to manually fully describe the methods and add it to the API initialization options

For the apps UI specifically, this is specified in the apps-config package on a per-chain/runtime basis.

1

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.