subwasm icon indicating copy to clipboard operation
subwasm copied to clipboard

runtime call support

Open gilescope opened this issue 2 years ago • 4 comments

We can get the rpc methods like this:

curl -sS -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "rpc_methods"}' http://localhost:9933/

I don't think there's a way in polkadot at the moment to get the same list of method strings that one can feed into the state_call rpc method. We suggest that people do state call runtime functions rather than doing custom rpc calls because you can add them via a runtime upgrade without needing to update the node. But they are not as discoverable at the moment.

gilescope avatar Jan 09 '23 11:01 gilescope

E.g. state_call "Metadata_metadata" 0x does the equivilent of the rpc metadata call, but discovering this at the moment is not easy.

gilescope avatar Jan 09 '23 11:01 gilescope

I would need to look into that. Keep in mind that subwasm only works off the runtime. If there is a call that does not require storage and returns those functions, there should be an option. subwasm does not call any jsonrpc endpoint (besides the convenience to fetch the runtime from a node).

chevdor avatar Jan 09 '23 11:01 chevdor

The information should be only in the runtime. I had my doubts but now I do think subwasm is the right place.

On Mon, 9 Jan 2023 at 11:52, Chevdor @.***> wrote:

I would need to look into that. Keep in mind that subwasm only works off the runtime. If there is a call that does not require storage and returns those functions, there should be an option. subwasm does not call any jsonrpc endpoint (besides the convenience to fetch the runtime from a node).

— Reply to this email directly, view it on GitHub https://github.com/chevdor/subwasm/issues/59#issuecomment-1375511647, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGEJCB7Y7DJYABK2CU26QLWRP3XRANCNFSM6AAAAAATVJSAKY . You are receiving this because you authored the thread.Message ID: @.***>

gilescope avatar Jan 10 '23 18:01 gilescope

ok, I will investigate.

chevdor avatar Jan 10 '23 19:01 chevdor