This package essentially contains some code written in RUST that
- connects to a Logion para- or solo-chain.
- displays some info queried in the storage.
Among others, one possible usage is to write migrations that do not fit in one block.
It relies on subxt (doc / book / github / examples)
- Pre-requisite: install subxt-cli:
cargo install subxt-cli
- Generate metadata
Similarly to typescript, metadata are generated by running this command
(nnn
is the value of spec_version
).
subxt metadata --url wss://dev-rpc01.logion.network -f bytes > ./metadata/logion-nnn.scale
subxt metadata --url wss://dev-rpc01.logion.network -f json > ./metadata/logion-nnn.json
Note that json format is not directly used but is useful for comparing metadata from different nodes/versions.
The generated scale file needs to be references in the code:
#[subxt::subxt(runtime_metadata_path = "metadata/logion-nnn.scale")]
pub mod polkadot {}
cargo run