chevdor / subwasm

Subwasm is a cli utility to look inside a Substrate WASM Runtime. It can inspect and compare the metadata of Substrate based runtimes such as Polkadot or Kusama.
MIT License
62 stars 25 forks source link

runtime call support #59

Open gilescope opened 1 year ago

gilescope commented 1 year ago

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 commented 1 year ago

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

chevdor commented 1 year ago

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).

gilescope commented 1 year ago

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: @.***>

chevdor commented 1 year ago

ok, I will investigate.