-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Establish HRMP channel article added
- Loading branch information
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Establish HRMP channel | ||
|
||
To establish communication between your parachain and SORA, you'll need to create HRMP channels that act as bridges for messages. This guide will walk you through the process, using information from the official [Substrate documentation](https://docs.substrate.io/reference/how-to-guides/parachains/add-hrmp-channels/) but applied for SORA. | ||
|
||
Remember that HRMP channels usually go in one direction. For two-way communication, you'll need to set up another channel going the opposite way. Therefore, the following is split in to sub-sections: | ||
|
||
## Your Parachain to SORA | ||
|
||
1. Obtain the encoded call data of the `hrmp.hrmpInitOpenChannel` extrinsic on the relay chain. | ||
|
||
This special code includes a `recipient` detail that tells relay chain which parachain you would like to connect to. This detail changes depending on what environment you are planning to establish the channel in. For Kusama, look at [this list](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fksm-rpc.stakeworld.io#/parachains), and for Rococo, go to [this list](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-rpc.polkadot.io#/parachains). | ||
|
||
::: info | ||
|
||
Combine this parachain id with the other info from the documentation, and you'll end up with something like this for Rococo: `0x3c00db070000e803000000900100`. | ||
|
||
::: | ||
|
||
2. Within your parachain, compose an XCM message that notifies the relay chain about the intent to open a channel with SORA. Refer to the official documentation for an illustrative example of the XCM message. | ||
|
||
::: info | ||
|
||
It's important to acknowledge that if your implementation of HRMP channel logic differs from the standard `polkadotXcm.send` pallet, you should modify this step accordingly. | ||
|
||
::: | ||
|
||
Once the extrinsic executes successfully, SORA needs to accept the channel establishment. | ||
|
||
3. Subsequently, the SORA team will accept the channel by incorporating the encoded call data of `hrmp.hrmpAcceptOpenChannel`. This data will feature your parachain's ID as a parameter and will be executed via the `xcmApp.sudoSendXCM` call. | ||
|
||
Upon successful execution, the HRMP establishment from your parachain to SORA is finalized. | ||
|
||
## SORA to Your Parachain | ||
|
||
The steps here mirror those from the preceding sub-section. For steps (1) and (2) outlined earlier, SORA initiates an XCM message to propose channel establishment. Subsequently, it's your responsibility to encode `hrmp.hrmpAcceptOpenChannel` with SORA's parachain ID. For instance, in the case of Rococo, the encoded call data would be: `0x3c01db070000`. Execute an XCM message from your parachain in alignment with the official guidelines, including the encoded call data containing SORA's parachain ID. | ||
|
||
Upon successful execution of this process, your parachain will be fully equipped to receive messages from the SORA parachain. |