Skip to content

Commit e8eae7d

Browse files
committed
update formatting for the tutorials section
1 parent 0ea64f7 commit e8eae7d

33 files changed

+633
-630
lines changed

tutorials/dapps/remark-tutorial.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ When the application detects a remark addressed to the specified account, it pla
1717

1818
Before starting, ensure the following tools and dependencies are installed:
1919

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

2525
## Clone the Repository
2626

tutorials/interoperability/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ XCM provides a secure and trustless framework that facilitates communication bet
1818

1919
Learn to establish and use cross-chain communication channels:
2020

21-
- **[Opening HRMP Channels Between Parachains](/tutorials/interoperability/xcm-channels/para-to-para/)** - set up uni- and bidirectional messaging channels between parachains
22-
- **[Opening HRMP Channels with System Parachains](/tutorials/interoperability/xcm-channels/para-to-system/)** - establish communication channels with system parachains using optimized XCM messages
21+
- **[Opening HRMP Channels Between Parachains](/tutorials/interoperability/xcm-channels/para-to-para/)**: Set up uni- and bidirectional messaging channels between parachains.
22+
- **[Opening HRMP Channels with System Parachains](/tutorials/interoperability/xcm-channels/para-to-system/)**: Establish communication channels with system parachains using optimized XCM messages.
2323

2424
## In This Section
2525

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

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ tutorial_badge: Advanced
1010

1111
For establishing communication channels between parachains on the Polkadot network using the Horizontal Relay-routed Message Passing (HRMP) protocol, the following steps are required:
1212

13-
1. **Channel request** - the parachain that wants to open an HRMP channel must make a request to the parachain it wishes to have an open channel with
14-
2. **Channel acceptance** - the other parachain must then accept this request to complete the channel establishment
13+
1. **Channel request**: The parachain that wants to open an HRMP channel must make a request to the parachain it wishes to have an open channel with.
14+
2. **Channel acceptance**: The other parachain must then accept this request to complete the channel establishment.
1515

1616
This process results in a unidirectional HRMP channel, where messages can flow in only one direction between the two parachains.
1717

@@ -23,8 +23,8 @@ Once both unidirectional channels are established, the parachains can send messa
2323

2424
Before proceeding, ensure you meet the following requirements:
2525

26-
- Blockchain network with a relay chain and at least two connected parachains
27-
- Wallet with sufficient funds to execute transactions on the participant chains
26+
- Blockchain network with a relay chain and at least two connected parachains.
27+
- Wallet with sufficient funds to execute transactions on the participant chains.
2828

2929
## Procedure to Initiate an HRMP Channel
3030

@@ -42,12 +42,12 @@ Use [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank}
4242

4343
1. Determine if the parachain is an "up/down" chain (parent or child) or a "sibling" chain:
4444

45-
- Up/down chains use the prefix `0x70617261` (which decodes to `b"para"`)
45+
- Up/down chains use the prefix `0x70617261` (which decodes to `b"para"`).
4646

47-
- Sibling chains use the prefix `0x7369626c` (which decodes to `b"sibl"`)
47+
- 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-
- Parachain 2500 would be encoded as `c4090000`
50+
- Parachain 2500 would be encoded as `c4090000`.
5151

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

@@ -58,19 +58,19 @@ Use [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank}
5858

5959
### Create Channel Opening Extrinsic
6060

61-
1. In Polkadot.js Apps, connect to the relay chain, navigate to the **Developer** dropdown and select the **Extrinsics** option
61+
1. In Polkadot.js Apps, connect to the relay chain, navigate to the **Developer** dropdown and select the **Extrinsics** option.
6262

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

65-
2. Construct an `hrmpInitOpenChannel` extrinsic call
65+
2. Construct an `hrmpInitOpenChannel` extrinsic call.
6666

67-
1. Select the **`hrmp`** pallet
68-
2. Choose the **`hrmpInitOpenChannel`** extrinsic
69-
3. Fill in the parameters
70-
- **`recipient`** - parachain ID of the target chain (in this case, 2600)
71-
- **`proposedMaxCapacity`** - max number of messages that can be pending in the channel at once
72-
- **`proposedMaxMessageSize`** - max message size that could be put into the channel
73-
4. Copy the encoded call data
67+
1. Select the **`hrmp`** pallet.
68+
2. Choose the **`hrmpInitOpenChannel`** extrinsic.
69+
3. Fill in the parameters:
70+
- **`recipient`**: Parachain ID of the target chain (in this case, 2600).
71+
- **`proposedMaxCapacity`**: Max number of messages that can be pending in the channel at once.
72+
- **`proposedMaxMessageSize`**: Max message size that could be put into the channel.
73+
4. Copy the encoded call data.
7474
![](/images/tutorials/interoperability/xcm-channels/para-to-para/hrmp-para-to-para-2.webp)
7575
The encoded call data for opening a channel with parachain 2600 is `0x3c00280a00000800000000001000`.
7676

@@ -82,11 +82,11 @@ This example uses the `sudo` pallet to dispatch the extrinsic. Verify the XCM co
8282

8383
The XCM message should contain the following instructions:
8484

85-
- **`WithdrawAsset`** - withdraws assets from the origin's ownership and places them in the Holding Register
86-
- **`BuyExecution`** - pays for the execution of the current message using the assets in the Holding Register
87-
- **`Transact`** - execute the encoded transaction call
88-
- **`RefundSurplus`** - increases the Refunded Weight Register to the value of the Surplus Weight Register, attempting to reclaim any excess fees paid via BuyExecution
89-
- **`DepositAsset`** - subtracts assets from the Holding Register and deposits equivalent on-chain assets under the specified beneficiary's ownership
85+
- **`WithdrawAsset`**: Withdraws assets from the origin's ownership and places them in the Holding Register.
86+
- **`BuyExecution`**: Pays for the execution of the current message using the assets in the Holding Register.
87+
- **`Transact`**: Execute the encoded transaction call.
88+
- **`RefundSurplus`**: Increases the Refunded Weight Register to the value of the Surplus Weight Register, attempting to reclaim any excess fees paid via BuyExecution.
89+
- **`DepositAsset`**: Subtracts assets from the Holding Register and deposits equivalent on-chain assets under the specified beneficiary's ownership.
9090

9191
!!!note
9292
For more detailed information about XCM's functionality, complexities, and instruction set, refer to the [xcm-format](https://github.com/polkadot-fellows/xcm-format){target=_blank} documentation.
@@ -95,9 +95,9 @@ In essence, this process withdraws funds from the parachain's sovereign account
9595

9696
To send the XCM message to the relay chain, connect to parachain 2500 in Polkadot.js Apps. Fill in the required parameters as shown in the image below, ensuring that you:
9797

98-
1. Replace the **`call`** field with your encoded `hrmpInitOpenChannel` call data from the previous step
99-
2. Use the correct beneficiary information
100-
3. Click the **Submit Transaction** button to dispatch the XCM message to the relay chain
98+
1. Replace the **`call`** field with your encoded `hrmpInitOpenChannel` call data from the previous step.
99+
2. Use the correct beneficiary information.
100+
3. Click the **Submit Transaction** button to dispatch the XCM message to the relay chain.
101101

102102
![](/images/tutorials/interoperability/xcm-channels/para-to-para/hrmp-para-to-para-3.webp)
103103

@@ -106,15 +106,15 @@ To send the XCM message to the relay chain, connect to parachain 2500 in Polkado
106106

107107
After submitting the XCM message to initiate the HRMP channel opening, you should verify that the request was successful. Follow these steps to check the status of your channel request:
108108

109-
1. Using Polkadot.js Apps, connect to the relay chain and navigate to the **Developer** dropdown, then select the **Chain state** option
109+
1. Using Polkadot.js Apps, connect to the relay chain and navigate to the **Developer** dropdown, then select the **Chain state** option.
110110

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

113-
2. Query the HRMP open channel requests
114-
1. Select **`hrmp`**
115-
2. Choose the **`hrmpOpenChannelRequests`** call
116-
3. Click the **+** button to execute the query
117-
4. Check the status of all pending channel requests
113+
2. Query the HRMP open channel requests.
114+
1. Select **`hrmp`**.
115+
2. Choose the **`hrmpOpenChannelRequests`** call.
116+
3. Click the **+** button to execute the query.
117+
4. Check the status of all pending channel requests.
118118

119119
![](/images/tutorials/interoperability/xcm-channels/para-to-para/hrmp-para-to-para-4.webp)
120120

@@ -131,46 +131,46 @@ To fund the account, follow the same process described in the previous section,
131131

132132
### Create Channel Accepting Extrinsic
133133

134-
1. In Polkadot.js Apps, connect to the relay chain, navigate to the **Developer** dropdown and select the **Extrinsics** option
134+
1. In Polkadot.js Apps, connect to the relay chain, navigate to the **Developer** dropdown and select the **Extrinsics** option.
135135

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

138-
2. Construct an `hrmpAcceptOpenChannel` extrinsic call
138+
2. Construct an `hrmpAcceptOpenChannel` extrinsic call:
139139

140-
1. Select the **`hrmp`** pallet
141-
2. Choose the **`hrmpAcceptOpenChannel`** extrinsic
140+
1. Select the **`hrmp`** pallet.
141+
2. Choose the **`hrmpAcceptOpenChannel`** extrinsic.
142142
3. Fill in the parameters:
143-
- **`sender`** - parachain ID of the requesting chain (in this case, 2500)
144-
4. Copy the encoded call data
143+
- **`sender`**: Parachain ID of the requesting chain (in this case, 2500).
144+
4. Copy the encoded call data.
145145
![](/images/tutorials/interoperability/xcm-channels/para-to-para/hrmp-para-to-para-5.webp)
146146
The encoded call data for accepting a channel with parachain 2500 should be `0x3c01c4090000`
147147

148148
### Craft and Submit the XCM Message from the Receiver
149149

150150
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:
151151

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

155155
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:
156156

157-
1. Replace the **`call`** field with your encoded `hrmpAcceptOpenChannel` call data from the previous step
158-
2. Use the correct beneficiary information
159-
3. Click the **Submit Transaction** button to dispatch the XCM message to the relay chain
157+
1. Replace the **`call`** field with your encoded `hrmpAcceptOpenChannel` call data from the previous step.
158+
2. Use the correct beneficiary information.
159+
3. Click the **Submit Transaction** button to dispatch the XCM message to the relay chain.
160160

161161
![](/images/tutorials/interoperability/xcm-channels/para-to-para/hrmp-para-to-para-6.webp)
162162

163163
After submitting the XCM message to accept the HRMP channel opening, verify that the channel has been set up correctly.
164164

165-
1. Using Polkadot.js Apps, connect to the relay chain and navigate to the **Developer** dropdown, then select the **Chain state** option
165+
1. Using Polkadot.js Apps, connect to the relay chain and navigate to the **Developer** dropdown, then select the **Chain state** option.
166166

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

169-
2. Query the HRMP channels
170-
1. Select **`hrmp`**
171-
2. Choose the **`hrmpChannels`** call
172-
3. Click the **+** button to execute the query
173-
4. Check the status of the opened channel
169+
2. Query the HRMP channels:
170+
1. Select **`hrmp`**.
171+
2. Choose the **`hrmpChannels`** call.
172+
3. Click the **+** button to execute the query.
173+
4. Check the status of the opened channel.
174174

175175
![](/images/tutorials/interoperability/xcm-channels/para-to-para/hrmp-para-to-para-7.webp)
176176

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

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ 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
25-
- A wallet containing enough funds to cover transaction fees on each of the participating chains
22+
- A relay chain.
23+
- A parachain.
24+
- An Asset Hub system chain.
25+
- A wallet containing enough funds to cover transaction fees on each of the participating chains.
2626

2727
## Procedure to Establish an HRMP Channel
2828

@@ -41,12 +41,12 @@ Use [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank}
4141

4242
1. Determine if the parachain is an "up/down" chain (parent or child) or a "sibling" chain:
4343

44-
- Up/down chains use the prefix `0x70617261` (which decodes to `b"para"`)
44+
- Up/down chains use the prefix `0x70617261` (which decodes to `b"para"`).
4545

46-
- Sibling chains use the prefix `0x7369626c` (which decodes to `b"sibl"`)
46+
- Sibling chains use the prefix `0x7369626c` (which decodes to `b"sibl"`).
4747

4848
2. Calculate the u32 scale encoded value of the parachain ID:
49-
- Parachain 2500 would be encoded as `c4090000`
49+
- 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

@@ -57,41 +57,41 @@ Use [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank}
5757

5858
### Create Establish Channel with System Extrinsic
5959

60-
1. In Polkadot.js Apps, connect to the relay chain, navigate to the **Developer** dropdown and select the **Extrinsics** option
60+
1. In Polkadot.js Apps, connect to the relay chain, navigate to the **Developer** dropdown and select the **Extrinsics** option.
6161

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

64-
2. Construct an `establish_channel_with_system` extrinsic call
64+
2. Construct an `establish_channel_with_system` extrinsic call:
6565

66-
1. Select the **`hrmp`** pallet
67-
2. Choose the **`establish_channel_with_system`** extrinsic
66+
1. Select the **`hrmp`** pallet.
67+
2. Choose the **`establish_channel_with_system`** extrinsic.
6868
3. Fill in the parameters:
69-
- **`target_system_chain`** - parachain ID of the target system chain (in this case, 1000)
70-
4. Copy the encoded call data
69+
- **`target_system_chain`**: Parachain ID of the target system chain (in this case, 1000).
70+
4. Copy the encoded call data.
7171
![](/images/tutorials/interoperability/xcm-channels/para-to-system/hrmp-para-to-system-1.webp)
7272
The encoded call data for establishing a channel with system parachain 1000 should be `0x3c0ae8030000`
7373

7474
### Craft and Submit the XCM Message
7575

7676
Connect to parachain 2500 using Polkadot.js Apps to send the XCM message to the relay chain. Input the necessary parameters as illustrated in the image below. Make sure to:
7777

78-
1. Insert your previously encoded `establish_channel_with_system` call data into the **`call`** field
79-
2. Provide beneficiary details
80-
3. Dispatch the XCM message to the relay chain by clicking the **Submit Transaction** button
78+
1. Insert your previously encoded `establish_channel_with_system` call data into the **`call`** field.
79+
2. Provide beneficiary details.
80+
3. Dispatch the XCM message to the relay chain by clicking the **Submit Transaction** button.
8181
![](/images/tutorials/interoperability/xcm-channels/para-to-system/hrmp-para-to-system-2.webp)
8282

8383
!!! note
8484
The exact process and parameters for submitting this XCM message may vary depending on your specific parachain and relay chain configurations. Always refer to the most current documentation for your particular network setup.
8585

8686
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:
8787

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

91-
2. Query the HRMP channels
92-
1. Select **`hrmp`** from the options
93-
2. Choose the **`hrmpChannels`** call
94-
3. Click the **+** button to execute the query
91+
2. Query the HRMP channels:
92+
1. Select **`hrmp`** from the options.
93+
2. Choose the **`hrmpChannels`** call.
94+
3. Click the **+** button to execute the query.
9595
![](/images/tutorials/interoperability/xcm-channels/para-to-system/hrmp-para-to-system-3.webp)
9696

9797
3. Examine the query results. You should see output similar to the following:
@@ -101,7 +101,7 @@ After successfully submitting the XCM message to the relay chain, two HRMP chann
101101

102102
The output confirms the successful establishment of two HRMP channels:
103103

104-
- From chain 1000 (system chain) to chain 2500 (parachain)
105-
- From chain 2500 (parachain) to chain 1000 (system chain)
104+
- From chain 1000 (system chain) to chain 2500 (parachain).
105+
- From chain 2500 (parachain) to chain 1000 (system chain).
106106

107107
This bidirectional channel enables direct communication between the system chain and the parachain, allowing for cross-chain message passing.

0 commit comments

Comments
 (0)