Skip to main content

Send your first interchain message

This tutorial demonstrates how to send an interchain message to a pre-deployed TestRecipient contract.

Sending a message is a simple matter of calling Mailbox.dispatch. Make sure you have an account with funds on the origin chain.

Install the CLI:
npm install -g @hyperlane-xyz/cli
Send the message:
hyperlane send message --origin alfajores --destination arbitrumsepolia --body "Hello, world"
tip

You can watch the progress of your message on explorer.hyperlane.xyz by searching for the transaction hash of your Mailbox.dispatch call.

Check the result

The TestRecipient has the following handle implementation:

function handle(
uint32 _origin,
bytes32 _sender,
bytes calldata _data
) external payable virtual override {
emit ReceivedMessage(_origin, _sender, msg.value, string(_data));
lastSender = _sender;
lastData = _data;
}

Check the logs to see your message delivery!

Testnet TestRecipient Addresses
ChainDomainAddressExplorer
Alfajores447870x6489d13AcAd3B8dce4c5B31f375DE4f9451E7b38alfajores.celoscan.io
Arbitrum Sepolia4216140x6c13643B3927C57DB92c790E4E3E7Ee81e13f78Csepolia.arbiscan.io
Base Sepolia845320x783c4a0bB6663359281aD4a637D5af68F83ae213sepolia.basescan.org
BSC Testnet970xfbcD1c00a3d809f36cC1A15918694B17B32c0b6ctestnet.bscscan.com
Connext Sepolia63980xAb9B273366D794B7F80B4378bc8Aaca75C6178E2connext-sepolia.blockscout.com
Eco Testnet4719230x783c4a0bB6663359281aD4a637D5af68F83ae213eco-testnet.explorer.caldera.xyz
Fuji431130x44a7e1d76fD8AfA244AdE7278336E3D5C658D398testnet.snowtrace.io
Optimism Sepolia111554200x783c4a0bB6663359281aD4a637D5af68F83ae213sepolia-optimistic.etherscan.io
Plume Testnet1612211350xe0B988062A0C6492177d64823Ab95a9c256c2a5Fplume-testnet.explorer.caldera.xyz
Polygon Amoy800020x04438ef7622f5412f82915F59caD4f704C61eA48amoy.polygonscan.com
Scroll Sepolia5343510xa3AB7E6cE24E6293bD5320A53329Ef2f4DE73fCAsepolia.scrollscan.dev
Sepolia111551110xeDc1A3EDf87187085A3ABb7A9a65E1e7aE370C07sepolia.etherscan.io
Superposition Testnet989850xAb9B273366D794B7F80B4378bc8Aaca75C6178E2testnet-explorer.superposition.so
Testnet Mailbox Addresses
ChainDomainAddressExplorer
Alfajores447870xEf9F292fcEBC3848bF4bB92a96a04F9ECBb78E59alfajores.celoscan.io
Arbitrum Sepolia4216140x598facE78a4302f11E3de0bee1894Da0b2Cb71F8sepolia.arbiscan.io
Base Sepolia845320x6966b0E55883d49BFB24539356a2f8A673E02039sepolia.basescan.org
BSC Testnet970xF9F6F5646F478d5ab4e20B0F910C92F1CCC9Cc6Dtestnet.bscscan.com
Connext Sepolia63980x6966b0E55883d49BFB24539356a2f8A673E02039connext-sepolia.blockscout.com
Eco Testnet4719230x6966b0E55883d49BFB24539356a2f8A673E02039eco-testnet.explorer.caldera.xyz
Fuji431130x5b6CFf85442B851A8e6eaBd2A4E4507B5135B3B0testnet.snowtrace.io
Optimism Sepolia111554200x6966b0E55883d49BFB24539356a2f8A673E02039sepolia-optimistic.etherscan.io
Plume Testnet1612211350x33dB966328Ea213b0f76eF96CA368AB37779F065plume-testnet.explorer.caldera.xyz
Polygon Amoy800020x54148470292C24345fb828B003461a9444414517amoy.polygonscan.com
Scroll Sepolia5343510x3C5154a193D6e2955650f9305c8d80c18C814A68sepolia.scrollscan.dev
Sepolia111551110xfFAEF09B3cd11D9b20d1a19bECca54EEC2884766sepolia.etherscan.io
Superposition Testnet989850x6966b0E55883d49BFB24539356a2f8A673E02039testnet-explorer.superposition.so