### Install Rustup Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/relayer/run-relayer.mdx Install Rustup, the toolchain installer for Rust. This is a prerequisite for building from source on most systems. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/README.md Use this command to install all necessary project dependencies. Ensure you have Yarn installed. ```bash yarn install ``` -------------------------------- ### Install Rustup Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/quickstart-validator.mdx Install `rustup`, the Rust toolchain installer, which is a prerequisite for building Hyperlane from source. ```sh # install rustup curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Start Local Development Server Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/README.md Starts a local development server and automatically opens the project in your browser. Changes are reflected live without needing a server restart. ```bash yarn start ``` -------------------------------- ### Install Rustup and Rosetta 2 Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/deploy-hyperlane-local-agents.mdx Install Rustup for managing Rust versions and Rosetta 2 for Apple Silicon compatibility when building from source. ```sh # install rustup curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # (apple silicon only) install rosetta 2 softwareupdate --install-rosetta --agree-to-license ``` -------------------------------- ### Example: Quoting and Dispatching a Message Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/reference/messaging/send.mdx Example demonstrating how to quote the fee for a message dispatch and then use that fee to send the message. Underpaying the fee will cause the transaction to revert. ```solidity // quote sending message from originChain to destinationChain TestRecipient IMailbox mailbox = IMailbox("mailbox"); uint32 destination = destinationDomain; bytes32 recipient = "paddedRecipient"; bytes memory body = bytes("body"); uint256 fee = mailbox.quoteDispatch(destination, recipient, body); mailbox.dispatch{value: fee}(destination, recipient, body); ``` -------------------------------- ### TestRecipient Example Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/reference/messaging/receive.mdx An example implementation of a recipient contract demonstrating how to use the `handle` function and access control. ```solidity function handle( uint32 origin, bytes32 sender, bytes calldata messageBody ) external override onlyMailbox { // ... implementation ... } ``` -------------------------------- ### Configure Whitelist as Command-Line Argument Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/config-reference.mdx Example of how to set the whitelist configuration using a command-line argument. ```bash --whitelist '[{"senderAddress": "0xa441b15fe9a3cf56661190a0b93b9dec7d041272", "originDomain": [1, 42]}, {"destinationDomain": 1}]' ``` -------------------------------- ### Install Anvil (Foundry) Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/local-testnet-setup.mdx Installs Anvil, a local Ethereum node, for running local chains. This command downloads and executes the Foundry installer script. ```bash curl -L https://foundry.paradigm.xyz | bash ``` -------------------------------- ### Chain Configuration Example Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/deploy-warp-route-UI.mdx Example configuration for chain metadata, similar to what is used with the CLI for deployment and sending commands. This example defines settings for a local Anvil chain. ```typescript { anvil1: { chainId: 31337, name: 'anvil1', displayName: 'Anvil 1 Local', nativeToken: { name: 'Ether', symbol: 'ETH', decimals: 18 }, publicRpcUrls: [{ http: 'http://127.0.0.1:8545' }], blocks: { confirmations: 1, reorgPeriod: 0, estimateBlockTime: 10, }, logoURI: '/logo.svg' } } ``` -------------------------------- ### Example of Updated Mailbox Configuration Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/update-mailbox-default-ism.mdx This is an example of the mailbox configuration after successfully updating the default ISM. It reflects the changes applied in the previous steps. ```yaml defaultHook: address: "0x67F8c06Fd2915728E9D21451E33FbDFbCcd63c44" type: "merkleTreeHook" defaultIsm: address: "0xac7D6df90fa937ADEfE7aD2d4905f0AEa170c467" relayer: "0x0000000000000000000000000000000000000001" type: "trustedRelayerIsm" owner: "0xa5558cA30cd9952Ab0e2349C274a3736698bD60e" requiredHook: address: "0x1Cd94b4D9B5f0e3474a6bDB8b9503Ca84F53e548" beneficiary: "0xa5558cA30cd9952Ab0e2349C274a3736698bD60e" maxProtocolFee: "100000000000000000" owner: "0xa5558cA30cd9952Ab0e2349C274a3736698bD60e" protocolFee: "0" type: "protocolFee" ``` -------------------------------- ### Configure Whitelist as Environment Variable Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/config-reference.mdx Example of how to set the whitelist configuration using an environment variable. ```bash export HYP_WHITELIST='[{"senderAddress": "0xa441b15fe9a3cf56661190a0b93b9dec7d041272", "originDomain": [1, 42]}, {"destinationDomain": 1}]' ``` -------------------------------- ### Whitelist Configuration Example Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/relayer/message-filtering.mdx An example JSON configuration for a whitelist, specifying rules for relaying messages based on sender, destination, and recipient addresses. ```json [ { "senderAddress": "*", "destinationDomain": ["1"], "recipientAddress": "*" }, { "senderAddress": "0xca7f632e91B592178D83A70B404f398c0a51581F", "destinationDomain": ["42220", "43114"], "recipientAddress": "*" }, { "senderAddress": "*", "destinationDomain": ["42161", "420"], "recipientAddress": "0xca7f632e91B592178D83A70B404f398c0a51581F" } ] ``` -------------------------------- ### Clone Hyperlane Monorepo and Setup Rust Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/quickstart-relayer.mdx Clone the Hyperlane monorepo and follow the setup instructions for Rust development. Includes installing rustup and Rosetta 2 for Apple Silicon. ```bash # clone hyperlane monorepo git clone git@github.com:hyperlane-xyz/hyperlane-monorepo.git # install rustup curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # (apple silicon only) install rosetta 2 softwareupdate --install-rosetta --agree-to-license ``` -------------------------------- ### Set Agent DB Path via Command Line Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/agent-config.mdx Use command-line arguments to set configuration values. This example shows how to set the database path. ```bash ./relayer --db "/path/to/dir" ``` -------------------------------- ### Example: Dispatching a Message Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/reference/messaging/send.mdx Example of how to dispatch a message from one chain to another using the IMailbox interface. Ensure the correct value is sent to cover fees. ```solidity // send message from originChain to destinationChain TestRecipient IMailbox mailbox = IMailbox("mailbox"); bytes32 messageId = mailbox.dispatch{value: msg.value}( destinationDomain, "paddedRecipient", bytes("body") ); ``` -------------------------------- ### Install @hyperlane-xyz/registry Package Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/reference/registries.mdx Install the Hyperlane registry package using npm or yarn. ```bash # With npm npm install @hyperlane-xyz/registry # Or with yarn yarn add @hyperlane-xyz/registry ``` -------------------------------- ### Warp Routes Symbol Selection Example Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/partials/warp-routes/_warp-read-symbol-selection.mdx This example shows the interactive prompt when multiple warp routes are found for a symbol. The user is prompted to select from a list of available routes. ```text Hyperlane Warp Reader --------------------- Multiple warp routes found for symbol eth ? Select from matching warp routes ETH/ethereum-viction ETH/basesepolia ETH/holesky-sepolia ❯ ETH/basesepolia-sepolia ETH/beta-gamma ``` -------------------------------- ### Configure Blacklist as Command-Line Argument Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/config-reference.mdx Example of how to set the blacklist configuration using a command-line argument. The blacklist is provided as a JSON string. ```bash --blacklist '[{"senderAddress": "0xa441b15fe9a3cf56661190a0b93b9dec7d041272", "originDomain": [1, 42]}, {"destinationDomain": 1}]' ``` -------------------------------- ### Verify Solana CLI Version Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/deploy-svm-warp-route.mdx Checks the currently installed Solana CLI version. This is a verification step after installation. ```bash solana --version ``` -------------------------------- ### Whitelist Environment Variable Example Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/relayer/message-filtering.mdx Demonstrates how to set the whitelist configuration as a stringified JSON object via a bash environment variable. ```bash --whitelist='[{"senderAddress":"*","destinationDomain":["1"],"recipientAddress":"*"},{"senderAddress":"0xca7f632e91B592178D83A70B404f398c0a51581F","destinationDomain":["42220","43114"],"recipientAddress":"*"},{"senderAddress":"*","destinationDomain":["42161","420"],"recipientAddress":"0xca7f632e91B592178D83A70B404f398c0a51581F"}]' ``` -------------------------------- ### Configure Whitelist in JSON Config Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/config-reference.mdx Example of how to set the whitelist configuration within a JSON configuration file. ```json { "whitelist": "[{"senderAddress": "0xa441b15fe9a3cf56661190a0b93b9dec7d041272", "originDomain": [1, 42]}, {"destinationDomain": 1}]" } ``` -------------------------------- ### Install Solana CLI v1.18.18 Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/deploy-svm-warp-route.mdx Installs a specific version of the Solana CLI required for deploying contracts. Using this version is crucial for successful deployment. ```bash sh -c "$(curl -sSfL https://release.solana.com/v1.18.18/install)" ``` -------------------------------- ### Configure Blacklist as Environment Variable Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/config-reference.mdx Example of how to set the blacklist configuration using an environment variable. The blacklist is provided as a JSON string. ```bash export HYP_BLACKLIST='[{"senderAddress": "0xa441b15fe9a3cf56661190a0b93b9dec7d041272", "originDomain": [1, 42]}, {"destinationDomain": 1}]' ``` -------------------------------- ### Configure Indexing Start Height Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/config-reference.mdx Set the starting block height for indexing contracts. Defaults to 0. Applicable to Relayer and Scraper agents. ```bash --chains.${CHAIN_NAME}.index.from 0 --chains.ethereum.index.from 16271503 ``` ```bash export HYP_CHAINS_${CHAIN_NAME}_INDEX_FROM=0 export HYP_CHAINS_ETHEREUM_INDEX_FROM=16271503 ``` ```json { "chains": { "``": { "index": { "from": 0 } }, "ethereum": { "index": { "from": 16271503 } } } } ``` -------------------------------- ### Install Solana CLI v1.14.20 Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/deploy-svm-warp-route.mdx Installs a specific version of the Solana CLI required for building Warp Route programs. Ensure this version is used to avoid deployment failures. ```bash sh -c "$(curl -sSfL https://release.solana.com/v1.14.20/install)" ``` -------------------------------- ### Install Hyperlane CLI Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/reference/cli.mdx Install the Hyperlane CLI globally using npm. This makes the `hyperlane` command available in your terminal. Uninstall old versions if necessary. ```bash # Install with NPM npm install -g @hyperlane-xyz/cli # Or uninstall old versions npm uninstall -g @hyperlane-xyz/cli ``` -------------------------------- ### Warp Route Configuration Example Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/transfer-warp-route-ownership.mdx This is an example of a Warp Route configuration file, showing details like the mailbox, owner, and interchain security module. The 'owner' field is updated after applying the new configuration. ```yaml yourchain: mailbox: "0x979Ca5202784112f4738403dBec5D0F3B9daabB9" owner: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" interchainSecurityModule: address: "0x8af9445d8A3FbFBd1D5dF185B8a4533Ab060Cf36" type: staticAggregationIsm modules: - owner: "0xe738d6e51aad88F6F4ce6aB8827279cffFb94876" address: "0xBe0232d5d45f9aD8322C2C4F84c39e64302Cd996" type: defaultFallbackRoutingIsm domains: {} threshold: 1 name: Ether symbol: ETH decimals: 18 totalSupply: 0 type: native ``` -------------------------------- ### Example Chain Metadata Configuration Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/deploy-hyperlane.mdx This YAML file defines the metadata for your custom chain, including RPC URLs, chain ID, and block explorer details. Ensure all required fields are accurately populated. ```yaml # yaml-language-server: $schema=../schema.json # Metadata for your custom chain blockExplorers: - apiUrl: https://explorer.yourchain.com/api apiKey: XXXX # helpful to avoid rate limiting on the contract verification API family: etherscan #explorer you're using, also supporting routescan or blockscout name: Chainscan url: https://explorer.yourchain.com blocks: confirmations: 1 estimateBlockTime: 1 reorgPeriod: 0 chainId: 171717 displayName: Chain Name domainId: 171717 isTestnet: true # optional name: yourchain nativeToken: name: Ether symbol: ETH decimals: 18 protocol: ethereum rpcUrls: - http: https://hyper-lane-docs.rpc.caldera.xyz/http ``` -------------------------------- ### Run Validator from Source with AWS Configuration Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/validators/run-validators.mdx Execute the built validator binary from the source directory. This example sets AWS environment variables and provides arguments for database, chain, region, and AWS KMS/S3 configuration. ```bash # set AWS environment variables export AWS_ACCESS_KEY_ID=ABCDEFGHIJKLMNOP export AWS_SECRET_ACCESS_KEY=xX-haha-nice-try-Xx # run the Validator ./target/release/validator \ --db /hyperlane_db \ --originChainName \ --reorgPeriod 1 \ --validator.region us-east-1 \ --checkpointSyncer.region us-east-1 \ --validator.type aws \ --chains..signer.type aws \ --chains..signer.region \ --validator.id alias/hyperlane-validator-signer- \ --chains..signer.id alias/hyperlane-validator-signer- \ --checkpointSyncer.type s3 \ --checkpointSyncer.bucket hyperlane-validator-signatures- ``` -------------------------------- ### Example: Two Local Anvil Chains Configuration Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/deploy-hyperlane-troubleshooting.mdx Defines configuration for two local Anvil chains, including chainId, domainId, protocol, RPC URLs, and native token details. ```yaml anvil1: chainId: 31337 domainId: 31337 name: anvil1 protocol: ethereum rpcUrls: - http: http://localhost:8545 nativeToken: name: Ether symbol: ETH decimals: 18 anvil2: chainId: 31338 domainId: 31338 name: anvil2 protocol: ethereum rpcUrls: - http: http://localhost:8555 ``` -------------------------------- ### Example Warp Route Deployment Configuration Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/deploy-warp-route.mdx A minimal YAML configuration file for deploying a Warp Route, demonstrating settings for local anvil chains. This file specifies chain details and token configurations. ```yaml chains: anvil1: rpcUrl: http://127.0.0.1:8545 accounts: - "0xac0974bec39a17e36ba4a6b4d238ab64da5680ce2623b635207aff3717276600" # ... other anvil1 specific config anvil2: rpcUrl: http://127.0.0.1:8546 accounts: - "0xac0974bec39a17e36ba4a6b4d238ab64da5680ce2623b635207aff3717276600" # ... other anvil2 specific config warpRoutes: anvil1: type: collateral address: "0x5FbDB2315678afecb367f032eb9ce9a7f950670c" # optional fields # symbol: "HYP" # name: "Hyperlane Token" # decimals: 18 # mailbox: "0x94e3433507337071930774879000000000000000" # interchainSecurityModule: "0x94e3433507337071930774879000000000000001" anvil2: type: collateral address: "0xe7f1725E7731401e93f080435737914937243738" # optional fields # symbol: "HYP" # name: "Hyperlane Token" # decimals: 18 # mailbox: "0x94e3433507337071930774879000000000000000" # interchainSecurityModule: "0x94e3433507337071930774879000000000000001" ``` -------------------------------- ### Configure Blacklist in JSON Config File Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/config-reference.mdx Example of how to set the blacklist configuration within a JSON configuration file. The blacklist is provided as a JSON string. ```json { "blacklist": "[{"senderAddress": "0xa441b15fe9a3cf56661190a0b93b9dec7d041272", "originDomain": [1, 42]}, {"destinationDomain": 1}]" } ``` -------------------------------- ### Encoding Metadata with Custom Gas Limit Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/reference/hooks/interchain-gas.mdx Example of how to encode metadata using the `StandardHookMetadata.formatMetadata` library function, specifying a custom gas limit and refund address. ```solidity // Example: Encoding metadata using StandardHookMetadata bytes memory metadata = StandardHookMetadata.formatMetadata( 0, // ETH message value 200000, // Custom gas limit address(this), // Refund address bytes("") // Optional custom metadata ); ``` -------------------------------- ### Create Validator Directories and Config Files Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/docker-quickstart.mdx This command creates the necessary directories for Hyperlane validator databases and touch empty configuration files for each chain and the docker-compose setup. Adjust the chain names and file paths as needed for your deployment. ```bash mkdir -p ethereum/hyperlane_db optimism/hyperlane_db base/hyperlane_db && \ touch ethereum/config.json optimism/config.json base/config.json docker-compose.yml .env.ethereum .env.optimism .env.base ``` -------------------------------- ### Run Relayer with Docker (AWS KMS) Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/relayer/run-relayer.mdx Start the Hyperlane relayer using Docker, configured for AWS KMS. Ensure AWS credentials and mount points are correctly set. ```bash docker run \ -it \ -e AWS_ACCESS_KEY_ID=ABCDEFGHIJKLMNOP \ -e AWS_SECRET_ACCESS_KEY=xX-haha-nice-try-Xx \ --mount ... \ gcr.io/abacus-labs-dev/hyperlane-agent:agents-v1.4.0 \ ./relayer \ --db /hyperlane_db \ --relayChains , \ --defaultSigner.type aws \ --defaultSigner.id alias/hyperlane-relayer-1 \ --defaultSigner.region us-east-1 \ ``` -------------------------------- ### Configure Index Chunk Size in JSON Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/config-reference.mdx Define the number of blocks to query per chunk for contract indexing within the configuration file. This example shows settings for a generic chain name and specifically for Ethereum. ```json { "chains": { "``": { "index": { "chunk": 1999 } }, "ethereum": { "index": { "chunk": 1999 } } } } ``` -------------------------------- ### Run Validator using Docker with AWS Configuration Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/validators/run-validators.mdx Start the Hyperlane validator container using Docker. This example configures AWS credentials, mounts a volume for the database, and specifies chain and region details for AWS KMS and S3 checkpoint syncing. ```bash docker run \ -it \ -e AWS_ACCESS_KEY_ID=ABCDEFGHIJKLMNOP \ -e AWS_SECRET_ACCESS_KEY=xX-haha-nice-try-Xx \ --mount ... \ gcr.io/abacus-labs-dev/hyperlane-agent:agents-v1.4.0 \ ./validator \ --db /hyperlane_db \ --originChainName \ --reorgPeriod 1 \ --validator.region us-east-1 \ --checkpointSyncer.region us-east-1 \ --validator.type aws \ --chains..signer.type aws \ --validator.id alias/hyperlane-validator-signer- \ --chains..signer.id alias/hyperlane-validator-signer- \ --checkpointSyncer.type s3 \ --checkpointSyncer.bucket hyperlane-validator-signatures- \ --checkpointSyncer.folder \ ``` -------------------------------- ### Install Hyperlane CLI Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/local-testnet-setup.mdx Installs the latest version of the Hyperlane CLI globally. Ensure Node.js v18 or later is installed. ```bash npm install -g @hyperlane-xyz/cli ``` -------------------------------- ### Show Solana Programs and Buffers Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/deploy-svm-warp-route.mdx Use these commands to inspect deployed programs and buffers associated with your deployer key. This is useful for troubleshooting deployment issues. ```bash solana program show --programs --keypair ./warp-route-deployer-key.json --url ``` ```bash solana program show --buffers --keypair ./warp-route-deployer-key.json --url ``` -------------------------------- ### Set Up Test Environment for Router-based Apps Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/developer-tips/unit-testing.mdx Initializes a mock Hyperlane environment and enrolls remote routers for testing cross-chain communication. Ensure origin and destination domains are set to the chainId. ```Solidity contract CrosschainAppTest is Test { // origin and destination domains (recommended to be the chainId) uint32 origin = 1; uint32 destination = 2; function setUp() public { environment = new MockHyperlaneEnvironment(origin, destination); // your cross-chain app TestCrosschainApp originTelephone = new TestCrosschainApp(environment.mailboxes(origin)); TestCrosschainApp destinationTelephone = new TestCrosschainApp(environment.mailboxes(destination)); // assuming you're inheriting the Router pattern from https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/client/Router.sol originTelephone.enrollRemoteRouter(destinationTelephone); destinationTelephone.enrollRemoteRouter(originTelephone); } } ``` -------------------------------- ### Initialize Router with Custom ISM and Hook Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/developer-tips/unit-testing.mdx Demonstrates how to initialize a router with a custom InterchainGasPaymaster (hook) and specific Interchain Security Modules (ISMs) for message verification between routers. ```Solidity contract CrosschainAppTest is Test { // origin and destination domains (recommended to be the chainId) uint32 origin = 1; uint32 destination = 2; function setUp() public { ... TestIgp igp = new TestIgp(); // example InterchainGasPaymaster passed as the hook // deploy your own ISM contracts to verify messages between originTelephone and destinationTelephone TelephoneISM originIsm = new TelephoneISM(); // local ISM for origin TelephoneISM destinationIsm = new TelephoneISM(); // local ISM for destination originTelephone.initialize(address(igp), address(originIsm), msg.sender); originTelephone.initialize(address(igp), address(destinationIsm), msg.sender); ... } } ``` -------------------------------- ### Build Project for Deployment Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/README.md Generates static content for the project into the 'build' directory. This output can be hosted on any content hosting service. Always verify builds locally before pushing changes. ```bash yarn build ``` -------------------------------- ### Initialize Terraform Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/deploy-with-terraform.mdx Initializes the Terraform working directory and downloads necessary providers. Run this command in your Terraform project directory. ```bash terraform init ``` -------------------------------- ### Initialize Hyperlane Core Configuration Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/deploy-hyperlane.mdx Run this command to initialize the core contract configuration. Ensure the HYP_KEY environment variable is set with your deployer's private key. ```bash export HYP_KEY='' hyperlane core init ``` -------------------------------- ### Install Rosetta 2 on Apple Silicon Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/quickstart-validator.mdx Install Rosetta 2 on Apple Silicon Macs to ensure compatibility when building and running applications that require x86 architecture. ```sh # (apple silicon only) install rosetta 2 softwareupdate --install-rosetta --agree-to-license ``` -------------------------------- ### Set up and Test Sending a Message Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/developer-tips/unit-testing.mdx This test contract demonstrates setting up mock origin and destination mailboxes on the same chain and then sending a message from the origin to the destination. It simulates message delivery and asserts that the message was received correctly. ```solidity contract SimpleMessagingTest is Test { // origin and destination domains (recommended to be the chainId) uint32 origin = 1; uint32 destination = 2; // both mailboxes will be on the same chain but different addresses MockMailbox originMailbox; MockMailbox destinationMailbox; // contract which can receive messages TestRecipient receiver; function setUp() public { originMailbox = new MockMailbox(origin); destinationMailbox = new MockMailbox(destination); originMailbox.addRemoteMailbox(destination, destinationMailbox); receiver = new TestRecipient(); } function testSendMessage() public { string _message = "Aloha!"; originMailbox.dispatch( destination, TypeCasts.addressToBytes32(address(receiver)), bytes(_message) ); // simulating message delivery to the destinationMailbox destinationMailbox.processNextInboundMessage(); assertEq(string(receiver.lastData()), _message); } } ``` -------------------------------- ### Start Second Anvil Node Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/local-testnet-setup.mdx Starts the second local Anvil node on port 8546 with chain ID 31338 and a block time of 1 second. This node will run on http://localhost:8546. ```bash anvil --port 8546 --chain-id 31338 --block-time 1 ``` -------------------------------- ### Start First Anvil Node Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/local-testnet-setup.mdx Starts the first local Anvil node on port 8545 with chain ID 31337 and a block time of 1 second. This node will run on http://localhost:8545. ```bash anvil --port 8545 --chain-id 31337 --block-time 1 ``` -------------------------------- ### Warp Route Configuration Example Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/deploy-warp-route-UI.mdx Example configuration for a Warp Route connecting USDC on Sepolia to Alfajores. Supports both Typescript and YAML formats. Ensure to replace placeholder addresses with your actual router addresses. ```typescript { tokens: [ { // The ChainName of the token chainName: "sepolia", // See https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/token/TokenStandard.ts standard: TokenStandard.EvmHypCollateral, // The token metadata (decimals, symbol, name) decimals: 6, symbol: "USDC", name: "USD Coin", // The router address addressOrDenom: "YOUR_ROUTER_ADDRESS_1", // The address of the underlying collateral token collateralAddress: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238", // A path to a token logo image logoURI: "/logos/usdc.png", // The list of tokens this one is connected to connections: [{ token: "ethereum|alfajores|YOUR_ROUTER_ADDRESS_2" }], }, { chainName: "alfajores", standard: TokenStandard.EvmHypSynthetic, decimals: 6, symbol: "USDC", name: "USD Coin", addressOrDenom: "YOUR_ROUTER_ADDRESS_2", logoURI: "/logos/usdc.png", connections: [{ token: "ethereum|alfajores|YOUR_ROUTER_ADDRESS_2" }], }, ]; } ``` -------------------------------- ### Configure Log Format Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/config-reference.mdx Set the log output format. Options include 'pretty', 'json', 'full', and 'compact'. Defaults to 'pretty'. ```bash --log.format pretty ``` ```bash export HYP_LOG_FORMAT="pretty" ``` ```json { "log": { "format": "pretty" } } ``` -------------------------------- ### Build Validator from Source Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/validators/run-validators.mdx Build the validator binary in release mode after cloning the repository and setting up the Rust environment. ```bash cargo build --release bin validator ``` -------------------------------- ### Dispatch with Custom Hook and Empty Metadata Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/reference/hooks/overview.mdx Example of sending a message with a custom `IPostDispatchHook` and empty metadata. ```solidity // send message from originChain to destinationChain TestRecipient IMailbox mailbox = IMailbox("mailbox"); IPostDispatchHook merkleTree = IPostDispatchHook("merkleTreeHook"); mailbox.dispatch( destinationDomain, "paddedRecipient", bytes("body"), "0x", // empty metadata merkleTree ); ``` -------------------------------- ### Run Relayer from Source (AWS KMS) Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/relayer/run-relayer.mdx Execute the built relayer binary from source, configured for AWS KMS. Ensure AWS environment variables are set before running. ```bash # set AWS environment variables export AWS_ACCESS_KEY_ID=ABCDEFGHIJKLMNOP export AWS_SECRET_ACCESS_KEY=xX-haha-nice-try-Xx # run the Relayer ./target/release/relayer \ --db /hyperlane_db \ --relayChains , \ --defaultSigner.type aws \ --defaultSigner.id alias/hyperlane-relayer-1 \ --defaultSigner.region us-east-1 \ ``` -------------------------------- ### Dispatch with Overridden Gas Limit Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/reference/hooks/overview.mdx Example of sending a message with an overridden gas limit using `StandardHookMetadata`. ```solidity // send message from originChain to destinationChain TestRecipient IMailbox mailbox = IMailbox("mailbox"); mailbox.dispatch{value: msg.value}( destinationDomain, "paddedRecipient", bytes("body"), StandardHookMetadata.overrideGasLimit(200000) ); ``` -------------------------------- ### Clone Hyperlane Monorepo Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/quickstart-validator.mdx Clone the Hyperlane monorepo from GitHub to begin the setup process for building from source. ```sh git clone git@github.com:hyperlane-xyz/hyperlane-monorepo.git ``` -------------------------------- ### Set Connection Protocol via Argument Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/config-reference.mdx Configure the connection protocol for a chain using a command-line argument. Defaults to `ethereum` if not specified. ```bash --chains.${CHAIN_NAME}.protocol ethereum --chains.ethereum.protocol ethereum ``` -------------------------------- ### Create Solana Keypair for Deployment Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/deploy-svm-warp-route.mdx Generates a new Solana keypair to be used for deploying contracts. This keypair will own the deployed programs and pay for the deployment transactions. You can also use an existing funded keypair. ```bash solana-keygen new --outfile ./warp-route-deployer-key.json ``` -------------------------------- ### Get Latest Dispatched Message ID (Solidity) Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/implementation-guide.mdx Retrieve the ID of the most recently dispatched message. This is used for authentication in post-dispatch hooks. ```solidity function latestDispatchedId() public view returns (bytes32); ``` -------------------------------- ### Initialize Warp Route Deployment Configuration Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/deploy-warp-route.mdx Use the Hyperlane CLI to interactively create a Warp Route deployment configuration file. This command prompts for network type, chains, token type, and ISM choices. ```bash hyperlane warp init ``` -------------------------------- ### Get Public Key from Keypair Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/deploy-svm-warp-route.mdx Retrieves the public key associated with a Solana keypair file. This is useful for referencing your deployer address. ```bash solana-keygen pubkey ./warp-route-deployer-key.json ``` -------------------------------- ### Build Hyperlane Relayer Binary from Source Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/quickstart-relayer.mdx Compiles the Hyperlane relayer binary in release mode. This is a preparatory step before running the executable directly. ```sh cargo build --release --bin relayer ``` -------------------------------- ### Run Hyperlane Validator from Source with Cargo Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/quickstart-validator.mdx Executes the validator using `cargo run` after building from source. Ensure you have Rust and Cargo installed. ```shell cargo run --release --bin validator -- \ --db ./hyperlane_db_validator_ \ --originChainName \ --checkpointSyncer.type localStorage \ --checkpointSyncer.path $VALIDATOR_SIGNATURES_DIR \ --validator.key ``` -------------------------------- ### Deploy SVM Warp Route with Token Configuration Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/deploy-svm-warp-route.mdx Run this command from the `rust/sealevel/client` directory to deploy a synthetic token warp route. It creates a new token mint and sets token metadata using the provided configuration files. ```bash # run from `rust/sealevel/client` cargo run -- -k ./warp-route-deployer-key.json warp-route deploy \ --warp-route-name eclipsesol \ --environment mainnet3 \ --environments-dir ../environments \ --built-so-dir ../../target/deploy \ --token-config-file ../environments/mainnet3/warp-routes/eclipsesol/token-config.json \ --chain-config-file ../environments/mainnet3/chain-config.json \ --ata-payer-funding-amount 10000000 ``` -------------------------------- ### Deploy Warp Route CLI Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/guides/deploy-warp-route.mdx Initiates the deployment of a Warp Route. Ensure your configuration is ready before running this command. ```bash hyperlane warp deploy ``` -------------------------------- ### Set Connection Protocol via Environment Variable Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/config-reference.mdx Configure the connection protocol for a chain using an environment variable. Defaults to `ethereum` if not specified. ```bash export HYP_CHAINS_${CHAIN_NAME}_PROTOCOL="ethereum" export HYP_CHAINS_ARBITRUM_PROTOCOL="ethereum" ``` -------------------------------- ### Start Hyperlane Validators with Docker Compose Source: https://github.com/hyperlane-xyz/v3-docs/blob/main/docs/operate/docker-quickstart.mdx Command to launch individual Hyperlane validator services using Docker Compose, specifying the environment file for each chain. ```bash docker compose --env-file .env.ethereum up ethereum-validator -d docker compose --env-file .env.optimism up optimism-validator -d docker compose --env-file .env.base up base-validator -d ```