Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file client_proto_args.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528(*****************************************************************************)(* *)(* Open Source License *)(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)(* Copyright (c) 2019 Nomadic Labs <contact@nomadic-labs.com> *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining a *)(* copy of this software and associated documentation files (the "Software"),*)(* to deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)(* and/or sell copies of the Software, and to permit persons to whom the *)(* Software is furnished to do so, subject to the following conditions: *)(* *)(* The above copyright notice and this permission notice shall be included *)(* in all copies or substantial portions of the Software. *)(* *)(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)(* DEALINGS IN THE SOFTWARE. *)(* *)(*****************************************************************************)openProtocol_client_contextopenProtocolopenAlpha_contexttypeerror+=Bad_tez_argofstring*string(* Arg_name * value *)typeerror+=Bad_max_priorityofstringtypeerror+=Bad_minimal_feesofstringtypeerror+=Bad_max_waiting_timeofstringtypeerror+=Bad_endorsement_delayofstringtypeerror+=Bad_preserved_levelsofstringlet()=register_error_kind`Permanent~id:"badTezArg"~title:"Bad Tez Arg"~description:"Invalid \xEA\x9C\xA9 notation in parameter."~pp:(funppf(arg_name,literal)->Format.fprintfppf"Invalid \xEA\x9C\xA9 notation in parameter %s: '%s'"arg_nameliteral)Data_encoding.(obj2(req"parameter"string)(req"literal"string))(function|Bad_tez_arg(parameter,literal)->Some(parameter,literal)|_->None)(fun(parameter,literal)->Bad_tez_arg(parameter,literal));register_error_kind`Permanent~id:"badMaxPriorityArg"~title:"Bad -max-priority arg"~description:"invalid priority in -max-priority"~pp:(funppfliteral->Format.fprintfppf"invalid priority '%s' in -max-priority"literal)Data_encoding.(obj1(req"parameter"string))(functionBad_max_priorityparameter->Someparameter|_->None)(funparameter->Bad_max_priorityparameter);register_error_kind`Permanent~id:"badMinimalFeesArg"~title:"Bad -minimal-fees arg"~description:"invalid fee threshold in -fee-threshold"~pp:(funppfliteral->Format.fprintfppf"invalid minimal fees '%s'"literal)Data_encoding.(obj1(req"parameter"string))(functionBad_minimal_feesparameter->Someparameter|_->None)(funparameter->Bad_minimal_feesparameter);register_error_kind`Permanent~id:"badMaxWaitingTimeArg"~title:"Bad -max-waiting-time arg"~description:"invalid duration in -max-waiting-time"~pp:(funppfliteral->Format.fprintfppf"Bad argument value for -max-waiting-time. Expected an integer, but \
given '%s'"literal)Data_encoding.(obj1(req"parameter"string))(functionBad_max_waiting_timeparameter->Someparameter|_->None)(funparameter->Bad_max_waiting_timeparameter);register_error_kind`Permanent~id:"badEndorsementDelayArg"~title:"Bad -endorsement-delay arg"~description:"invalid duration in -endorsement-delay"~pp:(funppfliteral->Format.fprintfppf"Bad argument value for -endorsement-delay. Expected an integer, but \
given '%s'"literal)Data_encoding.(obj1(req"parameter"string))(functionBad_endorsement_delayparameter->Someparameter|_->None)(funparameter->Bad_endorsement_delayparameter);register_error_kind`Permanent~id:"badPreservedLevelsArg"~title:"Bad -preserved-levels arg"~description:"invalid number of levels in -preserved-levels"~pp:(funppfliteral->Format.fprintfppf"Bad argument value for -preserved_levels. Expected a positive \
integer, but given '%s'"literal)Data_encoding.(obj1(req"parameter"string))(functionBad_preserved_levelsparameter->Someparameter|_->None)(funparameter->Bad_preserved_levelsparameter)lettez_sym="\xEA\x9C\xA9"letstring_parameter=Tezos_clic.parameter(fun_x->returnx)letint_parameter=Tezos_clic.parameter(fun_p->tryreturn(int_of_stringp)with_->failwith"Cannot read int")letbytes_of_prefixed_strings=matchifString.lengths<2||s.[0]<>'0'||s.[1]<>'x'thenNoneelseHex.to_bytes(`Hex(String.subs2(String.lengths-2)))with|Somes->returns|None->failwith"Invalid bytes, expecting hexadecimal notation (e.g. 0x1234abcd)"letbytes_parameter=Tezos_clic.parameter(fun_s->bytes_of_prefixed_strings)letinit_arg=Tezos_clic.default_arg~long:"init"~placeholder:"data"~doc:"initial value of the contract's storage"~default:"Unit"string_parameterletarg_arg=Tezos_clic.arg~long:"arg"~placeholder:"data"~doc:"argument passed to the contract's script, if needed"string_parameterletdefault_arg_arg=Tezos_clic.arg~long:"default-arg"~placeholder:"data"~doc:"default argument passed to each contract's script, if needed"string_parameterletdelegate_arg=Client_keys_v0.Public_key_hash.source_arg~long:"delegate"~placeholder:"address"~doc:"delegate of the contract\nMust be a known address."()letsource_arg=Tezos_clic.arg~long:"source"~placeholder:"address"~doc:"source of the deposits to be paid\nMust be a known address."string_parameterletentrypoint_arg=Tezos_clic.arg~long:"entrypoint"~placeholder:"name"~doc:"entrypoint of the smart contract"string_parameterletdefault_entrypoint_arg=Tezos_clic.arg~long:"default-entrypoint"~placeholder:"name"~doc:"default entrypoint of the smart contracts"string_parameterletforce_switch=Tezos_clic.switch~long:"force"~short:'f'~doc:"disables the node's injection checks\n\
Force the injection of branch-invalid operation or force the injection \
of block without a fitness greater than the current head."()letminimal_timestamp_switch=Tezos_clic.switch~long:"minimal-timestamp"~doc:"Use the minimal timestamp instead of the current date as timestamp of \
the baked block."()lettez_format="Text format: `DDDDDDD.DDDDDD`.\n\
Tez and mutez and separated by a period sign. Trailing and pending zeroes \
are allowed."lettez_parameterparam=Tezos_clic.parameter(fun_s->matchTez.of_stringswith|Sometez->returntez|None->fail(Bad_tez_arg(param,s)))lettez_arg~default~parameter~doc=Tezos_clic.default_arg~long:parameter~placeholder:"amount"~doc~default(tez_parameter("--"^parameter))lettez_param~name~descnext=Tezos_clic.param~name~desc:(desc^" in \xEA\x9C\xA9\n"^tez_format)(tez_parametername)nextletfee_arg=Tezos_clic.arg~long:"fee"~placeholder:"amount"~doc:"fee in \xEA\x9C\xA9 to pay to the baker"(tez_parameter"--fee")letdefault_fee_arg=Tezos_clic.arg~long:"default-fee"~placeholder:"amount"~doc:"default fee in \xEA\x9C\xA9 to pay to the baker for each transaction"(tez_parameter"--default-fee")letgas_limit_kind=Tezos_clic.parameter(fun_s->tryletv=Z.of_stringsinassert(Compare.Z.(v>=Z.zero));return(Gas.Arith.integralv)with_->failwith"invalid gas limit (must be a positive number)")letgas_limit_arg=Tezos_clic.arg~long:"gas-limit"~short:'G'~placeholder:"amount"~doc:"Set the gas limit of the transaction instead of letting the client \
decide based on a simulation"gas_limit_kindletdefault_gas_limit_arg=Tezos_clic.arg~long:"default-gas-limit"~short:'G'~placeholder:"amount"~doc:"Set the default gas limit for each transaction instead of letting the \
client decide based on a simulation"gas_limit_kindletstorage_limit_kind=Tezos_clic.parameter(fun_s->tryletv=Z.of_stringsinassert(Compare.Z.(v>=Z.zero));returnvwith_->failwith"invalid storage limit (must be a positive number of bytes)")letstorage_limit_arg=Tezos_clic.arg~long:"storage-limit"~short:'S'~placeholder:"amount"~doc:"Set the storage limit of the transaction instead of letting the client \
decide based on a simulation"storage_limit_kindletdefault_storage_limit_arg=Tezos_clic.arg~long:"default-storage-limit"~short:'S'~placeholder:"amount"~doc:"Set the default storage limit for each transaction instead of letting \
the client decide based on a simulation"storage_limit_kindletcounter_arg=Tezos_clic.arg~long:"counter"~short:'C'~placeholder:"counter"~doc:"Set the counter to be used by the transaction"(Tezos_clic.parameter(fun_s->tryletv=Z.of_stringsinassert(Compare.Z.(v>=Z.zero));returnvwith_->failwith"invalid counter (must be a positive number of bytes)"))letmax_priority_arg=Tezos_clic.arg~long:"max-priority"~placeholder:"slot"~doc:"maximum allowed baking slot"(Tezos_clic.parameter(fun_s->tryreturn(int_of_strings)with_->fail(Bad_max_prioritys)))letdefault_minimal_fees=matchTez.of_mutez100LwithNone->assertfalse|Somet->tletdefault_minimal_nanotez_per_gas_unit=Q.of_int100letdefault_minimal_nanotez_per_byte=Q.of_int1000letminimal_fees_arg=Tezos_clic.default_arg~long:"minimal-fees"~placeholder:"amount"~doc:"exclude operations with fees lower than this threshold (in tez)"~default:(Tez.to_stringdefault_minimal_fees)(Tezos_clic.parameter(fun_s->matchTez.of_stringswith|Somet->returnt|None->fail(Bad_minimal_feess)))letminimal_nanotez_per_gas_unit_arg=Tezos_clic.default_arg~long:"minimal-nanotez-per-gas-unit"~placeholder:"amount"~doc:"exclude operations with fees per gas lower than this threshold (in \
nanotez)"~default:(Q.to_stringdefault_minimal_nanotez_per_gas_unit)(Tezos_clic.parameter(fun_s->tryreturn(Q.of_strings)with_->fail(Bad_minimal_feess)))letminimal_nanotez_per_byte_arg=Tezos_clic.default_arg~long:"minimal-nanotez-per-byte"~placeholder:"amount"~default:(Q.to_stringdefault_minimal_nanotez_per_byte)~doc:"exclude operations with fees per byte lower than this threshold (in \
nanotez)"(Tezos_clic.parameter(fun_s->tryreturn(Q.of_strings)with_->fail(Bad_minimal_feess)))letforce_low_fee_arg=Tezos_clic.switch~long:"force-low-fee"~doc:"Don't check that the fee is lower than the estimated default value"()letfee_cap_arg=Tezos_clic.default_arg~long:"fee-cap"~placeholder:"amount"~default:"1.0"~doc:"Set the fee cap"(Tezos_clic.parameter(fun_s->matchTez.of_stringswith|Somet->returnt|None->failwith"Bad fee cap"))letburn_cap_arg=Tezos_clic.default_arg~long:"burn-cap"~placeholder:"amount"~default:"0"~doc:"Set the burn cap"(Tezos_clic.parameter(fun_s->matchTez.of_stringswith|Somet->returnt|None->failwith"Bad burn cap"))letno_waiting_for_endorsements_arg=Tezos_clic.switch~long:"no-waiting-for-late-endorsements"~doc:"Disable waiting for late endorsements"()letawait_endorsements_arg=Tezos_clic.switch~long:"await-late-endorsements"~doc:"Await late endorsements when baking a block"()letendorsement_delay_arg=Tezos_clic.default_arg~long:"endorsement-delay"~placeholder:"seconds"~doc:"delay before endorsing blocks\n\
Delay between notifications of new blocks from the node and production \
of endorsements for these blocks."~default:"5"(Tezos_clic.parameter(fun_s->tryleti=int_of_stringsinfail_when(i<0)(Bad_endorsement_delays)>>=?fun()->return(int_of_strings)with_->fail(Bad_endorsement_delays)))letpreserved_levels_arg=Tezos_clic.default_arg~long:"preserved-levels"~placeholder:"threshold"~doc:"Number of effective levels kept in the accuser's memory"~default:"4096"(Tezos_clic.parameter(fun_s->tryletpreserved_cycles=int_of_stringsinifpreserved_cycles<0thenfail(Bad_preserved_levelss)elsereturnpreserved_cycleswith_->fail(Bad_preserved_levelss)))letno_print_source_flag=Tezos_clic.switch~long:"no-print-source"~short:'q'~doc:"don't print the source code\n\
If an error is encountered, the client will print the contract's source \
code by default.\n\
This option disables this behaviour."()letno_confirmation=Tezos_clic.switch~long:"no-confirmation"~doc:"don't print wait for the operation to be confirmed."()letsignature_parameter=Tezos_clic.parameter(fun_cctxts->matchTezos_crypto.Signature.V0.of_b58check_optswith|Somes->returns|None->failwith"Not given a valid signature")letunparsing_mode_parameter=Tezos_clic.parameter~autocomplete:(fun_cctxt->return["Readable";"Optimized";"Optimized_legacy"])(fun_cctxts->matchswith|"Readable"->returnScript_ir_translator.Readable|"Optimized"->returnScript_ir_translator.Optimized|"Optimized_legacy"->returnScript_ir_translator.Optimized_legacy|_->failwith"Unknown unparsing mode %s"s)letunparsing_mode_arg~default=Tezos_clic.default_arg~long:"unparsing-mode"~placeholder:"mode"~doc:"Unparsing mode to use\n\
One of \"Readable\", \"Optimized\", or \"Optimized_legacy\".\n\
This option affects the way the values of the following Michelson types \
are represented:\n\
- timestamp: the Readable representation is a RFC3339 string, the \
Optimized and Optimized_legacy representations are the number of \
seconds since Epoch\n\
- key, signature, key_hash, address, contract, chain_id: the Readable \
representation is a Base58Check string, the Optimized and \
Optimized_legacy representations are byte sequences\n\
- nested pairs: in Readable mode, the Pair constructor is used even \
with arity bigger than 2 such as in Pair 0 1 2; in Optimized_legacy \
mode, the Pair constructor is always use with arity 2 such as in Pair 0 \
(Pair 1 2); in Optimized mode, a sequence is used if there are at least \
4 elements and the behavior is the same as in Optimized_legacy mode \
otherwise.\n"~defaultunparsing_mode_parameterletenforce_indentation_flag=Tezos_clic.switch~long:"enforce-indentation"~doc:"Check that the Micheline expression passed to this command is \
well-indented."()letdisplay_names_flag=Tezos_clic.switch~long:"display-names"~doc:"Print names of scripts passed to this command"()moduleDaemon=structletbaking_switch=Tezos_clic.switch~long:"baking"~short:'B'~doc:"run the baking daemon"()letendorsement_switch=Tezos_clic.switch~long:"endorsement"~short:'E'~doc:"run the endorsement daemon"()letdenunciation_switch=Tezos_clic.switch~long:"denunciation"~short:'D'~doc:"run the denunciation daemon"()end