fix(cli): Rename `hyperlane config create chain` -> `hyperlane registry init` (#3978)

### Description
Renames `hyperlane config create chain` -> `hyperlane registry init` as
according to
https://www.notion.so/hyperlanexyz/Must-use-config-to-create-a-new-chain-instead-of-the-registry-command-f7b407b29a834f7288f20e4c08bc206e?pvs=4

### Drive-by changes
- Rename `configure` to `init` for all functions
- Reorder functions alphabetically 

### Backward compatibility
No

### Testing

Manual
pull/4011/head
Lee 5 months ago committed by GitHub
parent 28f047739c
commit 5c8ba0b850
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      .changeset/giant-lies-whisper.md
  2. 28
      typescript/cli/src/commands/config.ts
  3. 6
      typescript/cli/src/commands/core.ts
  4. 15
      typescript/cli/src/commands/registry.ts
  5. 6
      typescript/cli/src/commands/warp.ts

@ -0,0 +1,5 @@
---
'@hyperlane-xyz/cli': minor
---
Rename hyperlane config create chain -> hyperlane registry init. Rename all `configure` to `init`

@ -1,6 +1,6 @@
import { CommandModule } from 'yargs'; import { CommandModule } from 'yargs';
import { createChainConfig, readChainConfigs } from '../config/chain.js'; import { readChainConfigs } from '../config/chain.js';
import { readIsmConfig } from '../config/ism.js'; import { readIsmConfig } from '../config/ism.js';
import { readMultisigConfig } from '../config/multisig.js'; import { readMultisigConfig } from '../config/multisig.js';
import { readWarpRouteDeployConfig } from '../config/warp.js'; import { readWarpRouteDeployConfig } from '../config/warp.js';
@ -16,34 +16,10 @@ export const configCommand: CommandModule = {
command: 'config', command: 'config',
describe: 'Create or validate Hyperlane configs', describe: 'Create or validate Hyperlane configs',
builder: (yargs) => builder: (yargs) =>
yargs yargs.command(validateCommand).version(false).demandCommand(),
.command(createCommand)
.command(validateCommand)
.version(false)
.demandCommand(),
handler: () => log('Command required'),
};
/**
* Create commands
*/
const createCommand: CommandModule = {
command: 'create',
describe: 'Create a new Hyperlane config',
builder: (yargs) =>
yargs.command(createChainConfigCommand).version(false).demandCommand(),
handler: () => log('Command required'), handler: () => log('Command required'),
}; };
const createChainConfigCommand: CommandModuleWithContext<{}> = {
command: 'chain',
describe: 'Create a new, minimal Hyperlane chain config (aka chain metadata)',
handler: async ({ context }) => {
await createChainConfig({ context });
process.exit(0);
},
};
/** /**
* Validate commands * Validate commands
*/ */

@ -32,8 +32,8 @@ export const coreCommand: CommandModule = {
describe: 'Manage core Hyperlane contracts & configs', describe: 'Manage core Hyperlane contracts & configs',
builder: (yargs) => builder: (yargs) =>
yargs yargs
.command(configure)
.command(deploy) .command(deploy)
.command(init)
.command(read) .command(read)
.version(false) .version(false)
.demandCommand(), .demandCommand(),
@ -82,11 +82,11 @@ export const deploy: CommandModuleWithWriteContext<{
}, },
}; };
export const configure: CommandModuleWithContext<{ export const init: CommandModuleWithContext<{
advanced: boolean; advanced: boolean;
config: string; config: string;
}> = { }> = {
command: 'configure', command: 'init',
describe: 'Create a core configuration, including ISMs and hooks.', describe: 'Create a core configuration, including ISMs and hooks.',
builder: { builder: {
advanced: { advanced: {

@ -1,6 +1,7 @@
import { CommandModule } from 'yargs'; import { CommandModule } from 'yargs';
import { createAgentConfig } from '../config/agent.js'; import { createAgentConfig } from '../config/agent.js';
import { createChainConfig } from '../config/chain.js';
import { CommandContext, CommandModuleWithContext } from '../context/types.js'; import { CommandContext, CommandModuleWithContext } from '../context/types.js';
import { log, logBlue, logGray, logRed, logTable } from '../logger.js'; import { log, logBlue, logGray, logRed, logTable } from '../logger.js';
@ -15,12 +16,13 @@ import { ChainType, ChainTypes } from './types.js';
*/ */
export const registryCommand: CommandModule = { export const registryCommand: CommandModule = {
command: 'registry', command: 'registry',
describe: 'View information about Hyperlane chains in a registry', describe: 'Manage Hyperlane chains in a registry',
builder: (yargs) => builder: (yargs) =>
yargs yargs
.command(listCommand)
.command(addressesCommand) .command(addressesCommand)
.command(createAgentConfigCommand) .command(createAgentConfigCommand)
.command(initCommand)
.command(listCommand)
.version(false) .version(false)
.demandCommand(), .demandCommand(),
handler: () => log('Command required'), handler: () => log('Command required'),
@ -140,3 +142,12 @@ const createAgentConfigCommand: CommandModuleWithContext<{
process.exit(0); process.exit(0);
}, },
}; };
const initCommand: CommandModuleWithContext<{}> = {
command: 'init',
describe: 'Create a new, minimal Hyperlane chain config (aka chain metadata)',
handler: async ({ context }) => {
await createChainConfig({ context });
process.exit(0);
},
};

@ -43,8 +43,8 @@ export const warpCommand: CommandModule = {
describe: 'Manage Hyperlane warp routes', describe: 'Manage Hyperlane warp routes',
builder: (yargs) => builder: (yargs) =>
yargs yargs
.command(configure)
.command(deploy) .command(deploy)
.command(init)
.command(read) .command(read)
.command(send) .command(send)
.version(false) .version(false)
@ -82,11 +82,11 @@ export const deploy: CommandModuleWithWriteContext<{
}, },
}; };
export const configure: CommandModuleWithContext<{ export const init: CommandModuleWithContext<{
advanced: boolean; advanced: boolean;
out: string; out: string;
}> = { }> = {
command: 'configure', command: 'init',
describe: 'Create a warp route configuration.', describe: 'Create a warp route configuration.',
builder: { builder: {
advanced: { advanced: {

Loading…
Cancel
Save