This commit is contained in:
Zahary Karadjov 2020-11-28 20:50:09 +02:00 committed by zah
parent 7e4fd325b5
commit ae19ab72c0
2 changed files with 13 additions and 2 deletions

View File

@ -360,7 +360,7 @@ type
of DepositsCmd.`import`:
importedDepositsDir* {.
argument
desc: "A directory with keystores to import" }: InputDir
desc: "A directory with keystores to import" }: Option[InputDir]
of DepositsCmd.status:
discard

View File

@ -1288,9 +1288,20 @@ programMain:
quit 1
of DepositsCmd.`import`:
let validatorKeysDir = config.importedDepositsDir.get:
let cwd = os.getCurrentDir()
if dirExists(cwd / "validator_keys"):
InputDir(cwd / "validator_keys")
else:
echo "The default search path for validator keys is a sub-directory " &
"named 'validator_keys' in the current working directory. Since " &
"no such directory exists, please either provide the correct path" &
"as an argument or copy the imported keys in the expected location."
quit 1
importKeystoresFromDir(
rng[],
config.importedDepositsDir.string,
validatorKeysDir.string,
config.validatorsDir, config.secretsDir)
of DepositsCmd.status: