Skip to content

Commit 988aa72

Browse files
committed
update formatting
1 parent 7939998 commit 988aa72

File tree

17 files changed

+829
-698
lines changed

17 files changed

+829
-698
lines changed

llms.txt

Lines changed: 717 additions & 650 deletions
Large diffs are not rendered by default.

tutorials/dapps/remark-tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Before starting, ensure the following tools and dependencies are installed:
1919

2020
- Node.js (version 18 or higher).
2121
- A package manager (npm or yarn).
22-
- [Polkadot.js browser extension (wallet)](https://polkadot.js.org/extension/){target=\_blank}
22+
- [Polkadot.js browser extension (wallet)](https://polkadot.js.org/extension/){target=\_blank}.
2323
- An account with [Westend tokens](https://faucet.polkadot.io/westend){target=\_blank}.
2424

2525
## Clone the Repository

tutorials/interoperability/xcm-channels/para-to-para.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Before proceeding, ensure you meet the following requirements:
3131
This example will demonstrate how to open a channel between parachain 2500 and parachain 2600, using Rococo Local as the relay chain.
3232

3333
### Fund Sender Sovereign Account
34+
3435
<!-- This content will be moved to a new page because it is used in multiple places -->
3536
The [sovereign account](https://github.com/polkadot-fellows/xcm-format/blob/10726875bd3016c5e528c85ed6e82415e4b847d7/README.md?plain=1#L50){target=_blank} for parachain 2500 on the relay chain must be funded so it can take care of any XCM transact fees.
3637

@@ -43,16 +44,16 @@ Use [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank}
4344
1. Determine if the parachain is an "up/down" chain (parent or child) or a "sibling" chain:
4445

4546
- Up/down chains use the prefix `0x70617261` (which decodes to `b"para"`).
46-
4747
- Sibling chains use the prefix `0x7369626c` (which decodes to `b"sibl"`).
4848

4949
2. Calculate the u32 scale encoded value of the parachain ID:
50+
5051
- Parachain 2500 would be encoded as `c4090000`.
5152

5253
3. Combine the prefix and parachain ID encoding to form the full sovereign account address:
5354

5455
The sovereign account of parachain 2500 in relay chain will be `0x70617261c4090000000000000000000000000000000000000000000000000000`
55-
and the SS58 format of this address is `5Ec4AhPSY2GEE4VoHUVheqv5wwq2C1HMKa7c9fVJ1WKivX1Y`
56+
and the SS58 format of this address is `5Ec4AhPSY2GEE4VoHUVheqv5wwq2C1HMKa7c9fVJ1WKivX1Y`.
5657

5758
To perform this conversion, you can also use the **"Para ID" to Address** section in [Substrate Utilities](https://www.shawntabrizi.com/substrate-js-utilities/){target=_blank}.
5859

@@ -62,7 +63,7 @@ Use [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank}
6263

6364
![](/images/tutorials/interoperability/xcm-channels/para-to-para/hrmp-para-to-para-1.webp)
6465

65-
2. Construct an `hrmpInitOpenChannel` extrinsic call.
66+
2. Construct an `hrmpInitOpenChannel` extrinsic call:
6667

6768
1. Select the **`hrmp`** pallet.
6869
2. Choose the **`hrmpInitOpenChannel`** extrinsic.
@@ -71,7 +72,9 @@ Use [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank}
7172
- **`proposedMaxCapacity`**: Max number of messages that can be pending in the channel at once.
7273
- **`proposedMaxMessageSize`**: Max message size that could be put into the channel.
7374
4. Copy the encoded call data.
75+
7476
![](/images/tutorials/interoperability/xcm-channels/para-to-para/hrmp-para-to-para-2.webp)
77+
7578
The encoded call data for opening a channel with parachain 2600 is `0x3c00280a00000800000000001000`.
7679

7780
### Craft and Submit the XCM Message from the Sender
@@ -110,7 +113,8 @@ After submitting the XCM message to initiate the HRMP channel opening, you shoul
110113

111114
![](/images/tutorials/interoperability/xcm-channels/hrmp-channels-1.webp)
112115

113-
2. Query the HRMP open channel requests.
116+
2. Query the HRMP open channel requests:
117+
114118
1. Select **`hrmp`**.
115119
2. Choose the **`hrmpOpenChannelRequests`** call.
116120
3. Click the **+** button to execute the query.
@@ -142,14 +146,16 @@ To fund the account, follow the same process described in the previous section,
142146
3. Fill in the parameters:
143147
- **`sender`**: Parachain ID of the requesting chain (in this case, 2500).
144148
4. Copy the encoded call data.
149+
145150
![](/images/tutorials/interoperability/xcm-channels/para-to-para/hrmp-para-to-para-5.webp)
146-
The encoded call data for accepting a channel with parachain 2500 should be `0x3c01c4090000`
151+
152+
The encoded call data for accepting a channel with parachain 2500 should be `0x3c01c4090000`.
147153

148154
### Craft and Submit the XCM Message from the Receiver
149155

150156
To accept the HRMP channel opening, you need to create and submit an XCM message that includes the encoded `hrmpAcceptOpenChannel` call data from the previous step. This process is similar to the one described in the previous section, [Craft and Submit the XCM Message](#craft-and-submit-the-xcm-message-from-the-sender), with a few key differences:
151157

152-
- Use the encoded call data for `hrmpAcceptOpenChannel` obtained in Step 2 of this section.
158+
- Use the encoded call data for `hrmpAcceptOpenChannel` obtained in step 2 of this section.
153159
- In the last XCM instruction (DepositAsset), set the beneficiary to parachain 2600's sovereign account to receive any surplus funds.
154160

155161
To send the XCM message to the relay chain, connect to parachain 2600 in Polkadot.js Apps. Fill in the required parameters as shown in the image below, ensuring that you:
@@ -167,6 +173,7 @@ After submitting the XCM message to accept the HRMP channel opening, verify that
167173
![](/images/tutorials/interoperability/xcm-channels/hrmp-channels-1.webp)
168174

169175
2. Query the HRMP channels:
176+
170177
1. Select **`hrmp`**.
171178
2. Choose the **`hrmpChannels`** call.
172179
3. Click the **+** button to execute the query.

tutorials/interoperability/xcm-channels/para-to-system.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Any parachain can establish a bidirectional channel with a system chain through
1919
To successfully complete this process, you'll need to have the following in place:
2020

2121
- Access to a blockchain network consisting of:
22-
- A relay chain.
23-
- A parachain.
24-
- An Asset Hub system chain.
22+
- A relay chain
23+
- A parachain
24+
- An Asset Hub system chain
2525
- A wallet containing enough funds to cover transaction fees on each of the participating chains.
2626

2727
## Procedure to Establish an HRMP Channel
@@ -42,16 +42,16 @@ Use [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank}
4242
1. Determine if the parachain is an "up/down" chain (parent or child) or a "sibling" chain:
4343

4444
- Up/down chains use the prefix `0x70617261` (which decodes to `b"para"`).
45-
4645
- Sibling chains use the prefix `0x7369626c` (which decodes to `b"sibl"`).
4746

4847
2. Calculate the u32 scale encoded value of the parachain ID:
48+
4949
- Parachain 2500 would be encoded as `c4090000`.
5050

5151
3. Combine the prefix and parachain ID encoding to form the full sovereign account address:
5252

5353
The sovereign account of parachain 2500 in relay chain will be `0x70617261c4090000000000000000000000000000000000000000000000000000`
54-
and the SS58 format of this address is `5Ec4AhPSY2GEE4VoHUVheqv5wwq2C1HMKa7c9fVJ1WKivX1Y`
54+
and the SS58 format of this address is `5Ec4AhPSY2GEE4VoHUVheqv5wwq2C1HMKa7c9fVJ1WKivX1Y`.
5555

5656
To perform this conversion, you can also use the **"Para ID" to Address** section in [Substrate Utilities](https://www.shawntabrizi.com/substrate-js-utilities/){target=\_blank}.
5757

@@ -69,7 +69,8 @@ Use [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank}
6969
- **`target_system_chain`**: Parachain ID of the target system chain (in this case, 1000).
7070
4. Copy the encoded call data.
7171
![](/images/tutorials/interoperability/xcm-channels/para-to-system/hrmp-para-to-system-1.webp)
72-
The encoded call data for establishing a channel with system parachain 1000 should be `0x3c0ae8030000`
72+
73+
The encoded call data for establishing a channel with system parachain 1000 should be `0x3c0ae8030000`.
7374

7475
### Craft and Submit the XCM Message
7576

@@ -78,6 +79,7 @@ Connect to parachain 2500 using Polkadot.js Apps to send the XCM message to the
7879
1. Insert your previously encoded `establish_channel_with_system` call data into the **`call`** field.
7980
2. Provide beneficiary details.
8081
3. Dispatch the XCM message to the relay chain by clicking the **Submit Transaction** button.
82+
8183
![](/images/tutorials/interoperability/xcm-channels/para-to-system/hrmp-para-to-system-2.webp)
8284

8385
!!! note
@@ -86,15 +88,19 @@ Connect to parachain 2500 using Polkadot.js Apps to send the XCM message to the
8688
After successfully submitting the XCM message to the relay chain, two HRMP channels should be created, establishing bidirectional communication between parachain 2500 and system chain 1000. To verify this, follow these steps:
8789

8890
1. Using Polkadot.js Apps, connect to the relay chain and navigate to the **Developer** dropdown, then select **Chain state**.
91+
8992
![](/images/tutorials/interoperability/xcm-channels/hrmp-channels-1.webp)
9093

9194
2. Query the HRMP channels:
95+
9296
1. Select **`hrmp`** from the options.
9397
2. Choose the **`hrmpChannels`** call.
9498
3. Click the **+** button to execute the query.
99+
95100
![](/images/tutorials/interoperability/xcm-channels/para-to-system/hrmp-para-to-system-3.webp)
96101

97102
3. Examine the query results. You should see output similar to the following:
103+
98104
```json
99105
--8<-- 'code/tutorials/interoperability/xcm-channels/para-to-system/hrmp-query-output.json'
100106
```

tutorials/interoperability/xcm-transfers/from-relaychain-to-parachain.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ The following steps outline how to execute a reserve-backed transfer from the Po
5454
### From the Relay Chain Perspective
5555

5656
1. Navigate to the Extrinsics page:
57+
5758
1. Click on the **Developer** tab from the top navigation bar.
5859
2. Select **Extrinsics** from the dropdown.
5960

@@ -68,14 +69,14 @@ The following steps outline how to execute a reserve-backed transfer from the Po
6869
![](/images/tutorials/interoperability/xcm-transfers/from-relaychain-to-parachain/from-relaychain-to-parachain-04.webp)
6970

7071
4. Fill out the required fields:
71-
1. **dest**: Specifies the destination context for the assets. Commonly set to `[Parent, Parachain(..)]` for parachain-to-parachain transfers or `[Parachain(..)]` for relay chain-to-parachain transfers. In this case, since the transfer is from a relay chain to a parachain, the destination ([`Location`](https://paritytech.github.io/xcm-docs/fundamentals/multilocation/index.html){target=\_blank}) is the following.
72+
73+
1. **dest**: Specifies the destination context for the assets. Commonly set to `[Parent, Parachain(..)]` for parachain-to-parachain transfers or `[Parachain(..)]` for relay chain-to-parachain transfers. In this case, since the transfer is from a relay chain to a parachain, the destination ([`Location`](https://paritytech.github.io/xcm-docs/fundamentals/multilocation/index.html){target=\_blank}) is the following:
7274

7375
```bash
7476
{ parents: 0, interior: { X1: [{ Parachain: 2006 }] } }
7577
```
7678
77-
2. **beneficiary**: Defines the recipient of the assets within the destination context, typically represented as an `AccountId32` value. This example uses the following account present in the destination chain.
78-
79+
2. **beneficiary**: Defines the recipient of the assets within the destination context, typically represented as an `AccountId32` value. This example uses the following account present in the destination chain:
7980
8081
```bash
8182
X2mE9hCGX771c3zzV6tPa8U2cDz4U4zkqUdmBrQn83M3cm7
@@ -127,7 +128,7 @@ To programmatically execute the reserve-backed asset transfer between the relay
127128
- `dot` and `astar` are arbitrary names you assign to the chains, allowing you to access their metadata information.
128129
- The first command uses the well-known Polkadot chain, while the second connects to the Astar chain using its WebSocket endpoint.
129130
130-
4. Create a `index.js` file and insert the following code to configure the clients and handle the asset transfer.
131+
4. Create a `index.js` file and insert the following code to configure the clients and handle the asset transfer:
131132
132133
```js
133134
--8<-- 'code/tutorials/interoperability/xcm-transfers/from-relaychain-to-parachain/reserve-backed-transfer.js'
@@ -136,7 +137,7 @@ To programmatically execute the reserve-backed asset transfer between the relay
136137
!!! note
137138
To use this script with real-world blockchains, you'll need to update the WebSocket endpoint to the appropriate one, replace the Alice account with a valid account, and ensure the account has sufficient funds to cover transaction fees.
138139
139-
4. Execute the script.
140+
4. Execute the script:
140141
141142
```bash
142143
node index.js

tutorials/onchain-governance/fast-track-gov-proposal.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Create a `generateProposal` function that will be responsible for preparing and
132132
133133
Now, you need to implement the following logic:
134134
135-
1. Set up the keyring and use the Alice development account.
135+
1. Set up the keyring and use the Alice development account:
136136
137137
```typescript
138138
--8<-- 'code/tutorials/onchain-governance/fast-track-gov-proposal/test-proposal.ts:40:44'
@@ -141,13 +141,14 @@ Now, you need to implement the following logic:
141141
!!!note
142142
When using Chopsticks, this development account is pre-funded to execute all necessary actions.
143143
144-
2. Retrieve the proposal index.
144+
2. Retrieve the proposal index:
145145
146146
```typescript
147147
--8<-- 'code/tutorials/onchain-governance/fast-track-gov-proposal/test-proposal.ts:46:49'
148148
```
149149
150150
3. Execute a batch transaction that comprises the following three operations:
151+
151152
1. **`preimage.notePreimage`**: Registers a [preimage](/polkadot-protocol/glossary#preimage){target=\_blank} using the selected call.
152153
153154
!!!note

tutorials/polkadot-sdk/parachains/zero-to-hero/add-pallets-to-runtime.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ Launch your parachain locally and start producing blocks:
9999
```
100100

101101
3. Verify you can interact with the new pallets using the [Polkadot.js Apps](https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/extrinsics){target=\_blank} interface. Navigate to the **Extrinsics** tab and check that you can see both pallets:
102+
102103
- Utility pallet
103104

104105
![](/images/tutorials/polkadot-sdk/parachains/zero-to-hero/add-pallets-to-runtime/add-pallets-to-runtime-1.webp)

tutorials/polkadot-sdk/parachains/zero-to-hero/deploy-to-testnet.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ To prepare an account, follow these steps:
2828
![](/images/tutorials/polkadot-sdk/parachains/zero-to-hero/deploy-to-testnet/deploy-to-testnet-1.webp)
2929

3030
2. Navigate to the **Accounts** section:
31+
3132
1. Click on the **Accounts** tab in the top menu.
3233
2. Select the **Accounts** option from the dropdown menu.
3334

@@ -50,12 +51,14 @@ You must reserve a parachain identifier (ID) before registering your parachain o
5051
To reserve a parachain identifier, follow these steps:
5152

5253
1. Navigate to the **Parachains** section:
54+
5355
1. Click on the **Network** tab in the top menu.
5456
2. Select the **Parachains** option from the dropdown menu.
5557

5658
![](/images/tutorials/polkadot-sdk/parachains/zero-to-hero/deploy-to-testnet/deploy-to-testnet-5.webp)
5759

5860
2. Register a ParaId:
61+
5962
1. Select the **Parathreads** tab.
6063
2. Click on the **+ ParaId** button.
6164

@@ -181,11 +184,11 @@ Once you have the genesis state and runtime, you can now register these with you
181184

182185
1. Go to the [Parachains > Parathreads](https://polkadot.js.org/apps/#/parachains/parathreads){target=\_blank} tab, and select **+ Parathread**.
183186

184-
2. You should see fields to place your runtime Wasm and genesis state respectively, along with the parachain ID. Select your parachain ID, and upload `para-wasm` in the **code** field and `para-state` in the **initial state** field:
187+
2. You should see fields to place your runtime Wasm and genesis state respectively, along with the parachain ID. Select your parachain ID, and upload `para-wasm` in the **code** field and `para-state` in the **initial state** field.
185188

186189
![](/images/tutorials/polkadot-sdk/parachains/zero-to-hero/deploy-to-testnet/deploy-to-testnet-9.webp)
187190

188-
3. Confirm your details and **+ Submit** button, where there should be a new Parathread with your parachain ID and an active **Deregister** button:
191+
3. Confirm your details and **+ Submit** button, where there should be a new Parathread with your parachain ID and an active **Deregister** button.
189192

190193
![](/images/tutorials/polkadot-sdk/parachains/zero-to-hero/deploy-to-testnet/deploy-to-testnet-10.webp)
191194

tutorials/polkadot-sdk/parachains/zero-to-hero/pallet-benchmarking.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,35 @@ Follow these steps to prepare your environment for pallet benchmarking:
3131
```
3232

3333
2. Update your pallet's `Cargo.toml` file in the `pallets/custom-pallet` directory by adding the `runtime-benchmarks` feature flag:
34+
3435
```toml hl_lines="4" title="Cargo.toml"
3536
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/pallets/custom-pallet/Cargo.toml:15'
3637
```
3738
3839
3. Add your pallet to the runtime's benchmark configuration:
40+
3941
1. Register your pallet in `runtime/src/benchmarks.rs`:
42+
4043
```rust hl_lines="11" title="benchmarks.rs"
4144
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/runtime/src/benchmarks.rs:26:37'
4245
```
4346

4447
2. Enable runtime benchmarking for your pallet in `runtime/Cargo.toml`:
48+
4549
```toml hl_lines="6" title="Cargo.toml"
4650
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/runtime/Cargo.toml:78:84'
4751
```
4852

4953
4. Set up the benchmarking module in your pallet:
54+
5055
1. Create a new `benchmarking.rs` file in your pallet directory:
56+
5157
```bash
5258
touch benchmarking.rs
5359
```
5460

5561
2. Add the benchmarking module to your pallet. In the pallet `lib.rs` file add the following:
62+
5663
```rust hl_lines="9-10" title="lib.rs"
5764
--8<-- 'code/tutorials/polkadot-sdk/parachains/zero-to-hero/pallets/custom-pallet/src/lib.rs:21:32'
5865
```

tutorials/polkadot-sdk/parachains/zero-to-hero/runtime-upgrade.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,23 +149,23 @@ For more information about runtime versioning, check the [Runtime Upgrades](/dev
149149

150150
### Build the New Runtime
151151

152-
Navigate to your project root:
152+
1. Navigate to your project root:
153153

154-
```bash
155-
cd /path/to/your/parachain-template
156-
```
154+
```bash
155+
cd /path/to/your/parachain-template
156+
```
157157

158-
Build the new runtime:
158+
2. Build the new runtime:
159159

160-
```bash
161-
cargo build --release
162-
```
160+
```bash
161+
cargo build --release
162+
```
163163

164-
Verify that you have the proper WASM builds by executing:
164+
3. Verify that you have the proper WASM builds by executing:
165165

166-
```
167-
ls -la target/release/wbuild/parachain-template-runtime/
168-
```
166+
```
167+
ls -la target/release/wbuild/parachain-template-runtime/
168+
```
169169

170170
If you can see the following elements, it means that you are ready to submit the runtime upgrade to your running chain:
171171

@@ -181,18 +181,21 @@ You can submit a runtime upgrade using the [Sudo pallet](https://paritytech.gith
181181
![](/images/tutorials/polkadot-sdk/parachains/zero-to-hero/runtime-upgrade/runtime-upgrade-02.webp)
182182

183183
3. Prepare the **sudo** call:
184+
184185
1. Select the **sudo** pallet.
185186
2. Select the **sudo(call)** extrinsic from the list.
186187

187188
![](/images/tutorials/polkadot-sdk/parachains/zero-to-hero/runtime-upgrade/runtime-upgrade-03.webp)
188189

189190
4. In the **sudo** call:
191+
190192
1. Select the **system** call.
191193
2. Select **setCode** extrinsic from the list.
192194

193195
![](/images/tutorials/polkadot-sdk/parachains/zero-to-hero/runtime-upgrade/runtime-upgrade-04.webp)
194196

195197
5. For the `code` parameter, click **file upload** and select your WASM runtime file:
198+
196199
- Use `parachain_template_runtime.compact.compressed.wasm` if available (smaller file).
197200
- Otherwise, use `parachain_template_runtime.wasm`.
198201

@@ -212,12 +215,14 @@ After the runtime upgrade extrinsic is included in a block, verify that the upgr
212215
### Check Runtime Version
213216
214217
1. In Polkadot.js Apps, navigate to the **Chain State** section:
218+
215219
1. Click the **Developer** dropdown.
216220
2. Click the **Chain State** option.
217221
218222
![](/images/tutorials/polkadot-sdk/parachains/zero-to-hero/runtime-upgrade/runtime-upgrade-07.webp)
219223
220224
2. Query runtime spec version:
225+
221226
1. Select the **System** pallet.
222227
2. Select the **lastRuntimeUpgrade()** query.
223228
@@ -237,7 +242,7 @@ After the runtime upgrade extrinsic is included in a block, verify that the upgr
237242
2. Select your custom pallet from the dropdown.
238243
3. You should now see the new `resetCounter` function available.
239244
240-
![](/images/tutorials/polkadot-sdk/parachains/zero-to-hero/runtime-upgrade/runtime-upgrade-11.webp)
245+
![](/images/tutorials/polkadot-sdk/parachains/zero-to-hero/runtime-upgrade/runtime-upgrade-11.webp)
241246
242247
Now, you can test the new functionality:
243248

0 commit comments

Comments
 (0)