UNPKG

@lodestar/prover

Version:

A Typescript implementation of the Ethereum Consensus light client

54 lines 1.67 kB
import { networksChainConfig } from "@lodestar/config/networks"; import { ACTIVE_PRESET } from "@lodestar/params"; import { LogLevels } from "@lodestar/utils"; import { YargsError } from "../utils/errors.js"; export const globalOptions = { network: { description: "Specify the network to connect.", type: "string", choices: [ ...Object.keys(networksChainConfig), // Leave always as last network. The order matters for the --help printout "dev", ], conflicts: ["paramsFile"], }, paramsFile: { description: "Network configuration file", type: "string", conflicts: ["network"], }, logLevel: { description: "Set the log level.", type: "string", choices: LogLevels, default: "info", }, // hidden option to allow for LODESTAR_PRESET to be set preset: { hidden: true, type: "string", default: ACTIVE_PRESET, }, presetFile: { hidden: true, description: "Preset configuration file to override the active preset with custom values", type: "string", }, }; export function parseGlobalArgs(args) { // Remove undefined values to allow deepmerge to inject default values downstream if (args.network) { return { network: args.network, logLevel: args.logLevel, }; } if (args.paramsFile) { return { logLevel: args.logLevel, paramsFile: args.paramsFile, }; } throw new YargsError("Either --network or --paramsFile must be provided"); } //# sourceMappingURL=options.js.map