Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Example usage via `jsonrpsee` feature:
use subxt_rpcs::{RpcClient, ChainHeadRpcMethods};

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

Expand Down
4 changes: 4 additions & 0 deletions rpcs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,9 @@ tower = { workspace = true }
hyper = { workspace = true }
http-body = { workspace = true }

[package.metadata.docs.rs]
default-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints]
workspace = true
18 changes: 18 additions & 0 deletions rpcs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# subxt-rpcs

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

```rust
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..
}
```