This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Hyperlane Registry is a TypeScript library that provides configs, artifacts, and schemas for the Hyperlane interchain communication protocol. It serves as a central source of truth for chain metadata, deployment addresses, and warp route configurations used by Hyperlane tooling (Explorer, CLI).
# Build (runs build.ts script then TypeScript compilation)
pnpm run build
# Lint (checks src/, chains/, and deployments/ directories)
pnpm run lint
pnpm run lint:fix
# Format YAML and other files
pnpm run prettier
# Run unit tests (requires build first)
pnpm run test:unit
# Run a single test file
pnpm run build && mocha --require dotenv/config --config .mocharc.json './test/unit/<filename>.test.ts' --exit
# RPC health checks
pnpm run test:rpc-health-mainnet
pnpm run test:rpc-health-testnet-
chains/: One directory per chain containing:
metadata.yaml- Chain metadata (chainId, RPC URLs, block explorers, native token)addresses.yaml- Deployed contract addresses (mailbox, ISM factories, hooks)logo.svg- Chain logo
-
deployments/warp_routes/: Warp route token configurations organized by token symbol
{chains}-config.yaml- Warp core config for token routes{chains}-deploy.yaml- Deployment config
The library exports multiple registry implementations:
IRegistry- Interface defining all registry operationsBaseRegistry- Abstract base with caching and common logicGithubRegistry- Fetches from GitHub raw URLsFileSystemRegistry(src/fs/) - Local filesystem operationsHttpClientRegistry- Generic HTTP client implementationMergedRegistry- Combines multiple registriesPartialRegistry- Partial implementation wrapper
- Copies
src/totmp/directory - Parses all chain YAML files into JSON and TypeScript exports
- Generates combined
chains/metadata.yamlandchains/addresses.yamlfiles - Parses warp route configs and generates TypeScript exports
- Updates JSON schemas from Zod definitions
- TypeScript compiles from
tmp/todist/
The package exports chain metadata, addresses, and warp route configs in multiple formats:
- Individual chain imports:
@hyperlane-xyz/registry/chains/{chainName} - Combined maps:
chainMetadata,chainAddresses,warpRouteConfigs - Registry classes for programmatic access
- YAML files must have keys sorted alphabetically (enforced by ESLint)
- Warp route IDs follow format:
{SYMBOL}/{label}where label is typically chain names joined by- - The
src/fs/module contains Node.js-specific code and is isolated to prevent bundling issues - No Node.js imports allowed in main
src/files (exceptsrc/fs/) - Pre-commit hooks run prettier and eslint on staged files
@hyperlane-xyz/sdk- Hyperlane SDK types (ChainMetadata, WarpCoreConfig)@hyperlane-xyz/utils- Utility functions and ESLint plugin for YAML sortingzod- Schema validationyaml- YAML parsing/serialization