Send a Message
Send your first Cross-Chain message with Teleporter.
The final step, is to send the message between the two chains. Assuming everything went smooth so far, your local C-chain and your Avalanche L1 will have their corresponding parts of the sender/receiver deployed on them.
Send a Message
cast send --rpc-url fuji-c --private-key $PK $SENDER_ADDRESS "sendMessage(address,string)" $RECEIVER_ADDRESS "Hello"
A relayer will now take the message and deliver it to the destination.
Verify Message was Received
Now let's check if the "Hello" string sent from our C-chain was actually stored properly on the lastMessage
variable on our Avalanche L1. Run the following command replacing the receiver contract address.
cast call --rpc-url fuji-dispatch $RECEIVER_ADDRESS "lastMessage()(string)"
If the output says Hello
then the message was successfully delivered and processed.
Congratulations 🎉 You have just sent your first cross-chain message. This will be one of many to come!
Is this guide helpful?