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 06c7f6a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 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 \
--network sepolia \
--execution-rpc https://lodestar-sepoliarpc.chainsafe.io \
--mode rest \
Expand Down
10 changes: 2 additions & 8 deletions 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 {proverProxyStartCommand} from "./cmds/index.js";
import {globalOptions} from "./options.js";

const {version} = getVersionData();
Expand Down Expand Up @@ -43,13 +43,7 @@ export function getLodestarProverCli(): yargs.Argv {
.alias("v", "version")
.recommendCommands();

// yargs.command and all ./cmds
for (const cmd of cmds) {
registerCommandToYargs(prover, cmd);
}

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

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

export const cmds: Required<CliCommand<GlobalArgs, Record<never, never>>>["subcommands"] = [proverProxyStartCommand];
export {proverProxyStartCommand} from "./start/index.js";
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: "*",
describe: "Start proxy server",
examples: [
{
Expand Down

0 comments on commit 06c7f6a

Please sign in to comment.