Hyperlane Bridge Creation Part 2
This instruction provides a detailed overview of how to use Hyperlane Registries and explains how developers can interact with and contribute to them. Key...

This instruction provides a detailed overview of how to use Hyperlane Registries and explains how developers can interact with and contribute to them.
Key Points:
-
Purpose of Registries:
-
Hyperlane allows anyone to deploy contracts on any chain. However, for these deployments to be useful, the necessary details (chain metadata, contract addresses, etc.) must be known.
-
Registries are collections of this important information. There is an official registry maintained by the Hyperlane core team, which provides the core information needed for interacting with Hyperlane contracts.
-
-
Canonical Registry:
-
The canonical registry is maintained by Hyperlane’s core team, and it holds the official metadata for their deployments. This registry can be accessed via their GitHub repository.
-
Developers and community members can also contribute to this canonical registry by following these steps:
-
Fork and clone the registry repository from GitHub.
Here’s a step-by-step guide on how to fork and clone the registry repository from GitHub:
-
Use the Hyperlane CLI and specify the location of your cloned repository with the
--registryflag. -
Execute the required commands.
-
Push your changes and create a pull request (PR) to submit them to the canonical registry.
-
-
-
Custom Registries:
-
Users can create and maintain their own custom registries. These custom registries should follow the same format and structure as the canonical registry.
-
To use a custom registry:
-
You can use the
--registryflag in the CLI to set the path to your custom registry. -
You can also use the
--overridesflag if you want to customize specific data, such as overriding the default metadata or RPC URL.
-
-
After you’ve finished adding or updating data in your custom registry, you can test it. If useful, consider opening a PR to the canonical registry to benefit the wider community.
-
-
Installation & Usage in Javascript/Typescript:
-
To use Hyperlane’s registry in your project, you can install the package using npm or yarn:
npm install @hyperlane-xyz/registry # Or yarn add @hyperlane-xyz/registry -
There are two ways to access registry data:
-
Static Data Access: You can directly import chain metadata and contract addresses from the package:
import { ethereum, ethereumAddresses } from '@hyperlane-xyz/registry'; -
Dynamic Data Access: If you need real-time data, you can use the
GithubRegistryclass to fetch data directly from GitHub:import { GithubRegistry } from '@hyperlane-xyz/registry'; const registry = new GithubRegistry(); const chainMetadata = await registry.getMetadata();
-
-
In summary, Hyperlane provides a system for registering important metadata about chain deployments. The canonical registry is maintained by the Hyperlane team, but anyone can contribute to or create their own registries as long as they follow the standard format. Additionally, developers can use Hyperlane’s registry tools and data in their Javascript/Typescript projects for easier access and interaction.
Comments
Loading comments...