Verified Commit 9d20295a authored by Vincent Botbol's avatar Vincent Botbol Committed by Grégoire Henry

Alpha/Daemons: enforce waiting for a bootstrapped node before starting daemons

parent 1cabf776
......@@ -23,9 +23,16 @@
(* *)
(*****************************************************************************)
let await_bootstrapped_node (cctxt: #Proto_alpha.full) =
(* Waiting for the node to be synchronized *)
cctxt#message "Waiting for the node to be synchronized with the its \
peers..." >>= fun () ->
Shell_services.Monitor.bootstrapped cctxt
module Endorser = struct
let run (cctxt : #Proto_alpha.full) ~delay ?min_date delegates =
await_bootstrapped_node cctxt >>=? fun _ ->
Client_baking_blocks.monitor_heads
~next_protocols:(Some [Proto_alpha.hash])
cctxt `Main >>=? fun block_stream ->
......@@ -38,6 +45,7 @@ end
module Baker = struct
let run (cctxt : #Proto_alpha.full) ?fee_threshold ?max_priority ?min_date ~context_path delegates =
await_bootstrapped_node cctxt >>=? fun _ ->
Client_baking_blocks.monitor_heads
~next_protocols:(Some [Proto_alpha.hash])
cctxt `Main >>=? fun block_stream ->
......@@ -51,6 +59,7 @@ end
module Accuser = struct
let run (cctxt : #Proto_alpha.full) ~preserved_levels =
await_bootstrapped_node cctxt >>=? fun _ ->
Client_baking_blocks.monitor_valid_blocks
~next_protocols:(Some [Proto_alpha.hash])
cctxt ~chains:[ `Main ] () >>=? fun valid_blocks_stream ->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment