Skip to content
master
Switch branches/tags
Code

Latest commit

* Become generic over SignedExtra and AdditionalSigned

* Clean code

* [exrinsics] make generic over signed extra (#244)

* cargo build --release --all --exclude test-no-std didn't compile

* changes from review

Co-authored-by: echevrier <edith.chevrier@scs.ch>
Co-authored-by: clangenb <37865735+clangenb@users.noreply.github.com>
edf0c13

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

substrate-api-client

substrate-api-client a library written in Rust for connecting to the substrate's RPC interface via WebSockets allowing to

  • Compose extrinsics, send them and subscribe to updates (synchronously).
  • supports composing extrinsics for no_std builds
  • Watch events and execute code upon events.
  • Parse and print the node metadata.

Prerequisites

In order to build the substrate-api-client and the examples, Rust and the wasm target are needed. For Linux:

curl https://sh.rustup.rs -sSf | sh

rustup default nightly
rustup target add wasm32-unknown-unknown --toolchain nightly

For more information, please refer to the substrate repository.

Substrate node

To execute the examples, a running substrate node is needed. You can download our node artifact from our GitHub Actions CI, which can be found in the 'Actions' tab.

The unpacked node can be run with:

./node-template --dev

Tutorial

There is a detailed tutorial in the tutorials folder.

Examples

To run an example, clone the substrate-api-client repository and run the desired example directly with the cargo command:

    git clone https://github.com/scs/substrate-api-client.git
    cd substrate-api-client
    cargo run --example example_get_storage

Set the output verbosity by prepending RUST_LOG=info or RUST_LOG=debug.

The following examples can be found in the examples folder:

Alternatives

Parity offers a Rust client with similar functionality: https://github.com/paritytech/substrate-subxt

Acknowledgements

The development of substrate-api-client is financed by web3 foundation's grant programme.

We also thank the teams at

About

Library for connecting to substrate API over WebSockets

Resources

License

Stars

Watchers

Forks

Packages

No packages published