跳到主要内容

发送你的第一条跨链消息

本教程演示如何发送跨链消息到预先部署的TestRecipient合约。

发送消息只需调用Mailbox.dispatch。请确保你在源链上有一个拥有资金的账户。

Install the CLI:
npm install -g @hyperlane-xyz/cli
Send the message:
hyperlane send message --origin abstracttestnet --destination alephzeroevmtestnet --body "Hello, world"
提示

你可以在explorer.hyperlane.xyz上通过搜索你的Mailbox.dispatch调用的交易哈希来查看消息的处理进度。

检查结果

TestRecipient有以下handle实现:

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;
}

查看日志以查看你的消息传递情况!

测试网TestRecipient地址
ChainDomainAddressExplorer
Abstract Testnet111240x9EC79CA89DeF61BFa2f38cD4fCC137b9e49d60dDexplorer.testnet.abs.xyz
Aleph Zero EVM Testnet20390x843908541D24d9F6Fa30C8Bb1c39038C947D08fCevm-explorer-testnet.alephzero.org
Alfajores447870x6489d13AcAd3B8dce4c5B31f375DE4f9451E7b38explorer.celo.org
Arbitrum Sepolia4216140x6c13643B3927C57DB92c790E4E3E7Ee81e13f78Csepolia.arbiscan.io
Arcadia Testnet v210984118860xCB3c489a2FB67a7Cd555D47B3a9A0E654784eD16explorer.khalani.network
Base Sepolia845320x783c4a0bB6663359281aD4a637D5af68F83ae213sepolia.basescan.org
Berachain bArtio800840xe0B988062A0C6492177d64823Ab95a9c256c2a5Fbartio.beratrail.io
BSC Testnet970xfbcD1c00a3d809f36cC1A15918694B17B32c0b6ctestnet.bscscan.com
Camp Network Testnet V23250000x7483faD0Bc297667664A43A064bA7c9911659f57camp-network-testnet.blockscout.com
Chronicle Yellowstone1751880xcCB305B1f21e5FbC85D1DD7Be5cd8d5bf5B7f863yellowstone-explorer.litprotocol.com
Citrea Testnet51150xA2cf52064c921C11adCd83588CbEa08cc3bfF5d8explorer.testnet.citrea.xyz
Eco Testnet4719230x783c4a0bB6663359281aD4a637D5af68F83ae213eco-testnet.explorer.caldera.xyz
Flame Dawn-1 Testnet16604737730x8d4f112cffa338D3c3Ef2Cf443179C5a48E678e4explorer.flame.dawn-1.astria.org
Form Testnet1329020x7483faD0Bc297667664A43A064bA7c9911659f57sepolia-explorer.form.network
Fuji431130x44a7e1d76fD8AfA244AdE7278336E3D5C658D398testnet.snowtrace.io
Holesky170000x86fb9F1c124fB20ff130C41a79a432F770f67AFDholesky.etherscan.io
Hyperliquid EVM Testnet9980xB057Fb841027a8554521DcCdeC3c3474CaC99AB5explorer.hyperlend.finance
Ink Sepolia7633730x0e91088824Fa6E2675b2a53DA3491a9B098bD868explorer-sepolia.inkonchain.com
Monad Testnet101430xCCC126d96efcc342BF2781A7d224D3AB1F25B19Cexplorer.monad-testnet.category.xyz
Odyssey Testnet9118670x5e65279Fb7293a058776e37587398fcc3E9184b1odyssey-explorer.ithaca.xyz
Optimism Sepolia111554200x783c4a0bB6663359281aD4a637D5af68F83ae213sepolia-optimistic.etherscan.io
Plume Testnet1612211350xe0B988062A0C6492177d64823Ab95a9c256c2a5Fplume-testnet.explorer.caldera.xyz
Polygon Amoy800020x04438ef7622f5412f82915F59caD4f704C61eA48amoy.polygonscan.com
Scroll Sepolia5343510xa3AB7E6cE24E6293bD5320A53329Ef2f4DE73fCAsepolia.scrollscan.dev
Sepolia111551110xeDc1A3EDf87187085A3ABb7A9a65E1e7aE370C07sepolia.etherscan.io
Soneium Minato Testnet19460x7483faD0Bc297667664A43A064bA7c9911659f57explorer-testnet.soneium.org
Sonic Blaze Testnet570540x8d4f112cffa338D3c3Ef2Cf443179C5a48E678e4testnet.sonicscan.org
Sonic Testnet641650x01812D60958798695391dacF092BAc4a715B1718testnet.soniclabs.com
SUAVE Toliman Testnet336262500x7483faD0Bc297667664A43A064bA7c9911659f57explorer.toliman.suave.flashbots.net
Subtensor Testnet9450xcCB305B1f21e5FbC85D1DD7Be5cd8d5bf5B7f863N/A
Superposition Testnet989850xAb9B273366D794B7F80B4378bc8Aaca75C6178E2testnet-explorer.superposition.so
Tangle Testnet37990xE73cdFFcE97AD56723dbA6145a3cC0Dd3aeF112ftestnet-explorer.tangle.tools
Treasure Topaz Testnet9786580x9EC79CA89DeF61BFa2f38cD4fCC137b9e49d60dDtopaz.treasurescan.io
Unichain Testnet13010x01812D60958798695391dacF092BAc4a715B1718unichain-sepolia.blockscout.com
Weave VM Testnet94960xCCC126d96efcc342BF2781A7d224D3AB1F25B19Cexplorer.wvm.dev
测试网Mailbox地址
ChainDomainAddressExplorer
Abstract Testnet111240x28f448885bEaaF662f8A9A6c9aF20fAd17A5a1DCexplorer.testnet.abs.xyz
Aleph Zero EVM Testnet20390xDDcFEcF17586D08A5740B7D91735fcCE3dfe3eeDevm-explorer-testnet.alephzero.org
Alfajores447870xEf9F292fcEBC3848bF4bB92a96a04F9ECBb78E59explorer.celo.org
Arbitrum Sepolia4216140x598facE78a4302f11E3de0bee1894Da0b2Cb71F8sepolia.arbiscan.io
Arcadia Testnet v210984118860x33dB966328Ea213b0f76eF96CA368AB37779F065explorer.khalani.network
Base Sepolia845320x6966b0E55883d49BFB24539356a2f8A673E02039sepolia.basescan.org
Berachain bArtio800840xDDcFEcF17586D08A5740B7D91735fcCE3dfe3eeDbartio.beratrail.io
BSC Testnet970xF9F6F5646F478d5ab4e20B0F910C92F1CCC9Cc6Dtestnet.bscscan.com
Camp Network Testnet V23250000xDDcFEcF17586D08A5740B7D91735fcCE3dfe3eeDcamp-network-testnet.blockscout.com
Chronicle Yellowstone1751880x589C201a07c26b4725A4A829d772f24423da480Byellowstone-explorer.litprotocol.com
Citrea Testnet51150xB08d78F439e55D02C398519eef61606A5926245Fexplorer.testnet.citrea.xyz
Eco Testnet4719230x6966b0E55883d49BFB24539356a2f8A673E02039eco-testnet.explorer.caldera.xyz
Flame Dawn-1 Testnet16604737730x589C201a07c26b4725A4A829d772f24423da480Bexplorer.flame.dawn-1.astria.org
Form Testnet1329020xDDcFEcF17586D08A5740B7D91735fcCE3dfe3eeDsepolia-explorer.form.network
Fuji431130x5b6CFf85442B851A8e6eaBd2A4E4507B5135B3B0testnet.snowtrace.io
Holesky170000x46f7C5D896bbeC89bE1B19e4485e59b4Be49e9Ccholesky.etherscan.io
Hyperliquid EVM Testnet9980x589C201a07c26b4725A4A829d772f24423da480Bexplorer.hyperlend.finance
Ink Sepolia7633730xDDcFEcF17586D08A5740B7D91735fcCE3dfe3eeDexplorer-sepolia.inkonchain.com
Monad Testnet101430x589C201a07c26b4725A4A829d772f24423da480Bexplorer.monad-testnet.category.xyz
Odyssey Testnet9118670xDDcFEcF17586D08A5740B7D91735fcCE3dfe3eeDodyssey-explorer.ithaca.xyz
Optimism Sepolia111554200x6966b0E55883d49BFB24539356a2f8A673E02039sepolia-optimistic.etherscan.io
Plume Testnet1612211350x33dB966328Ea213b0f76eF96CA368AB37779F065plume-testnet.explorer.caldera.xyz
Polygon Amoy800020x54148470292C24345fb828B003461a9444414517amoy.polygonscan.com
Scroll Sepolia5343510x3C5154a193D6e2955650f9305c8d80c18C814A68sepolia.scrollscan.dev
Sepolia111551110xfFAEF09B3cd11D9b20d1a19bECca54EEC2884766sepolia.etherscan.io
Solana Testnet139981115075HBBLae3ddeneJVrZeyrDfv6vb7SMC3aCpBucSXS5aRexplorer.solana.com
Soneium Minato Testnet19460xDDcFEcF17586D08A5740B7D91735fcCE3dfe3eeDexplorer-testnet.soneium.org
Sonic Blaze Testnet570540x589C201a07c26b4725A4A829d772f24423da480Btestnet.sonicscan.org
Sonic SVM Testnet151530426BaTtWPMpWdA6tHqdT2VbogC4XZ9QV5cNCYpBrx6WP7Bexplorer.sonic.game
Sonic Testnet641650xDDcFEcF17586D08A5740B7D91735fcCE3dfe3eeDtestnet.soniclabs.com
SUAVE Toliman Testnet336262500xDDcFEcF17586D08A5740B7D91735fcCE3dfe3eeDexplorer.toliman.suave.flashbots.net
Subtensor Testnet9450x589C201a07c26b4725A4A829d772f24423da480BN/A
Superposition Testnet989850x6966b0E55883d49BFB24539356a2f8A673E02039testnet-explorer.superposition.so
Tangle Testnet37990x87100b0E64B3baBD43F3FCB26A6edc4395e2D9dftestnet-explorer.tangle.tools
Treasure Topaz Testnet9786580x28f448885bEaaF662f8A9A6c9aF20fAd17A5a1DCtopaz.treasurescan.io
Unichain Testnet13010xDDcFEcF17586D08A5740B7D91735fcCE3dfe3eeDunichain-sepolia.blockscout.com
Weave VM Testnet94960x589C201a07c26b4725A4A829d772f24423da480Bexplorer.wvm.dev