File tree 5 files changed +27
-1
lines changed
5 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ Example usage via `jsonrpsee` feature:
27
27
use subxt_rpcs :: {RpcClient , ChainHeadRpcMethods };
28
28
29
29
// Connect to a local node:
30
- let client = RpcClient :: (" ws://127.0.0.1:9944" ). await ? ;
30
+ let client = RpcClient :: from_url (" ws://127.0.0.1:9944" ). await ? ;
31
31
// Use chainHead/archive V2 methods:
32
32
let methods = ChainHeadRpcMethods :: new (client );
33
33
Original file line number Diff line number Diff line change @@ -94,5 +94,9 @@ tower = { workspace = true }
94
94
hyper = { workspace = true }
95
95
http-body = { workspace = true }
96
96
97
+ [package .metadata .docs .rs ]
98
+ default-features = true
99
+ rustdoc-args = [" --cfg" , " docsrs" ]
100
+
97
101
[lints ]
98
102
workspace = true
Original file line number Diff line number Diff line change
1
+ # subxt-rpcs
2
+
3
+ This crate provides an interface for interacting with Substrate nodes via the available RPC methods.
4
+
5
+ ``` rust
6
+ use subxt_rpcs :: {RpcClient , ChainHeadRpcMethods };
7
+
8
+ // Connect to a local node:
9
+ let client = RpcClient :: from_url (" ws://127.0.0.1:9944" ). await ? ;
10
+ // Use a set of methods, here the V2 "chainHead" ones:
11
+ let methods = ChainHeadRpcMethods :: new (client );
12
+
13
+ // Call some RPC methods (in this case a subscription):
14
+ let mut follow_subscription = methods . chainhead_v1_follow (false ). await . unwrap ();
15
+ while let Some (follow_event ) = follow_subscription . next (). await {
16
+ // do something with events..
17
+ }
18
+ ```
Original file line number Diff line number Diff line change 16
16
//! The provided RPC client implementations can be used natively (with the default `native` feature
17
17
//! flag) or in WASM based web apps (with the `web` feature flag).
18
18
19
+ #![ cfg_attr( docsrs, feature( doc_cfg) ) ]
20
+
19
21
#[ cfg( any(
20
22
all( feature = "web" , feature = "native" ) ,
21
23
not( any( feature = "web" , feature = "native" ) )
Original file line number Diff line number Diff line change 4
4
5
5
//! Subxt utils fetch metadata.
6
6
7
+ #![ cfg_attr( docsrs, feature( doc_cfg) ) ]
8
+
7
9
// Internal helper macros
8
10
#[ macro_use]
9
11
mod macros;
You can’t perform that action at this time.
0 commit comments