Skip to content

Commit 8a68ca2

Browse files
committed
Apply suggestions
1 parent 45dbb69 commit 8a68ca2

File tree

2 files changed

+41
-49
lines changed

2 files changed

+41
-49
lines changed

develop/toolkit/api-libraries/subxt.md

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,42 +23,38 @@ Before using subxt, ensure you have the following installed:
2323

2424
To use subxt in your project, you need to install the necessary dependencies. Each plays a specific role in enabling interaction with the blockchain:
2525

26-
### Install the Subxt CLI
26+
1. Install the subxt CLI - [`subxt-cli`](https://crates.io/crates/subxt-cli){target=\_blank} is a command-line tool that provides utilities for working with Polkadot SDK metadata. In the context of subxt, it is essential for downloading chain metadata, which is required to generate type-safe Rust interfaces for interacting with the blockchain. Install it using:
2727

28-
[`subxt-cli`](https://crates.io/crates/subxt-cli){target=\_blank} is a command-line tool that provides utilities for working with Polkadot SDK metadata. In the context of subxt, it is essential for downloading chain metadata, which is required to generate type-safe Rust interfaces for interacting with the blockchain. Install it using:
28+
```bash
29+
cargo install subxt-cli
30+
```
2931

30-
```bash
31-
cargo install subxt-cli
32-
```
32+
2. Add core dependencies - these dependencies are essential for interacting with the blockchain:
3333

34-
### Add Core Dependencies
34+
- **[subxt](https://crates.io/crates/subxt){target=\_blank}** - the main library for communicating with Polkadot SDK nodes. It handles RPC requests, encoding/decoding, and type generation
3535

36-
These dependencies are essential for interacting with the blockchain:
36+
```bash
37+
cargo add subxt
38+
```
3739

38-
- **[subxt](https://crates.io/crates/subxt){target=\_blank}** - the main library for communicating with Polkadot SDK nodes. It handles RPC requests, encoding/decoding, and type generation
40+
- **[subxt-signer](https://crates.io/crates/subxt-signer){target=\_blank}** - provides cryptographic functionality for signing transactions. Without this, you can only read data but cannot submit transactions
3941

40-
```bash
41-
cargo add subxt
42-
```
42+
```bash
43+
cargo add subxt-signer
44+
```
4345

44-
- **[subxt-signer](https://crates.io/crates/subxt-signer){target=\_blank}** - provides cryptographic functionality for signing transactions. Without this, you can only read data but cannot submit transactions
46+
- **[tokio](https://crates.io/crates/tokio){target=\_blank}** - an asynchronous runtime for Rust. Since blockchain operations are async, Tokio enables efficient handling of network requests. The `rt` feature enables Tokio’s runtime, including the current-thread single-threaded scheduler, necessary for async execution. The `macros` feature provides procedural macros like `#[tokio::main]` to simplify runtime setup
4547

46-
```bash
47-
cargo add subxt-signer
48-
```
48+
```bash
49+
cargo add tokio --features rt,macros
50+
```
4951

50-
- **[tokio](https://crates.io/crates/tokio){target=\_blank}** - an asynchronous runtime for Rust. Since blockchain operations are async, Tokio enables efficient handling of network requests. The `rt` feature enables Tokio’s runtime, including the current-thread single-threaded scheduler, necessary for async execution. The `macros` feature provides procedural macros like `#[tokio::main]` to simplify runtime setup
52+
After adding the dependencies, your `Cargo.toml` should look like this:
5153

52-
```bash
53-
cargo add tokio --features rt,macros
54+
```toml
55+
--8<-- 'code/develop/toolkit/api-libraries/subxt/Cargo.toml'
5456
```
5557

56-
After adding the dependencies, your `Cargo.toml` should look like this:
57-
58-
```toml
59-
--8<-- 'code/develop/toolkit/api-libraries/subxt/Cargo.toml'
60-
```
61-
6258
## Get Started
6359

6460
This guide will walk you through the fundamental operations of subxt, from setting up your environment to executing transactions and querying blockchain state.

llms.txt

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7792,40 +7792,36 @@ Before using subxt, ensure you have the following installed:
77927792

77937793
To use subxt in your project, you need to install the necessary dependencies. Each plays a specific role in enabling interaction with the blockchain:
77947794

7795-
### Install the Subxt CLI
7795+
1. Install the subxt CLI - [`subxt-cli`](https://crates.io/crates/subxt-cli){target=\_blank} is a command-line tool that provides utilities for working with Polkadot SDK metadata. In the context of subxt, it is essential for downloading chain metadata, which is required to generate type-safe Rust interfaces for interacting with the blockchain. Install it using:
77967796

7797-
[`subxt-cli`](https://crates.io/crates/subxt-cli){target=\_blank} is a command-line tool that provides utilities for working with Polkadot SDK metadata. In the context of subxt, it is essential for downloading chain metadata, which is required to generate type-safe Rust interfaces for interacting with the blockchain. Install it using:
7798-
7799-
```bash
7800-
cargo install subxt-cli
7801-
```
7802-
7803-
### Add Core Dependencies
7797+
```bash
7798+
cargo install subxt-cli
7799+
```
78047800

7805-
These dependencies are essential for interacting with the blockchain:
7801+
2. Add core dependencies - these dependencies are essential for interacting with the blockchain:
78067802

7807-
- **[subxt](https://crates.io/crates/subxt){target=\_blank}** - the main library for communicating with Polkadot SDK nodes. It handles RPC requests, encoding/decoding, and type generation
7803+
- **[subxt](https://crates.io/crates/subxt){target=\_blank}** - the main library for communicating with Polkadot SDK nodes. It handles RPC requests, encoding/decoding, and type generation
78087804

7809-
```bash
7810-
cargo add subxt
7811-
```
7805+
```bash
7806+
cargo add subxt
7807+
```
78127808

7813-
- **[subxt-signer](https://crates.io/crates/subxt-signer){target=\_blank}** - provides cryptographic functionality for signing transactions. Without this, you can only read data but cannot submit transactions
7809+
- **[subxt-signer](https://crates.io/crates/subxt-signer){target=\_blank}** - provides cryptographic functionality for signing transactions. Without this, you can only read data but cannot submit transactions
78147810

7815-
```bash
7816-
cargo add subxt-signer
7817-
```
7811+
```bash
7812+
cargo add subxt-signer
7813+
```
78187814

7819-
- **[tokio](https://crates.io/crates/tokio){target=\_blank}** - an asynchronous runtime for Rust. Since blockchain operations are async, Tokio enables efficient handling of network requests. The `rt` feature enables Tokio’s runtime, including the current-thread single-threaded scheduler, necessary for async execution. The `macros` feature provides procedural macros like `#[tokio::main]` to simplify runtime setup
7815+
- **[tokio](https://crates.io/crates/tokio){target=\_blank}** - an asynchronous runtime for Rust. Since blockchain operations are async, Tokio enables efficient handling of network requests. The `rt` feature enables Tokio’s runtime, including the current-thread single-threaded scheduler, necessary for async execution. The `macros` feature provides procedural macros like `#[tokio::main]` to simplify runtime setup
78207816

7821-
```bash
7822-
cargo add tokio --features rt,macros
7823-
```
7817+
```bash
7818+
cargo add tokio --features rt,macros
7819+
```
78247820

7825-
After adding the dependencies, your `Cargo.toml` should look like this:
7821+
After adding the dependencies, your `Cargo.toml` should look like this:
78267822

7827-
```toml
7828-
[package]
7823+
```toml
7824+
[package]
78297825
name = "my-project"
78307826
version = "0.1.0"
78317827
edition = "2021"
@@ -7834,7 +7830,7 @@ edition = "2021"
78347830
subxt = "0.39.0"
78357831
subxt-signer = "0.39.0"
78367832
tokio = { version = "1.43.0", features = ["rt", "macros"] }
7837-
```
7833+
```
78387834

78397835
## Get Started
78407836

0 commit comments

Comments
 (0)