Skip to main content

Hyperlane Quickstart

👋 This guide will help you deploy your Hyperlane bridge to Arthera chain as quickly as possible. This includes the core mailbox and ISM contracts as well as warp route contracts for assets you’re bridging

The guide is intended for testing - by the end you’ll be able to pass messages between Arthera chain and any other in the Hyperlane network.

To go to production, ensure you’ve successfully pushed a registry PR (the last step) and reach back over telegram and we can add Arthera chain to the core chains we have in the CLI and relay for.

Pre-Requisites: Chain Metadata & Funded Wallet​

Anyone can begin this quickstart guide once they have the following artifacts & assets available:

  • A new, custom, or pre-existing network of your choice, including the following metadata:
    • A chain name, e.g. arthera
    • A chain ID, e.g. 10242
    • A RPC URL, e.g. https://rpc.arthera.net
  • A deployer wallet/EOA private key or seed phrase
    • This EOA should be funded on Arthera chain and any chain you will be passing messages to & from
  • The Hyperlane CLI npm package installed (see below)

1) Install the Hyperlane CLI​

To install the Hyperlane CLI npm package globally, run:

pnpm i -g @hyperlane-xyz/cli

Verify the expected version is installed via:

hyperlane --version

To view a list of all available command, run:

hyperlane --help

2) Registry: Add Arthera chain​

Let’s create a custom chain config, run:

hyperlane registry init

Follow the prompts to set up your RPC URL, chain name, and chain ID. Setting up block or gas properties is optional. Once successful, you should see this output:

Skipping updating chain arthera at github registry
Now updating chain arthera at filesystem registry at $HOME/.hyperlane
Done updating chain arthera at filesystem registry

Now, under $HOME/.hyperlane/chains you will find a new folder named with Arthera chain’s name, and a file named metadata.yaml within that folder.

  • Example content of this config at $HOME/.hyperlane/chains/arthera/metadata.yaml :
    # yaml-language-server: $schema=../schema.json
    name: arthera
    chainId: 10242
    domainId: 10242
    protocol: ethereum
    rpcUrls:
    - http: https://rpc.arthera.net
    nativeToken:
    name: Arthera
    symbol: AA
    decimals: 18

3) Core: define & deploy Arthera chain’s core contracts​

Next, let’s configure, deploy and test Arthera chain’s core contracts.

Configure: hyperlane core configure​

  1. From your local environment, source the private key or seed phrase of your funded deployer address via HYP_KEY.For example: export HYP_KEY='<YOUR_PRIVATE_KEY>'

  2. Verify your HYP_KEY is sourced correctly via echo $HYP_KEY

  3. From the same instance, run:

    hyperlane core init
  • After successfully creating a new core deployment config, you can find it in a file named core-config.yaml within ./configs - here is an example config
    owner: "0x16F4898F47c085C41d7Cc6b1dc72B91EA617dcBb"
    defaultIsm:
    type: trustedRelayerIsm
    relayer: "0x16F4898F47c085C41d7Cc6b1dc72B91EA617dcBb"
    defaultHook:
    type: merkleTreeHook
    requiredHook:
    owner: "0x16F4898F47c085C41d7Cc6b1dc72B91EA617dcBb"
    type: protocolFee
    beneficiary: "0x16F4898F47c085C41d7Cc6b1dc72B91EA617dcBb"
    maxProtocolFee: "100000000000000000"
    protocolFee: "0"

Deploy: hyperlane core deploy​

Continuing in the same instance with your HYP_KEY sourced, run:

hyperlane core deploy

Use the arrows and enter to select Arthera chain from the bottom of the mainnet list. It will take about five minutes for all contracts to deploy.

  • Under $HOME/.hyperlane/chains you will find a new folder named with Arthera chain’s name, and a file named addresses.yaml within that folder - example:
    staticMerkleRootMultisigIsmFactory: "0x6906cb4741d3E2322E9f9aA645DfC8AB6F122c47"
    staticMessageIdMultisigIsmFactory: "0x3CE97a32d9C8294691cBd2baC09B078EDa75c429"
    staticAggregationIsmFactory: "0x81f969fDBF48278Ce09685Ce48e03388B6785aF4"
    staticAggregationHookFactory: "0x3d864A3c25F61E3c3A7d02e980453A6E1f0a92A6"
    domainRoutingIsmFactory: "0xC4c01f7B03f0fFa77A0265C600dEF7Ad28BCa5A2"
    proxyAdmin: "0xABb7175d5F123172E7B7Fa467CC9fE4C2FEdb942"
    mailbox: "0x5F58d75A9caDE4e2b191313223978dF049f93b81"
    interchainAccountRouter: "0x43c0745b0dE9Cb780816a24ddE63d79Ca99B5dE8"
    interchainAccountIsm: "0x9C96dC8f4257413225d6B5C47d1afbafc39B269F"
    validatorAnnounce: "0xE3bd39BF92DB385dE6313D6070b035bD934378CB"
    testRecipient: "0xa58462b1943Be1469Ed58db690C78583BA34Fd2E"

Send Core Test Message: hyperlane send message​

In the same instance, run:

hyperlane send message --relay

Currently core self-relay only works from an existing origin chain (e.g. holesky) to Arthera chain. When dispatch is successful, you should see that the message was self-relayed!

🎉 Congrats! You have successfully sent a message to Arthera chain

4) Warp Route: configure & deploy Arthera chain’s warp route contracts​

Now that you have a Hyperlane mailbox and core contracts on your chain, it’s time to set up ERC-20 token bridging between your chain and any other Hyperlane chain.

Configure: hyperlane warp configure​

  1. In the same funded instance, run:

    hyperlane warp init
  2. Select the chains you want to set up a warp route between, e.g. arthera, holesky

  3. Select the token type you want to support for each

    1. Select native if you want to use the native gas token of that chain, e.g. ETH
    2. Select synthetic
      1. synthetic warp routes allows you to lock the token as collateral on one chain and mint a synthetic on another.
      2. You can also select collateralVault to use an ERC-4626 vault as collateral - this enables you to create yield-bearing bridged tokens.
    • If successful, under ./configs you will see the following valid warp route config in file named warp-route-deployment.yaml
      arthera:
      isNft: false
      type: native
      owner: "0x16F4898F47c085C41d7Cc6b1dc72B91EA617dcBb"
      mailbox: "0x5F58d75A9caDE4e2b191313223978dF049f93b81"
      interchainSecurityModule:
      type: staticAggregationIsm
      modules:
      - type: trustedRelayerIsm
      relayer: "0x16F4898F47c085C41d7Cc6b1dc72B91EA617dcBb"
      - owner: "0x16F4898F47c085C41d7Cc6b1dc72B91EA617dcBb"
      type: defaultFallbackRoutingIsm
      domains: {}
      threshold: 1
      holesky:
      isNft: false
      type: native
      owner: "0x16F4898F47c085C41d7Cc6b1dc72B91EA617dcBb"
      mailbox: "0x5b6CFf85442B851A8e6eaBd2A4E4507B5135B3B0"
      interchainSecurityModule:
      type: staticAggregationIsm
      modules:
      - type: trustedRelayerIsm
      relayer: "0x16F4898F47c085C41d7Cc6b1dc72B91EA617dcBb"
      - owner: "0x16F4898F47c085C41d7Cc6b1dc72B91EA617dcBb"
      type: defaultFallbackRoutingIsm
      domains: {}
      threshold: 1

Deploy: hyperlane warp deploy​

Continuing, run and confirm the deployment:

hyperlane warp deploy
  • Example output for your warp route config Under $HOME/.hyperlane/deployments/warp_routes/ you will find a new folder named with Arthera or other chain’s native token name, and two files named holesky-arthera-addresses.yaml & holesky-arthera-config.yaml within that folder
    1. Example contents of this config at $HOME/.hyperlane/deployments/warp_routes/AVAX/holesky-arthera-addresses.yaml based on the above examples:

      arthera:
      native: "0x205A5d97111abe0C53C0459cF37013F16Ff67889"
      holesky:
      synthetic: "0x3924C4E264085f2f832bE5a65A42995A726BdFBf"
    2. Example contents of this config at $HOME/.hyperlane/deployments/warp_routes/AVAX/holesky-arthera-config.yaml based on the above examples:

      # yaml-language-server: $schema=../schema.json
      tokens:
      - chainName: arthera
      standard: EvmHypNative
      totalSupply: 0
      name: Ether
      symbol: ETH
      decimals: 18
      isNft: false
      type: native
      owner: "0x16F4898F47c085C41d7Cc6b1dc72B91EA617dcBb"
      mailbox: "0x5F58d75A9caDE4e2b191313223978dF049f93b81"
      interchainSecurityModule:
      type: staticAggregationIsm
      modules:
      - type: trustedRelayerIsm
      relayer: "0x16F4898F47c085C41d7Cc6b1dc72B91EA617dcBb"
      - owner: "0x16F4898F47c085C41d7Cc6b1dc72B91EA617dcBb"
      type: defaultFallbackRoutingIsm
      domains: {}
      threshold: 1
      addressOrDenom: "0x205A5d97111abe0C53C0459cF37013F16Ff67889"
      connections:
      - token: ethereum|holesky|0x3924C4E264085f2f832bE5a65A42995A726BdFBf
      - chainName: holesky
      standard: EvmHypSynthetic
      totalSupply: 0
      name: Ether
      symbol: ETH
      decimals: 18
      isNft: false
      type: synthetic
      owner: "0x16F4898F47c085C41d7Cc6b1dc72B91EA617dcBb"
      mailbox: "0x5b6CFf85442B851A8e6eaBd2A4E4507B5135B3B0"
      interchainSecurityModule:
      type: staticAggregationIsm
      modules:
      - type: trustedRelayerIsm
      relayer: "0x16F4898F47c085C41d7Cc6b1dc72B91EA617dcBb"
      - owner: "0x16F4898F47c085C41d7Cc6b1dc72B91EA617dcBb"
      type: defaultFallbackRoutingIsm
      domains: {}
      threshold: 1
      addressOrDenom: "0x3924C4E264085f2f832bE5a65A42995A726BdFBf"
      connections:
      - token: ethereum|arthera|0x205A5d97111abe0C53C0459cF37013F16Ff67889

đź’¸ Well done, a Hyperlane warp route is now deployed to Arthera chain.

Send Warp Test Message: hyperlane warp send​

Run a command that includes your warp route config:

hyperlane warp send --relay --warp $HOME/.hyperlane/deployments/warp_routes/TOKEN/corechain-arthera-config.yaml

You can test in either direction between where you have the warp route set. However, if you deployed native and synthetic warp routes, you must select the origin with the native route deployed.

5) Submit to Registry: ensure Arthera configs & deployments are available in the registry​

If you want other chains to connect with you as well as to take this to production with Abacus Works, make a registry PR.

  1. Navigate to your local instance of the registry and commit changes
cd ~/.hyperlane && git init && git add . && git commit
  1. Sync local registry with canonical registry
git remote add canonical git@github.com:hyperlane-xyz/hyperlane-registry.git
git pull canonical main --rebase
  1. Push local registry to github fork and submit a PR

🏅 Congrats! You have successfully deployed Hyperlane to Arthera chain and added your work to the Hyperlane registry.

Thank you for contributing to the future of permissionless interop 🫡

info

Latest update: June 27, 2023