Subwasm

subwasm is an essential utility for Substrate developers and users. It allows inspecting any Substrate WASM runttime. A WASM Blob is by nature not very readable. Prior the development of subwasm, a running node was required to inspect a runtime.

subwasm voids this requirements. It is a Rust utility that allows inspecting a Substrate WASM runtime without having to run a node. It can be used to extract metadata, call some of the functions, and inspect the storage of a Substrate runtime and would not even require an internet connection (assuming you already have a runtime locally).

subwasm is used within srtool to extract metadata from a runtime that was just built.

subwasm allows knowing exaxctly the content of a runtime without the need to run a node. It is a great tool for users and for automation.

You may install subwasm using homebrew or cargo or build it yourself:

Homebrew
brew tap chevdor/subwasm https://github.com/chevdor/subwasm
brew install subwasm
Cargo
cargo install --locked --git https://github.com/chevdor/subwasm

You may then use it to inspect a runtime. subwasm can also fetch a runtime from a chain. Wondering what is the current runtime version ?

subwasm version --chain dot

will fetch the metadata of the Polkadot runtime, then show you the runtime version:

specifications : polkadot v1003004
implementation : parity-polkadot v0
transaction    : v26
authoring      : v0

You can find the project at: https://github.com/chevdor/subwasm and see how to list pallets, query the details of a specific pallet, retrieve the entire metadata in various formats and much more.

Avatar
Wilfried Kopp aka. Chevdor
Building Blockchains & Decentralized Solutions

I build decentralized solutions and tooling to support them. I am developing Smart Contracts and dApps on Ethereum and developing tooling for Substrate (Polkadot & Kusama). I love Rust! I am using Docker extensively and above all I like efficiency. GPG Fingerprint 15AF C574 D3F9 F1C3 CCDD E31E 2DCE C4DC 506E 6475.

Related