From 9c7dbcb947bcf5c396736f1cb92ff0b4b1f0b1b7 Mon Sep 17 00:00:00 2001 From: Nam Chu Hoai Date: Fri, 15 Dec 2023 10:59:04 -0500 Subject: [PATCH] Default domainId and protocolType (#3041) ### Description We only support EVM chains today, so folks pretty much should always use the chainId as the domainId and not choose any other protocol type other than ethereum. So removing the optionality for now until that changes --- .changeset/purple-bulldogs-report.md | 5 +++++ typescript/cli/src/config/chain.ts | 23 +++-------------------- 2 files changed, 8 insertions(+), 20 deletions(-) create mode 100644 .changeset/purple-bulldogs-report.md diff --git a/.changeset/purple-bulldogs-report.md b/.changeset/purple-bulldogs-report.md new file mode 100644 index 000000000..d4e9aa39b --- /dev/null +++ b/.changeset/purple-bulldogs-report.md @@ -0,0 +1,5 @@ +--- +'@hyperlane-xyz/cli': patch +--- + +Remove domainId and protocolType setting when creating chain config diff --git a/typescript/cli/src/config/chain.ts b/typescript/cli/src/config/chain.ts index 2f33292bc..f3499fde7 100644 --- a/typescript/cli/src/config/chain.ts +++ b/typescript/cli/src/config/chain.ts @@ -1,4 +1,4 @@ -import { confirm, input, select } from '@inquirer/prompts'; +import { input } from '@inquirer/prompts'; import { ChainMap, @@ -81,30 +81,13 @@ export async function createChainConfig({ message: 'Enter chain name (one word, lower case)', }); const chainId = await input({ message: 'Enter chain id (number)' }); - const skipDomain = await confirm({ - message: 'Will the domainId match the chainId (recommended)?', - }); - let domainId: string; - if (skipDomain) { - domainId = chainId; - } else { - domainId = await input({ - message: 'Enter domain id (number, often matches chainId)', - }); - } - const protocol = await select({ - message: 'Select protocol type', - choices: Object.values(ProtocolType).map((protocol) => ({ - name: protocol, - value: protocol, - })), - }); + const domainId = chainId; const rpcUrl = await input({ message: 'Enter http or https rpc url' }); const metadata: ChainMetadata = { name, chainId: parseInt(chainId, 10), domainId: parseInt(domainId, 10), - protocol, + protocol: ProtocolType.Ethereum, rpcUrls: [{ http: rpcUrl }], }; const parseResult = ChainMetadataSchema.safeParse(metadata);