Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rename prover CLI start command as proxy and make it default #6428

Merged
merged 3 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: '*'});
Copy link
Member

@nflaig nflaig Feb 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if you run lodestar-prover --help, I would assume it no longer prints out global flags and a list of available commands.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It prints the global help screen, as before. lodestar-prover proxy --help prints the help for the proxy command as expected.


// 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
Loading