Client: preload encrypted keys when running a daemon

This commit is contained in:
Grégoire Henry 2018-05-26 13:41:56 +02:00
parent da921a8f56
commit 370114eb8b
2 changed files with 15 additions and 0 deletions

View File

@ -62,6 +62,7 @@ let commands =
with Failure _ -> failwith "Invalid port %s" x))))
(prefixes [ "launch" ; "socket" ; "signer" ] @@ stop)
(fun (host, port) cctxt ->
Tezos_signer_backends.Encrypted.decrypt_all cctxt >>=? fun () ->
Socket_daemon.run cctxt (Tcp (host, port))) ;
command ~group
~desc: "Launch a signer daemon over a local Unix socket."
@ -75,6 +76,7 @@ let commands =
(parameter (fun _ s -> return s))))
(prefixes [ "launch" ; "local" ; "signer" ] @@ stop)
(fun path cctxt ->
Tezos_signer_backends.Encrypted.decrypt_all cctxt >>=? fun () ->
Socket_daemon.run cctxt (Unix path)) ;
command ~group
~desc: "Launch a signer daemon over HTTPS."
@ -106,6 +108,7 @@ let commands =
~desc: "path to th TLS key"
(parameter (fun _ s -> return s)) @@ stop)
(fun (host, port) cert key cctxt ->
Tezos_signer_backends.Encrypted.decrypt_all cctxt >>=? fun () ->
Https_daemon.run cctxt ~host ~port ~cert ~key) ;
]

View File

@ -8,6 +8,18 @@
(**************************************************************************)
let run (cctxt : #Proto_alpha.full) ?max_priority ~delay ?min_date delegates ~endorsement ~denunciation ~baking =
begin
match delegates with
| [] ->
Tezos_signer_backends.Encrypted.decrypt_all cctxt
| _ :: _ ->
iter_s
(fun k ->
Client_keys.get_key cctxt k >>=? fun (_, _, sk_uri) ->
Client_keys.neuterize sk_uri >>=? fun _ ->
return ())
delegates
end >>=? fun () ->
(* TODO really detach... *)
let endorsement =
if endorsement then