发送您的第一条消息
本教程演示如何send链间消息到预先部署的 "TestRecipient "合约。
发送信息只需调用Mailbox.dispatch
方法。请确保您的账户在原始链上有资金。
origin:
destination:
body:
- Hyperlane CLI
- Cast
- Explorer
Install the CLI:Send the message:
npm install -g @hyperlane-xyz/cli
hyperlane send message --origin alfajores --destination bsctestnet
Install Send the message:
cast
:curl -L https://foundry.paradigm.xyz | bash
cast send 0xEf9F292fcEBC3848bF4bB92a96a04F9ECBb78E59 "dispatch(uint32,bytes32,bytes)" 97 0x0000000000000000000000006489d13AcAd3B8dce4c5B31f375DE4f9451E7b38 $(cast --from-utf8 "Hello, world") --rpc-url https://alfajores-forno.celo-testnet.org --value 0.01ether
- Navigate to the alfajores.celoscan.io
dispatch
interface - Click on the
Connect to Web3
button to connect your Wallet. Make sure you are onalfajores
. - Fill in value:
0.01
, destination:97
, recipient:0x0000000000000000000000006489d13AcAd3B8dce4c5B31f375DE4f9451E7b38
, and message the hex representation of "Hello, world". For example if you havecast
installed,cast --from-utf8 "Hello, world"
returns0x48656c6c6f2c20776f726c64
. - Click the
Write
button to submit the transaction!
tip
你可以在explorer.hyperlane.xyz上通过搜索你的Mailbox.dispatch
调用的transaction hash来查看信息的进度。
查看结果
TestRecipient
具有以下处理handle实现:
- Solidity
- CosmWasm
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;
}
🚧 即将到来! 🚧
查看日志,了解信息的发送情况!
Testnet TestRecipient
Addresses
Chain | Domain | Address | Explorer |
---|---|---|---|
Alfajores | 44787 | 0x6489d13AcAd3B8dce4c5B31f375DE4f9451E7b38 | alfajores.celoscan.io |
BSC Testnet | 97 | 0xfbcD1c00a3d809f36cC1A15918694B17B32c0b6c | testnet.bscscan.com |
Fuji | 43113 | 0x44a7e1d76fD8AfA244AdE7278336E3D5C658D398 | testnet.snowtrace.io |
Plume Testnet | 161221135 | 0xe0B988062A0C6492177d64823Ab95a9c256c2a5F | plume-testnet.explorer.caldera.xyz |
Scroll Sepolia | 534351 | 0xa3AB7E6cE24E6293bD5320A53329Ef2f4DE73fCA | sepolia.scrollscan.dev |
Sepolia | 11155111 | 0xeDc1A3EDf87187085A3ABb7A9a65E1e7aE370C07 | sepolia.etherscan.io |
Testnet Mailbox
Addresses
Chain | Domain | Address | Explorer |
---|---|---|---|
Alfajores | 44787 | 0xEf9F292fcEBC3848bF4bB92a96a04F9ECBb78E59 | alfajores.celoscan.io |
BSC Testnet | 97 | 0xF9F6F5646F478d5ab4e20B0F910C92F1CCC9Cc6D | testnet.bscscan.com |
Fuji | 43113 | 0x5b6CFf85442B851A8e6eaBd2A4E4507B5135B3B0 | testnet.snowtrace.io |
Plume Testnet | 161221135 | 0x33dB966328Ea213b0f76eF96CA368AB37779F065 | plume-testnet.explorer.caldera.xyz |
Scroll Sepolia | 534351 | 0x3C5154a193D6e2955650f9305c8d80c18C814A68 | sepolia.scrollscan.dev |
Sepolia | 11155111 | 0xfFAEF09B3cd11D9b20d1a19bECca54EEC2884766 | sepolia.etherscan.io |