- Query message ids need to be submitted from other chains such as Flow, Ethereum, BNB, polkadot ink!, NEAR, Avalanche, etc.
- Execute script in off-chain router(js) ./scripts/send-recv-message/querySendMessage.cdc to get messages ready to be sent from Flow.
- If the message to be sent exist, that is, get an instance of
SentMessageContract.SentMessageCore
, decode the instance into generalsending message structure
in the router(js).
- Query message ids need to be submitted to Flow by executing script ./scripts/send-recv-message/queryNextSubmitMessage.cdc.
- Choose the smallest id relative to each chain respectively.
- Check and get the messages from the source chains by call related function in router(js). The format of the got messages is the general
sending message structure
. - Encode the message instance to be submitted onto Flow.
- Execute script ./scripts/crypto-dev/GenerateSubmittion.cdc.cdc to get the data which needs be signed.
- Sign to get the signature of the message to be submitted by using
FlowService::sign2string
in ./flowoffchain.mjs orOmnichainCrypto::sign2hexstringrecovery
./omnichainCrypto.ts. - Call ./transactions/send-recv-message/submitRecvedMessage.cdc to submit the message onto Flow.
- The details of how to construct on-chain data structures are as following:
- Construct
MessageProtocol.SQoS
according to function testSQoS() line 87, the related scripts of which is testSQoSItem - Construct
MessageProtocol.MessagePayload
according to function testMessagePayload() line 181 - Construct
MessageProtocol.Session
according to function testSession() line 18
- Construct