cosmic-interchain-cli
Version:
A command-line utility for Cosmic Wire's interchain messaging protocol
176 lines • 5.72 kB
JavaScript
import os from 'os';
import { DEFAULT_GITHUB_REGISTRY } from '@hyperlane-xyz/registry';
import { LogFormat, LogLevel } from '@hyperlane-xyz/utils';
import { ENV } from '../utils/env.js';
/* Global options */
export const demandOption = (option) => ({
...option,
demandOption: true,
});
export const logFormatCommandOption = {
type: 'string',
description: 'Log output format',
choices: Object.values(LogFormat),
};
export const logLevelCommandOption = {
type: 'string',
description: 'Log verbosity level',
choices: Object.values(LogLevel),
};
export const registryUriCommandOption = {
type: 'string',
description: 'Registry URI, such as a Github repo URL or a local file path',
alias: 'r',
default: DEFAULT_GITHUB_REGISTRY,
};
export const overrideRegistryUriCommandOption = {
type: 'string',
description: 'Path to a local registry to override the default registry',
default: `${os.homedir()}/.hyperlane`,
};
export const skipConfirmationOption = {
type: 'boolean',
description: 'Skip confirmation prompts',
default: false,
alias: 'y',
};
export const keyCommandOption = {
type: 'string',
description: 'A hex private key or seed phrase for transaction signing, or use the HYP_KEY env var.',
alias: ['k', 'private-key', 'seed-phrase'],
default: ENV.HYP_KEY,
defaultDescription: 'process.env.HYP_KEY',
};
/* Command-specific options */
export const coreTargetsCommandOption = {
type: 'string',
description: 'Comma separated list of chain names to which contracts will be deployed',
};
export const agentTargetsCommandOption = {
type: 'string',
description: 'Comma separated list of chains to relay between',
};
export const originCommandOption = {
type: 'string',
description: 'The name of the origin chain to deploy to',
};
export const ismCommandOption = {
type: 'string',
description: 'A path to a JSON or YAML file with basic or advanced ISM configs (e.g. Multisig)',
};
export const hookCommandOption = {
type: 'string',
description: 'A path to a JSON or YAML file with Hook configs (for every chain)',
};
export const warpDeploymentConfigCommandOption = {
type: 'string',
description: 'A path to a JSON or YAML file with a warp route deployment config.',
default: './configs/warp-route-deployment.yaml',
alias: 'wd',
};
export const warpCoreConfigCommandOption = {
type: 'string',
description: 'File path to Warp Route config',
alias: 'wc',
};
export const agentConfigCommandOption = (isIn, defaultPath) => ({
type: 'string',
description: `${isIn ? 'Input' : 'Output'} file path for the agent configuration`,
default: defaultPath,
});
export const chainTargetsCommandOption = {
type: 'string',
description: 'Comma-separated list of chain names',
alias: 'c',
};
export const outputFileCommandOption = (defaultPath, demandOption = false, description = 'Output file path') => ({
type: 'string',
description,
default: defaultPath,
alias: 'o',
demandOption,
});
export const inputFileCommandOption = {
type: 'string',
description: 'Input file path',
alias: 'i',
demandOption: true,
};
export const fromAddressCommandOption = {
type: 'string',
description: `An address to simulate transaction signing on a forked network`,
alias: 'f',
};
export const dryRunCommandOption = {
type: 'string',
description: 'Chain name to fork and simulate deployment. Please ensure an anvil node instance is running during execution via `anvil`.',
alias: 'd',
};
export const chainCommandOption = {
type: 'string',
description: 'The specific chain to perform operations with.',
};
export const symbolCommandOption = {
type: 'string',
description: 'Token symbol (e.g. ETH, USDC)',
};
export const validatorCommandOption = {
type: 'string',
description: 'Comma separated list of validator addresses',
demandOption: true,
};
export const transactionsCommandOption = {
type: 'string',
description: 'The transaction input file path.',
alias: ['t', 'txs', 'txns'],
demandOption: true,
};
export const strategyCommandOption = {
type: 'string',
description: 'The submission strategy input file path.',
alias: 's',
demandOption: true,
};
export const addressCommandOption = (description, demandOption = false) => ({
type: 'string',
description,
demandOption,
});
/* Validator options */
export const awsAccessKeyCommandOption = {
type: 'string',
description: 'AWS access key of IAM user associated with validator',
default: ENV.AWS_ACCESS_KEY_ID,
defaultDescription: 'process.env.AWS_ACCESS_KEY_ID',
};
export const awsSecretKeyCommandOption = {
type: 'string',
description: 'AWS secret access key of IAM user associated with validator',
default: ENV.AWS_SECRET_ACCESS_KEY,
defaultDescription: 'process.env.AWS_SECRET_ACCESS_KEY',
};
export const awsRegionCommandOption = {
type: 'string',
describe: 'AWS region associated with validator',
default: ENV.AWS_REGION,
defaultDescription: 'process.env.AWS_REGION',
};
export const awsBucketCommandOption = {
type: 'string',
describe: 'AWS S3 bucket containing validator signatures and announcement',
};
export const awsKeyIdCommandOption = {
type: 'string',
describe: 'Key ID from AWS KMS',
};
export const operatorKeyPathCommandOption = {
type: 'string',
description: 'Path to the operator key file',
};
export const avsChainCommandOption = {
type: 'string',
description: 'Chain to interact with the AVS on',
demandOption: true,
choices: ['holesky', 'ethereum'],
};
//# sourceMappingURL=options.js.map