1

I am gonna transfer the customized message which is actually the string in JSON format for representing some information from one parachain to another one. But I can't find the right functions or specific steps, while there are some XCM demos for transfer the tokens between multiple parachains. If anyone have some idea, please contact here to give me your hand, thanks.


I tested XCM between parachain 2000 and parachain 2001. At the moment I could see the "Barrier error" just like the image below. enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

All parameters of XCM were almost same as here, How to open HRMP channels between parachains?.

But I couldn't create a new HRMP channel via this XCM.

enter image description here

1 Answer 1

3

In fact, when you send a cross-chain message, you actually want to either transfer the token or call the method on target chain.

As you said customized message, what do you want the message to do after it reaches the target chain? Call a function with it as an argument? If so, you could use the transact instruction in XCM.

For example: Send XCM to Polkadot and call remark on Polkadot with customized message "hello world" as parameter.

  1. Get the encoded call data 0x00012c68656c6c6f20776f726c64 enter image description here
  2. Send XCM to Polkadot via polkadotXcm.send
WithdrawAsset(...)
BuyExecution(...)
Transact(0x00012c68656c6c6f20776f726c64) 
RefundSurplus
DepositAsset(...)

Updates to follow up on question:

You should use sudo or Governance to send the XCM to open HRMP.

Refer to: https://substrate.stackexchange.com/a/4925/1959

6
  • Thanks for your help, Guantong.
    – TinyDev
    Oct 21, 2022 at 19:12
  • I will try and leave my feedback here, if you are available at the moment, please check my message.
    – TinyDev
    Oct 21, 2022 at 19:13
  • @TinyDev Please update your question to add your XCM you sent so that I can find what's wrong.
    – Guantong
    Nov 2, 2022 at 8:24
  • @TinyDev Could you edit your question and add the XCM instructions or screenshot?Comment is not convenient.
    – Guantong
    Nov 2, 2022 at 8:41
  • @TinyDev I have updated my answer. But I think it's not related to the original question, If you are still confused, you can open a new question, I am willing to help you
    – Guantong
    Nov 2, 2022 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.