hyperlane-monorepo
hyperlane-monorepo copied to clipboard
Migrate infra's update-agent-config.ts to the CLI
Problem
See here for full context and design: https://www.notion.so/hyperlanexyz/Hybrid-HaaS-67195982e71b42de92bc83038498583a?pvs=4#a3831e1497b249028ae6bca6a70994a1
Atm, agent config generation lives in a few different places and is used in a few different ways - we should consolidate this, and make sure that we're able to generate agent configs easily from the registry.
Solution
- Migrate infra's
update-agent-config.tsto a CLI command, e.g.hyperlane config create-agent-config - This command creates a config using the chain metadata and addresses in the registry. It should be possible to run this script with a flag indicating whether the generated agent config should contain all mainnets or testnets.
- It should be possible for anyone to run this CLI command pointing to a local copy of the registry and for this to spit out an agent config. It should accommodate local partial registries
- Some transaction overrides will continue to exist in infra. For our CI pipeline, we will pipe in the transaction overrides to the CLI command as config. This way we continue to include these transaction overrides in the agent config that’s shipped in agent JSONs
- The CI check to ensure agent configs are up to date and accurate should be updated to use this CLI command. The mainnet_config.json would include all mainnet chains found in the
mainbranch of the registry, and the testnet_config.json would include all testnet chains found in themainbranch of the registry