diff --git a/src/proto_021_PsQuebec/lib_agnostic_baker/baker_commands_helpers.ml b/src/proto_021_PsQuebec/lib_agnostic_baker/baker_commands_helpers.ml index 89fe030096a9aa605701c77f5ccfdad575825488..aec8fbe93a4234ddc72ecfe34e9e811ccbf61a38 100644 --- a/src/proto_021_PsQuebec/lib_agnostic_baker/baker_commands_helpers.ml +++ b/src/proto_021_PsQuebec/lib_agnostic_baker/baker_commands_helpers.ml @@ -11,8 +11,17 @@ let run_baker ~configuration ~baking_mode ~sources ~cctxt = let baking_mode = Baker_args_parser.parse_baking_mode baking_mode in let* sources = Baker_args_parser.parse_sources sources in let cctxt = new Protocol_client_context.wrap_full cctxt in - Baking_commands.run_baker args baking_mode sources cctxt + Baking_commands.run_baker + ~recommend_agnostic_baker:false + args + baking_mode + sources + cctxt let run_vdf_daemon ~cctxt ~keep_alive = let cctxt = new Protocol_client_context.wrap_full cctxt in - Client_daemon.VDF.run cctxt ~chain:cctxt#chain ~keep_alive + Client_daemon.VDF.run + ~recommend_agnostic_baker:false + cctxt + ~chain:cctxt#chain + ~keep_alive diff --git a/src/proto_021_PsQuebec/lib_delegate/baking_commands.ml b/src/proto_021_PsQuebec/lib_delegate/baking_commands.ml index c50621ba586f308b135c537122d92ae86dbe447e..da310b94a93f69d1c0553e66cdd491f39d3273f4 100644 --- a/src/proto_021_PsQuebec/lib_delegate/baking_commands.ml +++ b/src/proto_021_PsQuebec/lib_delegate/baking_commands.ml @@ -733,7 +733,7 @@ let baker_args = pre_emptive_forge_time_arg remote_calls_timeout_arg -let run_baker +let run_baker ?(recommend_agnostic_baker = true) ( pidfile, node_version_check_bypass, node_version_allowed, @@ -753,6 +753,10 @@ let run_baker remote_calls_timeout ) baking_mode sources cctxt = let open Lwt_result_syntax in may_lock_pidfile pidfile @@ fun () -> + let*! () = + if recommend_agnostic_baker then Events.(emit recommend_octez_baker ()) + else Lwt.return_unit + in let* () = check_node_version cctxt node_version_check_bypass node_version_allowed in diff --git a/src/proto_021_PsQuebec/lib_delegate/baking_commands.mli b/src/proto_021_PsQuebec/lib_delegate/baking_commands.mli index c808d30553300e0051930ef11470845e00660c7b..a733adf942a3b5d500aca6d5a1155b6c8563715d 100644 --- a/src/proto_021_PsQuebec/lib_delegate/baking_commands.mli +++ b/src/proto_021_PsQuebec/lib_delegate/baking_commands.mli @@ -26,6 +26,7 @@ type baking_mode = Local of {local_data_dir_path : string} | Remote val run_baker : + ?recommend_agnostic_baker:bool -> string option * bool * string option diff --git a/src/proto_021_PsQuebec/lib_delegate/baking_events.ml b/src/proto_021_PsQuebec/lib_delegate/baking_events.ml index 1c23c031239b512921454d2b9da520f15bbead52..ee40ee946dfdf1159cb9bf9b4cb6912a667e2de0 100644 --- a/src/proto_021_PsQuebec/lib_delegate/baking_events.ml +++ b/src/proto_021_PsQuebec/lib_delegate/baking_events.ml @@ -123,6 +123,17 @@ module Commands = struct do not run a DAL node, the option --without-dal will soon be \ mandatory." () + + let recommend_octez_baker = + declare_0 + ~section + ~name:"recommend_octez_baker" + ~level:Warning + ~msg: + "The `octez-baker` binary is now available. We recommend using it \ + instead of `octez-baker-`, as it automatically handles \ + protocol switches." + () end module State_transitions = struct diff --git a/src/proto_021_PsQuebec/lib_delegate/client_daemon.ml b/src/proto_021_PsQuebec/lib_delegate/client_daemon.ml index 0de8f744b461963ce4fa598d0fe1b2697380ebd3..7bb9f851b2ab715e7e28c4cdf9f1e4d6f1e97bcd 100644 --- a/src/proto_021_PsQuebec/lib_delegate/client_daemon.ml +++ b/src/proto_021_PsQuebec/lib_delegate/client_daemon.ml @@ -201,9 +201,18 @@ module Accuser = struct end module VDF = struct - let run (cctxt : Protocol_client_context.full) ~chain ~keep_alive = + let run ?(recommend_agnostic_baker = true) + (cctxt : Protocol_client_context.full) ~chain ~keep_alive = let open Lwt_result_syntax in let process () = + let*! () = + if recommend_agnostic_baker then + cctxt#warning + "The `octez-baker` binary is now available. We recommend using it \ + instead of `octez-baker-`, as it automatically handles \ + protocol switches." + else Lwt.return_unit + in let*! () = cctxt#message "VDF daemon %a (%s) for %a started." diff --git a/src/proto_021_PsQuebec/lib_delegate/client_daemon.mli b/src/proto_021_PsQuebec/lib_delegate/client_daemon.mli index e2c133dea69a3a642fdba9f1ae0114a6bdda31a5..078962f5500ec7768f459ffd567357da11568a60 100644 --- a/src/proto_021_PsQuebec/lib_delegate/client_daemon.mli +++ b/src/proto_021_PsQuebec/lib_delegate/client_daemon.mli @@ -61,6 +61,7 @@ end module VDF : sig val run : + ?recommend_agnostic_baker:bool -> Protocol_client_context.full -> chain:Chain_services.chain -> keep_alive:bool -> diff --git a/src/proto_022_PsRiotum/lib_agnostic_baker/baker_commands_helpers.ml b/src/proto_022_PsRiotum/lib_agnostic_baker/baker_commands_helpers.ml index 89fe030096a9aa605701c77f5ccfdad575825488..aec8fbe93a4234ddc72ecfe34e9e811ccbf61a38 100644 --- a/src/proto_022_PsRiotum/lib_agnostic_baker/baker_commands_helpers.ml +++ b/src/proto_022_PsRiotum/lib_agnostic_baker/baker_commands_helpers.ml @@ -11,8 +11,17 @@ let run_baker ~configuration ~baking_mode ~sources ~cctxt = let baking_mode = Baker_args_parser.parse_baking_mode baking_mode in let* sources = Baker_args_parser.parse_sources sources in let cctxt = new Protocol_client_context.wrap_full cctxt in - Baking_commands.run_baker args baking_mode sources cctxt + Baking_commands.run_baker + ~recommend_agnostic_baker:false + args + baking_mode + sources + cctxt let run_vdf_daemon ~cctxt ~keep_alive = let cctxt = new Protocol_client_context.wrap_full cctxt in - Client_daemon.VDF.run cctxt ~chain:cctxt#chain ~keep_alive + Client_daemon.VDF.run + ~recommend_agnostic_baker:false + cctxt + ~chain:cctxt#chain + ~keep_alive diff --git a/src/proto_022_PsRiotum/lib_delegate/baking_commands.ml b/src/proto_022_PsRiotum/lib_delegate/baking_commands.ml index 46b48fc5c7e36d0678906b9b6425b6e399ca32a8..7e3312c9c41fa0ea06f560078d55b73f5eeb1db7 100644 --- a/src/proto_022_PsRiotum/lib_delegate/baking_commands.ml +++ b/src/proto_022_PsRiotum/lib_delegate/baking_commands.ml @@ -746,7 +746,7 @@ let baker_args = pre_emptive_forge_time_arg remote_calls_timeout_arg -let run_baker +let run_baker ?(recommend_agnostic_baker = true) ( pidfile, node_version_check_bypass, node_version_allowed, @@ -766,6 +766,10 @@ let run_baker remote_calls_timeout ) baking_mode sources cctxt = let open Lwt_result_syntax in may_lock_pidfile pidfile @@ fun () -> + let*! () = + if recommend_agnostic_baker then Events.(emit recommend_octez_baker ()) + else Lwt.return_unit + in let* () = check_node_version cctxt node_version_check_bypass node_version_allowed in diff --git a/src/proto_022_PsRiotum/lib_delegate/baking_commands.mli b/src/proto_022_PsRiotum/lib_delegate/baking_commands.mli index c808d30553300e0051930ef11470845e00660c7b..a733adf942a3b5d500aca6d5a1155b6c8563715d 100644 --- a/src/proto_022_PsRiotum/lib_delegate/baking_commands.mli +++ b/src/proto_022_PsRiotum/lib_delegate/baking_commands.mli @@ -26,6 +26,7 @@ type baking_mode = Local of {local_data_dir_path : string} | Remote val run_baker : + ?recommend_agnostic_baker:bool -> string option * bool * string option diff --git a/src/proto_022_PsRiotum/lib_delegate/baking_events.ml b/src/proto_022_PsRiotum/lib_delegate/baking_events.ml index eef4f1f65efd7a7f6137233caed6726163f87ca6..c558348d179809e82e7d5be6496d4ab1521651dd 100644 --- a/src/proto_022_PsRiotum/lib_delegate/baking_events.ml +++ b/src/proto_022_PsRiotum/lib_delegate/baking_events.ml @@ -110,6 +110,17 @@ module Commands = struct Please check your DAL node and possibly restart it." ~pp1:Uri.pp ("endpoint", Tezos_rpc.Encoding.uri_encoding) + + let recommend_octez_baker = + declare_0 + ~section + ~name:"recommend_octez_baker" + ~level:Warning + ~msg: + "The `octez-baker` binary is now available. We recommend using it \ + instead of `octez-baker-`, as it automatically handles \ + protocol switches." + () end module State_transitions = struct diff --git a/src/proto_022_PsRiotum/lib_delegate/client_daemon.ml b/src/proto_022_PsRiotum/lib_delegate/client_daemon.ml index 59c1c82c6cedb131a34f2054a199ca4503e9338f..34ab93e96dcefb18300b3ca9110f763724efc9fd 100644 --- a/src/proto_022_PsRiotum/lib_delegate/client_daemon.ml +++ b/src/proto_022_PsRiotum/lib_delegate/client_daemon.ml @@ -207,9 +207,18 @@ module Accuser = struct end module VDF = struct - let run (cctxt : Protocol_client_context.full) ~chain ~keep_alive = + let run ?(recommend_agnostic_baker = true) + (cctxt : Protocol_client_context.full) ~chain ~keep_alive = let open Lwt_result_syntax in let process () = + let*! () = + if recommend_agnostic_baker then + cctxt#warning + "The `octez-baker` binary is now available. We recommend using it \ + instead of `octez-baker-`, as it automatically handles \ + protocol switches." + else Lwt.return_unit + in let*! () = cctxt#message "VDF daemon %a (%s) for %a started." diff --git a/src/proto_022_PsRiotum/lib_delegate/client_daemon.mli b/src/proto_022_PsRiotum/lib_delegate/client_daemon.mli index b0073a38c7892f4d57c8d215945334b02b87db16..0a62efc9d2e29a18fb881454a836468b3a1e07df 100644 --- a/src/proto_022_PsRiotum/lib_delegate/client_daemon.mli +++ b/src/proto_022_PsRiotum/lib_delegate/client_daemon.mli @@ -61,6 +61,7 @@ end module VDF : sig val run : + ?recommend_agnostic_baker:bool -> Protocol_client_context.full -> chain:Chain_services.chain -> keep_alive:bool -> diff --git a/src/proto_alpha/lib_agnostic_baker/baker_commands_helpers.ml b/src/proto_alpha/lib_agnostic_baker/baker_commands_helpers.ml index 9996e3999da54d04f06ef5a33b8a98c9a6de157d..746f2f43c91604f5a4e7e61b622f56eeaf58fa1a 100644 --- a/src/proto_alpha/lib_agnostic_baker/baker_commands_helpers.ml +++ b/src/proto_alpha/lib_agnostic_baker/baker_commands_helpers.ml @@ -9,8 +9,17 @@ let run_baker ~configuration ~baking_mode ~sources ~cctxt = let args = Baker_args_parser.parse_configuration configuration in let baking_mode = Baker_args_parser.parse_baking_mode baking_mode in let cctxt = new Protocol_client_context.wrap_full cctxt in - Baking_commands.run_baker args baking_mode sources cctxt + Baking_commands.run_baker + ~recommend_agnostic_baker:false + args + baking_mode + sources + cctxt let run_vdf_daemon ~cctxt ~keep_alive = let cctxt = new Protocol_client_context.wrap_full cctxt in - Client_daemon.VDF.run cctxt ~chain:cctxt#chain ~keep_alive + Client_daemon.VDF.run + ~recommend_agnostic_baker:false + cctxt + ~chain:cctxt#chain + ~keep_alive diff --git a/src/proto_alpha/lib_delegate/baking_commands.ml b/src/proto_alpha/lib_delegate/baking_commands.ml index 3bf4630c57d6df3fd51d14e05a7bc53fd2f2b70f..069be96c2039804f1059a2b57d52528e0a753052 100644 --- a/src/proto_alpha/lib_delegate/baking_commands.ml +++ b/src/proto_alpha/lib_delegate/baking_commands.ml @@ -755,7 +755,7 @@ let baker_args = pre_emptive_forge_time_arg remote_calls_timeout_arg -let run_baker +let run_baker ?(recommend_agnostic_baker = true) ( pidfile, node_version_check_bypass, node_version_allowed, @@ -775,6 +775,10 @@ let run_baker remote_calls_timeout ) baking_mode sources cctxt = let open Lwt_result_syntax in may_lock_pidfile pidfile @@ fun () -> + let*! () = + if recommend_agnostic_baker then Events.(emit recommend_octez_baker ()) + else Lwt.return_unit + in let* () = check_node_version cctxt node_version_check_bypass node_version_allowed in diff --git a/src/proto_alpha/lib_delegate/baking_commands.mli b/src/proto_alpha/lib_delegate/baking_commands.mli index c808d30553300e0051930ef11470845e00660c7b..a733adf942a3b5d500aca6d5a1155b6c8563715d 100644 --- a/src/proto_alpha/lib_delegate/baking_commands.mli +++ b/src/proto_alpha/lib_delegate/baking_commands.mli @@ -26,6 +26,7 @@ type baking_mode = Local of {local_data_dir_path : string} | Remote val run_baker : + ?recommend_agnostic_baker:bool -> string option * bool * string option diff --git a/src/proto_alpha/lib_delegate/baking_events.ml b/src/proto_alpha/lib_delegate/baking_events.ml index 1a64645fafd29ef936b61deb81f3896e9276a1ed..10199ac52a604272e85669f4182a497da5e16c37 100644 --- a/src/proto_alpha/lib_delegate/baking_events.ml +++ b/src/proto_alpha/lib_delegate/baking_events.ml @@ -117,6 +117,17 @@ module Commands = struct Please check your DAL node and possibly restart it." ~pp1:Uri.pp ("endpoint", Tezos_rpc.Encoding.uri_encoding) + + let recommend_octez_baker = + declare_0 + ~section + ~name:"recommend_octez_baker" + ~level:Warning + ~msg: + "The `octez-baker` binary is now available. We recommend using it \ + instead of `octez-baker-`, as it automatically handles \ + protocol switches." + () end module State_transitions = struct diff --git a/src/proto_alpha/lib_delegate/client_daemon.ml b/src/proto_alpha/lib_delegate/client_daemon.ml index 60c5f22db86d43d4529c3e606e06eb8776168e5d..84c6b153b9d5e4600bf73ab24866e100af266680 100644 --- a/src/proto_alpha/lib_delegate/client_daemon.ml +++ b/src/proto_alpha/lib_delegate/client_daemon.ml @@ -207,9 +207,18 @@ module Accuser = struct end module VDF = struct - let run (cctxt : Protocol_client_context.full) ~chain ~keep_alive = + let run ?(recommend_agnostic_baker = true) + (cctxt : Protocol_client_context.full) ~chain ~keep_alive = let open Lwt_result_syntax in let process () = + let*! () = + if recommend_agnostic_baker then + cctxt#warning + "The `octez-baker` binary is now available. We recommend using it \ + instead of `octez-baker-`, as it automatically handles \ + protocol switches." + else Lwt.return_unit + in let*! () = cctxt#message "VDF daemon %a (%s) for %a started." diff --git a/src/proto_alpha/lib_delegate/client_daemon.mli b/src/proto_alpha/lib_delegate/client_daemon.mli index 70116a30cd318f85bc2764596f6fc863d7226000..47a7bba1c3b6dab7b71f708d8334d82b1b4e6323 100644 --- a/src/proto_alpha/lib_delegate/client_daemon.mli +++ b/src/proto_alpha/lib_delegate/client_daemon.mli @@ -61,6 +61,7 @@ end module VDF : sig val run : + ?recommend_agnostic_baker:bool -> Protocol_client_context.full -> chain:Chain_services.chain -> keep_alive:bool ->