Integrating Bridges
This guide explains how to use Hyperlane to set up a bridge on Artela EVM++ Rollkit. We will start with environment preparation and gradually complete the bridge setup and testing. Refer to the documentation: Hyperlane Documentation
1. Environment Preparation
1.1 Install Necessary Tools
Before starting, make sure the following tools are installed:
- Node.js (recommended version: 22.10.0)
- npm (version 10.9.0 or higher)
hyperlane
CLI tool- jq (installed at
/usr/bin/jq
)
Ensure the testnet or local network is running and you have the following artifacts and assets available:
- Metadata:
- Chain name, e.g.,
artroll1
- Chain ID, e.g.,
11820
- RPC URL, e.g.,
https://rpc.artroll1.com
- Chain name, e.g.,
- A deployer wallet/EOA private key or seed phrase. This EOA should be funded on your custom chain and any chain you will be passing messages to and from.
If you need to deploy ArtRollkit locally, follow these steps:
Clone the ArtRollkit repository:
git clone https://github.com/artela-network/artela-rollkit.git
cd artela-rollkitStart the local test network:
docker compose up -d
Verify the node is running successfully:
curl http://localhost:26657/status
1.2 Ensure Hyperlane CLI is Properly Installed
Verify that the Hyperlane CLI is installed correctly:
hyperlane --version
If it is not installed, run the following commands:
npm install -g @hyperlane-xyz/cli
# Or uninstall old versions
npm uninstall -g @hyperlane-xyz/cli
Ensure the hyperlane
executable is in the correct path:
echo $PATH
1.3 Set Up Working Directory
Create a directory for Hyperlane configuration and operations:
mkdir -p ~/.artroll/hyperlane-bridge && cd ~/.artroll/hyperlane-bridge
3. Configure New Chain
1. Download the Registry
git clone https://github.com/hyperlane-xyz/hyperlane-registry.git
2. Create a Custom Chain Configuration
Run the following command to initialize the configuration file:
hyperlane registry init --registry /your/path/to/hyperlane-registry
The configuration file is located at $HOME/.hyperlane/chains/metadata.yaml
.
3. Configure, Deploy, and Test Core Contracts
Set an environment variable for the private key of the EOA funded on your custom chain:
export HYP_KEY='<YOUR_PRIVATE_KEY>'
Initialize the core contract configuration:
hyperlane core init --registry /your/path/to/hyperlane-registry
Deploy the contracts:
hyperlane core deploy --registry /your/path/to/hyperlane-registry
4. Run a Test Relayer
Run a relayer between your custom chain and Sepolia:
hyperlane relayer --chains yourchain,sepolia
5. Send a Test Message
hyperlane send message --relay
4. Deploy a Warp Route and Bridge a Token
During the deployment of the Warp Router, continue using the HYP_KEY
for signing transactions:
export HYP_KEY='<YOUR_PRIVATE_KEY>'
1. Create Warp Route Configuration File
hyperlane warp init --registry /your/path/to/hyperlane-registry
For Warp Router configuration options, refer to the deployment config schema.
2. Deploy the Warp Route
Deploy the Warp Router to your custom chain and target chain:
hyperlane warp deploy
3. Test the Warp Route
hyperlane warp send --relay --symbol TOKEN --registry /your/path/to/hyperlane-registry
5. Run Local Bridge UI
Build the registry:
cd /your/path/to/hyperlane-registry
yarn build
Clone the UI source code:
git clone https://github.com/hyperlane-xyz/hyperlane-warp-ui-template.git
cd hyperlane-warp-ui-template
Replace the registry package path in package.json
:
"@hyperlane-xyz/registry": "4.11.1",
Change to:
"@hyperlane-xyz/registry": "file:/your/path/to/hyperlane-registry",
Build the source and run:
yarn install && yarn build && yarn start
Then, in the opened browser page, you should see the newly added token pair and custom chain.