You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once subxt interfaces are generated, you can interact with your node in the following ways:
83
+
84
+
- **Transactions** - builds and submits transactions, monitors their inclusion in blocks, and retrieves associated events
85
+
- **Storage** - enables querying of node storage data
86
+
- **Events** - retrieves events emitted from recent blocks
87
+
- **Constants** - accesses constant values stored in nodes that remain unchanged across a specific runtime version.
88
+
- **Blocks** - loads recent blocks or subscribes to new/finalized blocks, allowing examination of extrinsics, events, and storage at those blocks
89
+
- **Runtime APIs** - makes calls into pallet runtime APIs to fetch data
90
+
- **Custom values** - accesses "custom values" contained within metadata
91
+
- **Raw RPC calls** - facilitates raw RPC requests to compatible nodes
92
+
92
93
### Initializing the Subxt client
93
94
94
95
To interact with a blockchain node using Subxt, create an asynchronous main functionand initialize the client. Replace `INSERT_NODE_URL` with the URL of your target node:
95
96
96
97
```rust
97
-
use std::str::FromStr;
98
-
use subxt::utils::AccountId32;
99
-
use subxt::{OnlineClient, PolkadotConfig};
100
-
use subxt_signer::{bip39::Mnemonic,sr25519::Keypair};
Once subxt interfaces are generated, you can interact with your node in the following ways:
7858
+
7859
+
- **Transactions** - builds and submits transactions, monitors their inclusion in blocks, and retrieves associated events
7860
+
- **Storage** - enables querying of node storage data
7861
+
- **Events** - retrieves events emitted from recent blocks
7862
+
- **Constants** - accesses constant values stored in nodes that remain unchanged across a specific runtime version.
7863
+
- **Blocks** - loads recent blocks or subscribes to new/finalized blocks, allowing examination of extrinsics, events, and storage at those blocks
7864
+
- **Runtime APIs** - makes calls into pallet runtime APIs to fetch data
7865
+
- **Custom values** - accesses "custom values" contained within metadata
7866
+
- **Raw RPC calls** - facilitates raw RPC requests to compatible nodes
7867
+
7858
7868
### Initializing the Subxt client
7859
7869
7860
7870
To interact with a blockchain node using Subxt, create an asynchronous main function and initialize the client. Replace `INSERT_NODE_URL` with the URL of your target node:
@@ -7865,6 +7875,10 @@ use subxt::utils::AccountId32;
7865
7875
use subxt::{OnlineClient, PolkadotConfig};
7866
7876
use subxt_signer::{bip39::Mnemonic,sr25519::Keypair};
7867
7877
7878
+
// Generate an interface that we can use from the node's metadata.
0 commit comments