Skip to content

Commit 5434099

Browse files
committed
Progress counter for key import
1 parent fb928a4 commit 5434099

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

vc-utils/keymanager.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ validator-import() {
846846
local keyfile
847847
local passfile
848848
local yn
849+
local i
849850

850851
__eth2_val_tools=0
851852

@@ -893,6 +894,8 @@ and secrets directories into .eth/validator_keys instead."
893894
password="${KEYSTORE_PASSWORD}"
894895
justone=1
895896
else
897+
echo "You are about to import ${num_files} keys."
898+
echo
896899
echo "WARNING - imported keys are immediately live. If these keys exist elsewhere,"
897900
echo "you WILL get slashed. If it has been less than 15 minutes since you deleted them elsewhere,"
898901
echo "you are at risk of getting slashed. Exercise caution"
@@ -934,10 +937,12 @@ and secrets directories into .eth/validator_keys instead."
934937
fi
935938
fi
936939
reg_errored=0
940+
i=0
937941
# See https://www.shellcheck.net/wiki/SC2044 as for why
938942
# Using file descriptor 3 so this doesn't conflict with the "different passwords" read
939943
# Could also use dialog, but would need to make sure it exists
940944
while IFS= read -r -u 3 keyfile; do
945+
(( i+=1 ))
941946
[[ -f "${keyfile}" ]] || continue
942947
keydir=$(dirname "${keyfile}")
943948
__pubkey=0x$(jq -r '.pubkey' "${keyfile}")
@@ -1024,6 +1029,7 @@ and secrets directories into .eth/validator_keys instead."
10241029
jq --arg keystore_value "${keystore_json}" --arg password_value "${password}" --slurpfile protect_value /tmp/protect.json '. | .keystores += [$keystore_value] | .passwords += [$password_value] | . += {slashing_protection: $protect_value[0]}' <<< '{}' >/tmp/apidata.txt
10251030
fi
10261031

1032+
echo "Importing key ${i} of ${num_files}"
10271033
if [[ "${WEB3SIGNER}" = "true" ]]; then
10281034
__token=NIL
10291035
vc_api_container=${__api_container}

0 commit comments

Comments
 (0)