Skip to content

Commit

Permalink
Merge pull request #492 from serokell/rvem/#491-fix-remote-signer-bak…
Browse files Browse the repository at this point in the history
…ing-setup

[#491] 'setup ledger to bake for' only for ledger key
  • Loading branch information
rvem authored Jul 6, 2022
2 parents 708d0dc + 2a0b2a4 commit 86d33a3
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions docker/package/tezos_setup_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@
"skip": "Skip snapshot import and synchronize with the network from scratch",
}

key_import_modes = {
"ledger": "From a ledger",
"secret-key": "Either the unencrypted or password-encrypted secret key for your address",
"remote": "Remote key governed by a signer running on a different machine",
"json": "Faucet JSON file from https://teztnets.xyz/",
}

systemd_enable = {
"yes": "Enable the services, running them both now and on every boot",
"no": "Start the services this time only",
Expand Down Expand Up @@ -398,18 +391,21 @@ def import_baker_key(self):

key_mode_query = get_key_mode_query(key_import_modes)

ledger_set_up = False
while not ledger_set_up:
baker_set_up = False
while not baker_set_up:
self.import_key(key_mode_query, "Baking")

try:
proc_call(
f"sudo -u tezos {suppress_warning_text} tezos-client {tezos_client_options} "
f"setup ledger to bake for {baker_alias} --main-hwm {self.get_current_head_level()}"
)
ledger_set_up = True
except PermissionError:
print("Going back to the import mode selection.")
if self.config["key_import_mode"] == "ledger":
try:
proc_call(
f"sudo -u tezos {suppress_warning_text} tezos-client {tezos_client_options} "
f"setup ledger to bake for {baker_alias} --main-hwm {self.get_current_head_level()}"
)
baker_set_up = True
except PermissionError:
print("Going back to the import mode selection.")
else:
baker_set_up = True

def register_baker(self):
print()
Expand Down

0 comments on commit 86d33a3

Please sign in to comment.