Contract Configuration
To enable cross-chain communication in your blockchain application, you need two key functions: sendMessage()
and messageProcess()
. These functions handle sending and receiving messages between different blockchains.
Simple Code Example
Here's a straightforward example to demonstrate the simplicity of using these functions:
The sendMessage()
function packages and sends data to another blockchain.
Parameters:
destinationChainId
: The ID of the chain to send the message to.data
: The message data to be sent.
The messageProcess()
function receives and processes data from another blockchain.
Parameters:
_txId
: Transaction ID of the message._sourceChainId
: ID of the source chain from where the message is coming._sender
: Address of the sender._reference
: Reference address._amount
: Amount of tokens involved in the message._data
: Additional message data.
This simple example shows how easy it is to set up cross-chain communication using the VIA Network.
Developers can use the Developer Documentation to dive further into these functions.
Last updated