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
Copy file name to clipboardExpand all lines: tutorials/interoperability/index.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,8 @@ XCM provides a secure and trustless framework that facilitates communication bet
18
18
19
19
Learn to establish and use cross-chain communication channels:
20
20
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.
Copy file name to clipboardExpand all lines: tutorials/interoperability/xcm-channels/para-to-para.md
+47-47Lines changed: 47 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,8 @@ tutorial_badge: Advanced
10
10
11
11
For establishing communication channels between parachains on the Polkadot network using the Horizontal Relay-routed Message Passing (HRMP) protocol, the following steps are required:
12
12
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.
15
15
16
16
This process results in a unidirectional HRMP channel, where messages can flow in only one direction between the two parachains.
17
17
@@ -23,8 +23,8 @@ Once both unidirectional channels are established, the parachains can send messa
23
23
24
24
Before proceeding, ensure you meet the following requirements:
25
25
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.
28
28
29
29
## Procedure to Initiate an HRMP Channel
30
30
@@ -42,12 +42,12 @@ Use [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank}
42
42
43
43
1. Determine if the parachain is an "up/down" chain (parent or child) or a "sibling" chain:
44
44
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"`).
46
46
47
-
- Sibling chains use the prefix `0x7369626c` (which decodes to `b"sibl"`)
47
+
- Sibling chains use the prefix `0x7369626c` (which decodes to `b"sibl"`).
48
48
49
49
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`.
51
51
52
52
3. Combine the prefix and parachain ID encoding to form the full sovereign account address:
53
53
@@ -58,19 +58,19 @@ Use [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank}
58
58
59
59
### Create Channel Opening Extrinsic
60
60
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.
The encoded call data for opening a channel with parachain 2600 is `0x3c00280a00000800000000001000`.
76
76
@@ -82,11 +82,11 @@ This example uses the `sudo` pallet to dispatch the extrinsic. Verify the XCM co
82
82
83
83
The XCM message should contain the following instructions:
84
84
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.
90
90
91
91
!!!note
92
92
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
95
95
96
96
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:
97
97
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.
@@ -106,15 +106,15 @@ To send the XCM message to the relay chain, connect to parachain 2500 in Polkado
106
106
107
107
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:
108
108
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.
The encoded call data for accepting a channel with parachain 2500 should be `0x3c01c4090000`
147
147
148
148
### Craft and Submit the XCM Message from the Receiver
149
149
150
150
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:
151
151
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.
154
154
155
155
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:
156
156
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.
The encoded call data for establishing a channel with system parachain 1000 should be `0x3c0ae8030000`
73
73
74
74
### Craft and Submit the XCM Message
75
75
76
76
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:
77
77
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.
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.
85
85
86
86
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:
87
87
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**.
0 commit comments