Skip to content

Commit

Permalink
Require importKeystoresPath
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Apr 3, 2022
1 parent 43b4c17 commit 31c64f5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/cli/src/cmds/validator/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,16 @@ export async function validatorHandler(args: IValidatorCliArgs & IGlobalArgs): P
await validator.start();

// Start keymanager API backend
// Only if keymanagerEnabled flag is set to true and at least one keystore path is supplied
const firstImportKeystorePath = args.importKeystoresPath?.[0];
if (args.keymanagerEnabled && firstImportKeystorePath) {
// Only if keymanagerEnabled flag is set to true
if (args.keymanagerEnabled) {
if (!args.importKeystoresPath || args.importKeystoresPath.length === 0) {
throw new YargsError("For keymanagerEnabled must set importKeystoresPath to at least 1 path");
}

// Use the first path in importKeystoresPath as directory to write keystores
// KeymanagerApi must ensure that the path is a directory and not a file
const firstImportKeystorePath = args.importKeystoresPath[0];

const keymanagerApi = new KeymanagerApi(logger, validator, firstImportKeystorePath);

const keymanagerServer = new KeymanagerServer(
Expand Down

0 comments on commit 31c64f5

Please sign in to comment.