A library to submit extrinsics to a substrate node via RPC.
Use the subxt-cli
tool to download the metadata for your target runtime from a node.
bash
cargo install subxt-cli
bash
subxt metadata -f bytes > metadata.scale
This defaults to querying the metadata of a locally running node on the default http://localhost:9933/
. If querying
a different node then the metadata
command accepts a --url
argument.
Declare a module and decorate it with the subxt
attribute which points at the downloaded metadata for the
target runtime:
```rust
pub mod node_runtime { } ```
Important: runtime_metadata_path
resolves to a path relative to the directory where your crate's Cargo.toml
resides (CARGO_MANIFEST_DIR
), not relative to the source file.
API is still a work in progress. See examples for the current usage.
API is still a work in progress. See tests for the current usage.
API is still a work in progress. See examples for the current usage.
Most tests require a running substrate node to communicate with. This is done by spawning an instance of the
substrate node per test. It requires an executable binary substrate
at polkadot-v0.9.10
on your path.
This can be installed from source via cargo:
bash
cargo install --git https://github.com/paritytech/substrate node-cli --tag=polkadot-v0.9.10 --force
Please add your project to this list via a PR.
Alternatives
substrate-api-client provides similar functionality.
The entire code within this repository is licensed under the GPLv3. Please contact us if you have questions about the licensing of our products.