Alpha/Daemons: enforce waiting for a bootstrapped node before starting daemons
This commit is contained in:
parent
1cabf7763f
commit
9d20295a2b
@ -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 ->
|
||||
|
Loading…
Reference in New Issue
Block a user