Establish an HRMP channel
To establish communication between your parachain and SORA, you must create HRMP channels that go through the Relay Chain to transfer messages between parachains.
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 into sub-sections:
Your Parachain to SORA
- Obtain the encoded call data of the
hrmp.hrmpInitOpenChannelextrinsic on the relay chain.
This unique code includes a
recipient detail telling the relay chain which parachain you want to connect to. The recipient changes depending on what environment you are planning to establish the channel in. For Kusama, look at this list, and for Rococo, go to this list.
Combine this parachain id with the other info from the documentation. For example, for Rococo you'll have something like this:
- 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.
It is 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.
- 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
Upon successful execution, (an) HRMP channel(s) will be established from your parachain to SORA.
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 set up to receive messages from the SORA parachain.
We will still need to register the assets to be transferred from one chain to another. On your parachain, you will need to register the SORA assets. On the SORA Mainnet, we will need to register your assets.