subxt-rpcs

Crates.iosubxt-rpcs
lib.rssubxt-rpcs
version0.44.0
created_at2025-03-11 15:40:41.261673+00
updated_at2025-08-29 11:16:32.342803+00
descriptionMake RPC calls to Substrate based nodes
homepagehttps://www.parity.io/
repositoryhttps://github.com/paritytech/subxt
max_upload_size
id1588059
size261,271
James Wilson (jsdw)

documentation

https://docs.rs/subxt

README

subxt-rpcs

This crate provides an interface for interacting with Substrate nodes via the available RPC methods.

use subxt_rpcs::{RpcClient, ChainHeadRpcMethods};

// Connect to a local node:
let client = RpcClient::from_url("ws://127.0.0.1:9944").await?;
// Use a set of methods, here the V2 "chainHead" ones:
let methods = ChainHeadRpcMethods::new(client);

// Call some RPC methods (in this case a subscription):
let mut follow_subscription = methods.chainhead_v1_follow(false).await.unwrap();
while let Some(follow_event) = follow_subscription.next().await {
    // do something with events..
}
Commit count: 1201

cargo fmt