Client: preload encrypted keys when running a daemon
This commit is contained in:
parent
da921a8f56
commit
370114eb8b
@ -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) ;
|
||||
]
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user