Skip to content

Commit

Permalink
feat: make start command default for prover CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
jeluard committed Feb 14, 2024
1 parent cd7421e commit be84c20
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/prover/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ You can also invoke the package as binary.
```bash
npm -i g @lodestar/prover

lodestar-prover start \
lodestar-prover proxy \
--network sepolia \
--execution-rpc https://lodestar-sepoliarpc.chainsafe.io \
--mode rest \
Expand Down
5 changes: 4 additions & 1 deletion packages/prover/src/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import yargs from "yargs";
import {hideBin} from "yargs/helpers";
import {registerCommandToYargs} from "../utils/command.js";
import {getVersionData} from "../utils/version.js";
import {cmds} from "./cmds/index.js";
import {cmds, proverProxyStartCommand} from "./cmds/index.js";
import {globalOptions} from "./options.js";

const {version} = getVersionData();
Expand Down Expand Up @@ -48,6 +48,9 @@ export function getLodestarProverCli(): yargs.Argv {
registerCommandToYargs(prover, cmd);
}

// Register the proxy command as the default one
registerCommandToYargs(prover, {...proverProxyStartCommand, command: '*'});

// throw an error if we see an unrecognized cmd
prover.recommendCommands().strict();

Expand Down
1 change: 1 addition & 0 deletions packages/prover/src/cli/cmds/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {CliCommand} from "../../utils/command.js";
import {GlobalArgs} from "../options.js";
import {proverProxyStartCommand} from "./start/index.js";
export {proverProxyStartCommand} from "./start/index.js";

export const cmds: Required<CliCommand<GlobalArgs, Record<never, never>>>["subcommands"] = [proverProxyStartCommand];
2 changes: 1 addition & 1 deletion packages/prover/src/cli/cmds/start/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {proverProxyStartHandler} from "./handler.js";
import {StartArgs, startOptions} from "./options.js";

export const proverProxyStartCommand: CliCommand<StartArgs, GlobalArgs> = {
command: "start",
command: "proxy",
describe: "Start proxy server",
examples: [
{
Expand Down

0 comments on commit be84c20

Please sign in to comment.