2016-09-08 21:13:10 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
2018-02-06 00:17:03 +04:00
|
|
|
(* Copyright (c) 2014 - 2018. *)
|
2016-09-08 21:13:10 +04:00
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
|
|
|
open Client_proto_args
|
2017-11-07 20:38:11 +04:00
|
|
|
open Client_baking_lib
|
2016-09-08 21:13:10 +04:00
|
|
|
|
2016-12-03 16:05:02 +04:00
|
|
|
let group =
|
2018-06-05 16:05:53 +04:00
|
|
|
{ Clic.name = "delegate" ;
|
2016-12-03 16:05:02 +04:00
|
|
|
title = "Commands related to delegate operations." }
|
|
|
|
|
2018-06-13 13:05:20 +04:00
|
|
|
let delegate_commands () =
|
2018-04-03 13:39:09 +04:00
|
|
|
let open Clic in
|
2016-09-08 21:13:10 +04:00
|
|
|
[
|
2018-01-29 13:43:07 +04:00
|
|
|
command ~group ~desc: "Forge and inject block using the delegate rights."
|
2018-03-22 20:07:18 +04:00
|
|
|
(args3 max_priority_arg force_switch minimal_timestamp_switch)
|
2017-11-20 06:37:06 +04:00
|
|
|
(prefixes [ "bake"; "for" ]
|
2018-04-12 23:17:57 +04:00
|
|
|
@@ Client_keys.Public_key_hash.source_param
|
2017-11-06 17:12:19 +04:00
|
|
|
~name:"baker" ~desc: "name of the delegate owning the baking right"
|
2016-09-08 21:13:10 +04:00
|
|
|
@@ stop)
|
2018-03-22 20:07:18 +04:00
|
|
|
(fun (max_priority, force, minimal_timestamp) delegate cctxt ->
|
2017-11-07 20:38:11 +04:00
|
|
|
bake_block cctxt cctxt#block
|
2018-03-22 20:07:18 +04:00
|
|
|
~force ?max_priority ~minimal_timestamp delegate) ;
|
2018-01-29 13:43:07 +04:00
|
|
|
command ~group ~desc: "Forge and inject a seed-nonce revelation operation."
|
2017-11-23 19:39:33 +04:00
|
|
|
no_options
|
2016-09-08 21:13:10 +04:00
|
|
|
(prefixes [ "reveal"; "nonce"; "for" ]
|
2017-09-19 13:31:35 +04:00
|
|
|
@@ seq_of_param Block_hash.param)
|
2017-11-23 19:39:33 +04:00
|
|
|
(fun () block_hashes cctxt ->
|
|
|
|
reveal_block_nonces cctxt block_hashes) ;
|
2018-03-08 20:50:51 +04:00
|
|
|
command ~group ~desc: "Forge and inject all the possible seed-nonce revelation operations."
|
2017-11-23 19:39:33 +04:00
|
|
|
no_options
|
2016-09-08 21:13:10 +04:00
|
|
|
(prefixes [ "reveal"; "nonces" ]
|
|
|
|
@@ stop)
|
2017-11-23 19:39:33 +04:00
|
|
|
(fun () cctxt ->
|
|
|
|
reveal_nonces cctxt ()) ;
|
2018-06-13 13:05:20 +04:00
|
|
|
command ~group ~desc: "Forge and inject an endorsement operation."
|
|
|
|
no_options
|
|
|
|
(prefixes [ "endorse"; "for" ]
|
|
|
|
@@ Client_keys.Public_key_hash.source_param
|
|
|
|
~name:"baker" ~desc: "name of the delegate owning the endorsement right"
|
|
|
|
@@ stop)
|
|
|
|
(fun () delegate cctxt -> endorse_block cctxt delegate) ;
|
|
|
|
]
|
|
|
|
|
|
|
|
let baker_commands () =
|
|
|
|
let open Clic in
|
|
|
|
let group =
|
|
|
|
{ Clic.name = "delegate.baker" ;
|
|
|
|
title = "Commands related to the baker daemon." }
|
|
|
|
in
|
|
|
|
[
|
|
|
|
command ~group ~desc: "Launch a daemon that handles delegate operations."
|
|
|
|
(args1 max_priority_arg)
|
|
|
|
(prefixes [ "launch" ]
|
|
|
|
@@ seq_of_param Client_keys.Public_key_hash.alias_param)
|
|
|
|
(fun max_priority delegates cctxt ->
|
|
|
|
Client_daemon.Baker.run cctxt
|
|
|
|
?max_priority
|
|
|
|
~min_date:((Time.add (Time.now ()) (Int64.neg 1800L)))
|
|
|
|
(List.map snd delegates)
|
|
|
|
)
|
|
|
|
]
|
|
|
|
|
|
|
|
let endorser_commands () =
|
|
|
|
let open Clic in
|
|
|
|
let group =
|
|
|
|
{ Clic.name = "delegate.endorser" ;
|
|
|
|
title = "Commands related to endorser daemon." }
|
|
|
|
in
|
|
|
|
[
|
|
|
|
command ~group ~desc: "Launch the endorser daemon"
|
|
|
|
(args1 endorsement_delay_arg )
|
|
|
|
(prefixes [ "launch" ]
|
|
|
|
@@ seq_of_param Client_keys.Public_key_hash.alias_param)
|
|
|
|
(fun endorsement_delay delegates cctxt ->
|
|
|
|
Client_daemon.Endorser.run cctxt
|
|
|
|
~delay:endorsement_delay
|
|
|
|
~min_date:((Time.add (Time.now ()) (Int64.neg 1800L)))
|
|
|
|
(List.map snd delegates)
|
|
|
|
)
|
|
|
|
]
|
|
|
|
|
|
|
|
let accuser_commands () =
|
|
|
|
let open Clic in
|
|
|
|
let group =
|
|
|
|
{ Clic.name = "delegate.accuser" ;
|
|
|
|
title = "Commands related to the accuser daemon." }
|
|
|
|
in
|
|
|
|
[
|
|
|
|
command ~group ~desc: "Launch the accuser daemon"
|
|
|
|
no_options
|
|
|
|
(prefixes [ "launch" ]
|
|
|
|
@@ stop)
|
|
|
|
(fun () cctxt -> Client_daemon.Accuser.run cctxt) ;
|
2016-09-08 21:13:10 +04:00
|
|
|
]
|