package tezt-tezos

  1. Overview
  2. Docs

Run Tezos client commands.

type endpoint =
  1. | Node of Node.t
    (*

    A full-fledged node

    *)
  2. | Proxy_server of Proxy_server.t
    (*

    A proxy server

    *)
  3. | Foreign_endpoint of Foreign_endpoint.t
    (*

    A service not managed by Tezt

    *)

Values that can be passed to the client's --endpoint argument

val string_of_endpoint : ?hostname:bool -> endpoint -> string

A string representation of an endpoint suitable to be used as a CLI argument (e.g., http://localhost:5893).

type media_type =
  1. | Json
  2. | Binary
  3. | Any

Values that can be passed to the client's --media-type argument

type timestamp =
  1. | Now
  2. | Ago of Time.Span.t
  3. | At of Time.t

Values that can be passed to the client's --timestamp argument

val time_of_timestamp : timestamp -> Time.t

Convert timestamp into a concrete Time.t, relative to Time.now ().

val rpc_port : endpoint -> int

rpc_port endpoint returns the port on which to reach endpoint when doing RPC calls.

val address : ?hostname:bool -> ?from:endpoint -> endpoint -> string

address ?from endpoint returns the address at which endpoint can be contacted. If from is provided, and if from and endpoint live in the same address, then "127.0.0.1" is returned (or "localhost" if hostname is true.

val scheme : endpoint -> string

scheme endpoint returns “http” or “https” depending on the configuration of the endpoint.

type mode =
  1. | Client of endpoint option * media_type option
  2. | Mockup
  3. | Light of float * endpoint list
  4. | Proxy of endpoint

Mode of the client

val mode_to_endpoint : mode -> endpoint option

mode_to_endpoint mode returns the endpoint within a mode (if any)

type mockup_sync_mode =
  1. | Asynchronous
  2. | Synchronous

The synchronization mode of the client.

  • Asynchronous mode is when transfer doesn't bake the block.
  • Synchronous is the default mode (no flag passed to create mockup).
type normalize_mode =
  1. | Readable
  2. | Optimized
  3. | Optimized_legacy

The mode argument of the client's 'normalize data' command

type t

Tezos client states.

val name : t -> string

Get the name of a client (e.g. "client1").

val base_dir : t -> string

Get the base directory of a client.

The base directory is the location where clients store their configuration files. It corresponds to the --base-dir option.

val additional_bootstraps : t -> Account.key list

Get Account.key list of all extra bootstraps.

Additional bootstrap accounts are created when you use the additional_bootstrap_account_count or additional_revealed_bootstrap_account_count arguments of init_with_protocol. They do not include the default accounts that are always created.

val create : ?runner:Tezt.Runner.t -> ?path:string -> ?admin_path:string -> ?name:string -> ?color:Tezt.Log.Color.t -> ?base_dir:string -> ?endpoint:endpoint -> ?media_type:media_type -> unit -> t

Create a client.

The standard output and standard error output of the node will be logged with prefix name and color color.

Default base_dir is a temporary directory which is always the same for each name.

The endpoint argument is used to know which port the client should connect to. This endpoint can be overridden for each command, as a client is not actually tied to an endpoint. Most commands require an endpoint to be specified (either with create or with the command itself).

val create_with_mode : ?runner:Tezt.Runner.t -> ?path:string -> ?admin_path:string -> ?name:string -> ?color:Tezt.Log.Color.t -> ?base_dir:string -> mode -> t

Create a client like create but do not assume Client as the mode.

val get_mode : t -> mode

Get a client's mode. Used with set_mode to temporarily change a client's mode

val set_mode : mode -> t -> unit

Change the client's mode. This function is required for example because we wanna keep a client's wallet. This is impossible if we created a new client from scratch.

val write_sources_file : min_agreement:float -> uris:string list -> t -> unit Lwt.t

Write the --sources file used by the light mode.

RPC calls

type path = string list

Paths for RPCs.

For instance, ["chains"; "main"; "blocks"; "head"] denotes /chains/main/blocks/head.

val string_of_path : path -> string

string_of_path ["seg1"; "seg2"] is "/seg1/seg2"

type query_string = (string * string) list

Query strings for RPCs.

For instance, ["key1", "value1"; "key2", "value2"] denotes ?key1=value1&key2=value2.

type meth =
  1. | GET
  2. | PUT
  3. | POST
  4. | PATCH
  5. | DELETE

HTTP methods for RPCs.

type data =
  1. | Data of Tezt.JSON.u
  2. | File of string

Data type for RPCs.

val string_of_meth : meth -> string

A lowercase string of the method.

val rpc_path_query_to_string : ?query_string:query_string -> path -> string

rpc_path_query_to_string ["key1", "value1"; "key2", "value2")] ["seg1"; "seg2"] returns /seg1/seg2?key1=value1&key2=value2 where seg1, seg2, key1, key2, value1, and value2 have been appropriately encoded

val rpc : ?log_command:bool -> ?log_status_on_exit:bool -> ?log_output:bool -> ?better_errors:bool -> ?endpoint:endpoint -> ?hooks:Tezt.Process.hooks -> ?env:string Tezt.Base.String_map.t -> ?data:data -> ?query_string:query_string -> ?protocol_hash:string -> meth -> path -> t -> Tezt.JSON.t Lwt.t

Use the client to call an RPC.

Run rpc meth path?query_string with data. Fail the test if the RPC call failed.

The protocol_hash argument allows to run the RPC command for a specific protocol hash.

See the documentation of Process.spawn for information about log_*, hooks and env arguments.

In particular, env can be used to pass TEZOS_LOG, e.g. ("TEZOS_LOG", "proxy_rpc->debug") to enable logging.

The data argument allows to add data to the RPC call either with JSON value or with a filename containing a JSON value.

val spawn_rpc : ?log_command:bool -> ?log_status_on_exit:bool -> ?log_output:bool -> ?better_errors:bool -> ?endpoint:endpoint -> ?hooks:Tezt.Process.hooks -> ?env:string Tezt.Base.String_map.t -> ?data:data -> ?query_string:query_string -> ?protocol_hash:string -> meth -> path -> t -> Tezt.Process.t

Same as rpc, but do not wait for the process to exit.

module Spawn : sig ... end
val rpc_list : ?endpoint:endpoint -> t -> string Lwt.t

Run octez-client rpc list.

val spawn_rpc_list : ?endpoint:endpoint -> t -> Tezt.Process.t

Same as rpc_list, but do not wait for the process to exit.

val rpc_schema : ?log_command:bool -> ?log_status_on_exit:bool -> ?log_output:bool -> ?better_errors:bool -> ?endpoint:endpoint -> ?hooks:Tezt.Process.hooks -> ?env:string Tezt.Base.String_map.t -> ?protocol_hash:string -> meth -> path -> t -> Tezt.JSON.t Lwt.t

Run octez-client rpc schema.

val spawn_rpc_schema : ?log_command:bool -> ?log_status_on_exit:bool -> ?log_output:bool -> ?better_errors:bool -> ?endpoint:endpoint -> ?hooks:Tezt.Process.hooks -> ?env:string Tezt.Base.String_map.t -> ?protocol_hash:string -> meth -> path -> t -> Tezt.Process.t

Same as rpc_schema, but do not wait for the process to exit.

val shell_header : ?endpoint:endpoint -> ?chain:string -> ?block:string -> t -> string Lwt.t

Run octez-client rpc /chains/<chain>/blocks/<block>/header/shell.

val spawn_shell_header : ?endpoint:endpoint -> ?chain:string -> ?block:string -> t -> Tezt.Process.t

Same as shell_header, but do not wait for the process to exit.

val level : ?endpoint:endpoint -> ?chain:string -> ?block:string -> t -> int Lwt.t

Run shell_header and retrieves the level.

Admin Client Commands

module Admin : sig ... end

Run octez-admin-client commands.

Regular Client Commands

val version : t -> unit Lwt.t

Run octez-client --version.

val spawn_version : t -> Tezt.Process.t

Same as version, but do not wait for the process to exit.

val import_keys_from_mnemonic : ?endpoint:endpoint -> ?force:bool -> ?passphrase:string -> ?encryption_password:string -> t -> alias:string -> mnemonic:string list -> unit Lwt.t

Run octez-client import secret keys from mnemonic.

val spawn_import_keys_from_mnemonic : ?endpoint:endpoint -> ?force:bool -> ?encrypt:bool -> t -> alias:string -> Tezt.Process.t * Lwt_io.output_channel

Same as import_keys_from_mnemonic, but do not wait for the process to exit. This function opens and returns an output_channel and returns it along with the process.

val import_encrypted_secret_key : ?hooks:Tezt.Process_hooks.t -> ?force:bool -> ?endpoint:endpoint -> t -> Account.key -> password:string -> unit Lwt.t

Run octez-client import secret key for an encrypted key.

val spawn_import_encrypted_secret_key : ?hooks:Tezt.Process_hooks.t -> ?force:bool -> ?endpoint:endpoint -> t -> Account.key -> Tezt.Process.t * Lwt_io.output_channel

Same as import_encrypted_secret_key, but do not wait for the process to exit.

val import_secret_key : ?endpoint:endpoint -> t -> Account.key -> unit Lwt.t

Run octez-client import secret key.

val import_signer_key : ?endpoint:endpoint -> ?force:bool -> t -> Account.key -> Uri.t -> unit Lwt.t

Run octez-client import secret key for remote signer.

val spawn_import_signer_key : ?endpoint:endpoint -> ?force:bool -> t -> Account.key -> Uri.t -> Tezt.Process.t

Same as import_secret_key for signer, but do not wait for the process to exit.

val spawn_import_secret_key : ?endpoint:endpoint -> t -> Account.key -> Tezt.Process.t

Same as import_secret_key, but do not wait for the process to exit.

val activate_protocol : ?endpoint:endpoint -> ?block:string -> ?protocol:Protocol.t -> ?protocol_hash:string -> ?fitness:int -> ?key:string -> ?timestamp:timestamp -> ?parameter_file:string -> t -> unit Lwt.t

Run octez-client activate protocol.

If timestamp is not specified explicitely, it is set to Ago timestamp_delay, where timestamp_delay is 365 days, which allows to bake plenty of blocks before their timestamp reach the present (at which point one would have to wait between each block so that peers do not reject them for being in the future).

You must either provide protocol (in which case parameter_file defaults to Protocol.parameter_file protocol), or provide both protocol_hash and parameter_file.

If you want to wait until the node switches its head to the block activating the given protocol, consider using activate_protocol_and_wait below.

val activate_protocol_and_wait : ?endpoint:endpoint -> ?protocol:Protocol.t -> ?protocol_hash:string -> ?fitness:int -> ?key:string -> ?timestamp:timestamp -> ?parameter_file:string -> ?node:Node.t -> t -> unit Lwt.t

Same as activate_protocol, but wait until level increases by 1.

Waiting ensures that the activation block has been produced. This makes your test more deterministic.

Uses the node provided via argument node if any. Otherwise, it searches for a node in the client's mode, and fails if no node is found.

val spawn_activate_protocol : ?endpoint:endpoint -> ?block:string -> ?protocol:Protocol.t -> ?protocol_hash:string -> ?fitness:int -> ?key:string -> ?timestamp:timestamp -> ?parameter_file:string -> t -> Tezt.Process.t

Same as activate_protocol, but do not wait for the process to exit.

val empty_mempool_file : ?filename:string -> unit -> string

empty_mempool_file ?filename () creates a file containing the encoding of an empty mempool. This file can be given to bake_for command with the mempool parameter to ensure that the block baked will contain no operations.

val bake_for : ?endpoint:endpoint -> ?protocol:Protocol.t -> ?keys:string list -> ?minimal_fees:int -> ?minimal_nanotez_per_gas_unit:int -> ?minimal_nanotez_per_byte:int -> ?minimal_timestamp:bool -> ?mempool:string -> ?ignore_node_mempool:bool -> ?force:bool -> ?context_path:string -> ?dal_node_endpoint:string -> ?expect_failure:bool -> t -> unit Lwt.t

Run octez-client bake for.

Default key is Constant.bootstrap1.alias.

If you want to wait until the node switches its head to the baked block, consider using bake_for_and_wait below.

val bake_for_and_wait : ?endpoint:endpoint -> ?protocol:Protocol.t -> ?keys:string list -> ?minimal_fees:int -> ?minimal_nanotez_per_gas_unit:int -> ?minimal_nanotez_per_byte:int -> ?minimal_timestamp:bool -> ?mempool:string -> ?ignore_node_mempool:bool -> ?force:bool -> ?context_path:string -> ?node:Node.t -> ?dal_node_endpoint:string -> t -> unit Lwt.t

Same as bake_for, but wait until level increases by 1.

Waiting ensures that the baked block has been well processed by the node. This makes your test more deterministic.

Uses the node provided via argument node if any. Otherwise, it searches for a node in the client's mode, and fails if no node is found.

val spawn_bake_for : ?endpoint:endpoint -> ?protocol:Protocol.t -> ?keys:string list -> ?minimal_fees:int -> ?minimal_nanotez_per_gas_unit:int -> ?minimal_nanotez_per_byte:int -> ?minimal_timestamp:bool -> ?mempool:string -> ?ignore_node_mempool:bool -> ?force:bool -> ?context_path:string -> ?dal_node_endpoint:string -> t -> Tezt.Process.t

Same as bake_for, but do not wait for the process to exit.

val attest_for : ?endpoint:endpoint -> ?protocol:Protocol.t -> ?key:string list -> ?force:bool -> t -> unit Lwt.t

Run octez-client attest for. Run octez-client endorse for for protocol older than 018.

Default key is Constant.bootstrap1.alias.

val spawn_attest_for : ?endpoint:endpoint -> ?protocol:Protocol.t -> ?key:string list -> ?force:bool -> t -> Tezt.Process.t

Same as attest_for, but do not wait for the process to exit.

val preattest_for : ?endpoint:endpoint -> ?protocol:Protocol.t -> ?key:string list -> ?force:bool -> t -> unit Lwt.t

Run octez-client preattest for. Run octez-client preendorse for for protocol older than 018.

Default key is Constant.bootstrap1.alias.

val spawn_preattest_for : ?endpoint:endpoint -> ?protocol:Protocol.t -> ?key:string list -> ?force:bool -> t -> Tezt.Process.t

Same as preattest_for, but do not wait for the process to exit.

val spawn_propose_for : ?endpoint:endpoint -> ?minimal_timestamp:bool -> ?protocol:Protocol.t -> ?key:string list -> ?force:bool -> t -> Tezt.Process.t

Run octez-client propose for.

Default key is Constant.bootstrap1.alias.

val propose_for : ?endpoint:endpoint -> ?minimal_timestamp:bool -> ?protocol:Protocol.t -> ?key:string list -> ?force:bool -> t -> unit Lwt.t

propose_for

val show_address : alias:string -> t -> Account.key Lwt.t

Run octez-client show address <alias> --show-secret and parse the output into an Account.key. E.g. for ~alias:"bootstrap1" the command yields:

      Hash: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx
      Public Key: edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav
      Secret Key: unencrypted:edsk3gUfUPyBSfrS9CCgmCiQsTCHGkviBDusMxDJstFtojtc1zcpsh

which becomes:

{ alias = "bootstrap1";
  public_key_hash = "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx";
  public_key = "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav";
  secret_key =
    Unencrypted "edsk3gUfUPyBSfrS9CCgmCiQsTCHGkviBDusMxDJstFtojtc1zcpsh"; }
val spawn_show_address : alias:string -> t -> Tezt.Process.t

Same as show_address, but do not wait for the process to exit (which also implies that there is no output key to parse).

val list_known_addresses : t -> (string * string) list Lwt.t

Run octez-client list known addresses and parse the output into a association list from aliases to public key hashes.

val spawn_list_known_addresses : t -> Tezt.Process.t

Same as list_known_addresses but do not wait for the process to exit.

val gen_keys : ?alias:string -> ?sig_alg:string -> t -> string Lwt.t

Run octez-client gen keys and return the key alias.

The default value for alias is a fresh alias of the form tezt_<n>.

val gen_and_show_keys : ?alias:string -> ?sig_alg:string -> t -> Account.key Lwt.t

A helper to run octez-client gen keys followed by octez-client show address to get the generated key.

val add_address : ?force:bool -> t -> alias:string -> src:string -> unit Lwt.t

Run octez-client add address <alias> <src>.

val spawn_add_address : ?force:bool -> t -> alias:string -> src:string -> Tezt.Process.t

Same as add_address but do not wait for the process to exit.

val bls_gen_keys : ?hooks:Tezt.Process.hooks -> ?force:bool -> ?alias:string -> t -> string Lwt.t

Run octez-client bls gen keys <alias>.

val activate_account : ?wait:string -> t -> alias:string -> activation_key:string -> unit Lwt.t

Run octez-client activate accoung <alias> with <activation_key>.

val spawn_activate_account : ?wait:string -> t -> alias:string -> activation_key:string -> Tezt.Process.t

Same as activate_account but do not wait for the process to exit.

val bls_list_keys : ?hooks:Tezt.Process.hooks -> t -> (string * string) list Lwt.t

Run octez-client bls list keys.

Returns the known BLS aliases associated to their public key hash.

Fails if the format is not of the form <alias>: <public key hash>.

val bls_show_address : ?hooks:Tezt.Process.hooks -> alias:string -> t -> Account.aggregate_key Lwt.t

Run octez-client bls show address <alias> and parse the output into an Account.aggregate_key. E.g. for ~alias:"bls_account" the command yields:

      Hash: tz4EECtMxAuJ9UDLaiMZH7G1GCFYUWsj8HZn
      Public Key: BLpk1yUiLJ7RezbyViD5ZvWTfQndM3TRRYmvYWkUfH2EJqsLFnzzvpJss6pbuz3U1DDMpk8v16nV
      Secret Key: aggregate_unencrypted:BLsk1hKAHyGqY9qRbgoSVnjiSmDWpKGjFF3WNQ7BaiaMUA6RMA6Pfq

which becomes:

{
  aggregate_alias = "bls_account";
  aggregate_public_key_hash = "tz4EECtMxAuJ9UDLaiMZH7G1GCFYUWsj8HZn";
  aggregate_public_key =
    "BLpk1yUiLJ7RezbyViD5ZvWTfQndM3TRRYmvYWkUfH2EJqsLFnzzvpJss6pbuz3U1DDMpk8v16nV";
  aggregate_secret_key =
    Unencrypted "BLsk1hKAHyGqY9qRbgoSVnjiSmDWpKGjFF3WNQ7BaiaMUA6RMA6Pfq";
}
val bls_gen_and_show_keys : ?alias:string -> t -> Account.aggregate_key Lwt.t

A helper to run octez-client bls gen keys followed by octez-client bls show address to get the generated key.

val bls_import_secret_key : ?hooks:Tezt.Process.hooks -> ?force:bool -> Account.aggregate_key -> t -> unit Lwt.t

Run octez-client bls import secret key <account.aggregate_alias> <account.aggregate_secret_key>.

val transfer : ?hooks:Tezt.Process.hooks -> ?log_output:bool -> ?endpoint:endpoint -> ?wait:string -> ?burn_cap:Tez.t -> ?fee:Tez.t -> ?gas_limit:int -> ?storage_limit:int -> ?counter:int -> ?entrypoint:string -> ?arg:string -> ?simulation:bool -> ?force:bool -> ?expect_failure:bool -> amount:Tez.t -> giver:string -> receiver:string -> t -> unit Lwt.t

Run octez-client transfer amount from giver to receiver.

val spawn_transfer : ?hooks:Tezt.Process.hooks -> ?log_output:bool -> ?endpoint:endpoint -> ?wait:string -> ?burn_cap:Tez.t -> ?fee:Tez.t -> ?gas_limit:int -> ?storage_limit:int -> ?counter:int -> ?entrypoint:string -> ?arg:string -> ?simulation:bool -> ?force:bool -> amount:Tez.t -> giver:string -> receiver:string -> t -> Tezt.Process.t

Same as transfer, but do not wait for the process to exit.

val call : ?hooks:Tezt.Process.hooks -> ?log_output:bool -> ?endpoint:endpoint -> ?wait:string -> ?burn_cap:Tez.t -> ?entrypoint:string -> ?arg:string -> destination:string -> source:string -> t -> unit Lwt.t

Run octez-client call <destination> from <source>.

val spawn_call : ?hooks:Tezt.Process.hooks -> ?log_output:bool -> ?endpoint:endpoint -> ?wait:string -> ?burn_cap:Tez.t -> ?entrypoint:string -> ?arg:string -> destination:string -> source:string -> t -> Tezt.Process.t

Same as call, but do not wait for the process to exit.

val multiple_transfers : ?log_output:bool -> ?endpoint:endpoint -> ?wait:string -> ?burn_cap:Tez.t -> ?fee_cap:Tez.t -> ?gas_limit:int -> ?storage_limit:int -> ?counter:int -> ?simulation:bool -> ?force:bool -> giver:string -> json_batch:string -> t -> unit Runnable.process

Run octez-client multiple transfers from giver using json_batch.

val register_delegate : ?endpoint:endpoint -> delegate:string -> t -> string Lwt.t

Run octez-client register key <delegate> as delegate.

val get_delegate : ?endpoint:endpoint -> src:string -> t -> string option Lwt.t

Run octez-client get delegate for <src>. Returns Some address if delegate is set or None otherwise.

val set_delegate : ?endpoint:endpoint -> ?wait:string -> ?fee:Tez.t -> ?fee_cap:Tez.t -> ?force_low_fee:bool -> ?expect_failure:bool -> ?simulation:bool -> src:string -> delegate:string -> t -> unit Runnable.process

Run octez-client set delegate for <src> to <delegate>.

val call_contract : ?hooks:Tezt.Process.hooks -> ?endpoint:endpoint -> ?burn_cap:Tez.t -> src:string -> destination:string -> ?entrypoint:string -> ?arg:string -> t -> unit Lwt.t

Run octez-client call <destination> from <src>

val spawn_call_contract : ?hooks:Tezt.Process.hooks -> ?endpoint:endpoint -> ?burn_cap:Tez.t -> src:string -> destination:string -> ?entrypoint:string -> ?arg:string -> t -> Tezt.Process.t

Same as call_contract, but do not wait for the process to exit.

val reveal : ?endpoint:endpoint -> ?wait:string -> ?fee:Tez.t -> ?fee_cap:Tez.t -> ?force_low_fee:bool -> src:string -> t -> unit Runnable.process

Run octez-client reveal key for <src>.

val withdraw_delegate : ?endpoint:endpoint -> ?wait:string -> ?expect_failure:bool -> src:string -> t -> unit Lwt.t

Run octez-client withdraw delegate from <src>.

val spawn_withdraw_delegate : ?endpoint:endpoint -> ?wait:string -> src:string -> t -> Tezt.Process.t

Same as withdraw_delegate, but do not wait for the process to exit.

val get_balance_for : ?endpoint:endpoint -> account:string -> t -> Tez.t Lwt.t

Run octez-client get balance for.

val spawn_get_balance_for : ?endpoint:endpoint -> account:string -> t -> Tezt.Process.t

Same as get_balance_for, but do not wait for the process to exit.

val ticket_balance : ?hooks:Tezt.Process.hooks -> contract:string -> ticketer:string -> content_type:string -> content:string -> t -> string Lwt.t

Run octez-client get ticket balance for contract with ticketer and type and content .

val spawn_ticket_balance : ?hooks:Tezt.Process.hooks -> contract:string -> ticketer:string -> content_type:string -> content:string -> t -> Tezt.Process.t

Same as ticket_balance, but do not wait for the process to exit.

val all_ticket_balances : ?hooks:Tezt.Process.hooks -> contract:string -> t -> string Runnable.process

Run octez-client get all ticket balances for contract.

val create_mockup : ?sync_mode:mockup_sync_mode -> ?parameter_file:string -> ?bootstrap_accounts_file:string -> protocol:Protocol.t -> t -> unit Lwt.t

Run octez-client create mockup.

val spawn_create_mockup : ?sync_mode:mockup_sync_mode -> ?parameter_file:string -> ?bootstrap_accounts_file:string -> protocol:Protocol.t -> t -> Tezt.Process.t

Same as create_mockup, but do not wait for the process to exit.

val submit_proposals : ?key:string -> ?wait:string -> ?proto_hash:string -> ?proto_hashes:string list -> ?force:bool -> ?expect_failure:bool -> t -> unit Lwt.t

Run octez-client submit proposals for.

If both proto_hash and proto_hashes are specified, the list of protocols which are proposed is proto_hash :: proto_hashes.

Default key is Constant.bootstrap1.alias.

val spawn_submit_proposals : ?key:string -> ?wait:string -> ?proto_hash:string -> ?proto_hashes:string list -> ?force:bool -> t -> Tezt.Process.t

Same as submit_proposals, but do not wait for the process to exit.

type ballot =
  1. | Nay
  2. | Pass
  3. | Yay
val submit_ballot : ?key:string -> ?wait:string -> proto_hash:string -> ballot -> t -> unit Lwt.t

Run octez-client submit ballot for.

Default key is Constant.bootstrap1.alias.

val spawn_submit_ballot : ?key:string -> ?wait:string -> proto_hash:string -> ballot -> t -> Tezt.Process.t

Same as submit_ballot, but do not wait for the process to exit.

val set_deposits_limit : ?hooks:Tezt.Process.hooks -> ?endpoint:endpoint -> ?wait:string -> src:string -> limit:string -> t -> string Lwt.t

Run octez-client set deposits limit for <src> to <limit>.

val unset_deposits_limit : ?hooks:Tezt.Process.hooks -> ?endpoint:endpoint -> ?wait:string -> src:string -> t -> string Lwt.t

Run octez-client unset deposits limit for <src>.

val increase_paid_storage : ?hooks:Tezt.Process.hooks -> ?endpoint:endpoint -> ?wait:string -> contract:string -> amount:int -> payer:string -> t -> string Lwt.t

Run octez-client increase the paid storage of <contract> by <amount> bytes from <payer>.

val used_storage_space : ?hooks:Tezt.Process.hooks -> ?endpoint:endpoint -> ?wait:string -> contract:string -> t -> string Lwt.t

Run octez-client get contract used storage space for <contract>.

val paid_storage_space : ?hooks:Tezt.Process.hooks -> ?endpoint:endpoint -> ?wait:string -> contract:string -> t -> string Lwt.t

Run octez-client get contract paid storage space for <contract>.

val update_consensus_key : ?hooks:Tezt.Process.hooks -> ?endpoint:endpoint -> ?wait:string -> ?burn_cap:Tez.t -> ?expect_failure:bool -> src:string -> pk:string -> t -> unit Lwt.t

Run octez-client use <pk> as consensus key for delegate <src>

val drain_delegate : ?hooks:Tezt.Process.hooks -> ?endpoint:endpoint -> ?wait:string -> ?expect_failure:bool -> delegate:string -> consensus_key:string -> ?destination:string -> t -> unit Lwt.t

Run octez-client drain delegate with consensus key <src>

val originate_contract : ?hooks:Tezt.Process.hooks -> ?log_output:bool -> ?endpoint:endpoint -> ?wait:string -> ?init:string -> ?burn_cap:Tez.t -> ?gas_limit:int -> ?dry_run:bool -> ?force:bool -> alias:string -> amount:Tez.t -> src:string -> prg:string -> t -> string Lwt.t

Run octez-client originate contract alias transferring amount from src running prg. Returns the originated contract hash.

Avoid this function when using originate_contract_at is possible.

val spawn_originate_contract : ?hooks:Tezt.Process.hooks -> ?log_output:bool -> ?endpoint:endpoint -> ?wait:string -> ?init:string -> ?burn_cap:Tez.t -> ?gas_limit:int -> ?dry_run:bool -> ?force:bool -> alias:string -> amount:Tez.t -> src:string -> prg:string -> t -> Tezt.Process.t

Same as originate_contract, but do not wait for the process to exit.

val originate_contract_at : ?hooks:Tezt.Process.hooks -> ?log_output:bool -> ?endpoint:endpoint -> ?wait:string -> ?init:string -> ?burn_cap:Tez.t -> ?gas_limit:int -> ?dry_run:bool -> ?force:bool -> ?prefix:string -> ?alias:string -> amount:Tez.t -> src:string -> t -> string list -> Protocol.t -> (string * string) Lwt.t

Originates the contract with name n for a given protocol p.

This function passes n and p to Contract.find. See the documentation there for more info.

Returns a pair (alias, res) where alias is a value which can be used to identify the originated contract, and res is the originated contract hash. By default, alias is the last component of the scripts name n, but this can be overriden through the alias parameter.

val spawn_originate_contract_at : ?hooks:Tezt.Process.hooks -> ?log_output:bool -> ?endpoint:endpoint -> ?wait:string -> ?init:string -> ?burn_cap:Tez.t -> ?gas_limit:int -> ?dry_run:bool -> ?force:bool -> ?prefix:string -> ?alias:string -> amount:Tez.t -> src:string -> t -> string list -> Protocol.t -> string * Tezt.Process.t

Same as originate_contract_at, but do not wait for the process to exit.

val remember_contract : ?force:bool -> alias:string -> address:string -> t -> unit Lwt.t

Run octez-client remember contract <alias> <address>.

val spawn_remember_contract : ?force:bool -> alias:string -> address:string -> t -> Tezt.Process.t

Same as remember_contract, but do not wait for the process to exit.

val remember_script : alias:string -> src:string -> t -> unit Lwt.t

Run octez-client remember script <alias> <src>.

val spawn_remember_script : alias:string -> src:string -> t -> Tezt.Process.t

Same as remember_script, but do not wait for the process to exit.

type stresstest_contract_parameters = {
  1. probability : float;
    (*

    The probability of calling this smart contract

    *)
  2. invocation_fee : Tez.t;
    (*

    Fee to use for invocations during the stress test

    *)
  3. invocation_gas_limit : int;
    (*

    Gas limit to use for invocations during the stress test

    *)
}

The information that the user has to provide for every smart contract they want to call during the stress test.

val stresstest : ?endpoint:endpoint -> ?source_aliases:string list -> ?source_pkhs:string list -> ?source_accounts:Account.key list -> ?seed:int -> ?fee:Tez.t -> ?gas_limit:int -> ?transfers:int -> ?tps:int -> ?fresh_probability:float -> ?smart_contract_parameters:(string * stresstest_contract_parameters) list -> t -> unit Lwt.t

Run octez-client stresstest transfer using <sources>.

sources is a string containing all the source_aliases, source_pkhs, and source_accounts in JSON format as expected by the stresstest command. Each optional argument source_aliases, source_pkhs, and source_accounts defaults to an empty list. However, if all three are empty, then the sources given to the command are Constant.bootstrap_keys i.e. bootstrap1, ..., bootstrap5.

The parameter --seed <seed> is always provided (because without it, the stresstest command would use a fixed seed). If the corresponding optional argument is not provided to the function, then a new random seed is generated.

Optional parameters:

  • seed is the seed used for the random number generator
  • fee is the custom fee to pay instead of the default one
  • gas_limit is the custom gas limit
  • --transfers <transfers>
  • --tps <tps>
  • --fresh_probabilty <probability>, probability from 0.0 to 1.0 that new bootstrap accounts will be created during the stress test
  • --smart-contract-parameters is the map of parameters for calling smart contracts during the smart test

endpoint: cf create

val spawn_stresstest : ?endpoint:endpoint -> ?source_aliases:string list -> ?source_pkhs:string list -> ?source_accounts:Account.key list -> ?seed:int -> ?fee:Tez.t -> ?gas_limit:int -> ?transfers:int -> ?tps:int -> ?fresh_probability:float -> ?smart_contract_parameters:(string * stresstest_contract_parameters) list -> t -> Tezt.Process.t

Same as stresstest, but do not wait for the process to exit.

val stresstest_gen_keys : ?endpoint:endpoint -> ?alias_prefix:string -> int -> t -> Account.key list Lwt.t

Run tezos-client stresstest gen keys <nb_keys>.

nb_keys contains the number of new keys to be generated.

Optional parameters:

  • alias_prefix: allows to use a dedicated alias prefix for generated keys (default: bootstrap<key_index>),

endpoint: cf create

type stresstest_gas_estimation = {
  1. regular : int;
    (*

    Cost of a regular transaction.

    *)
  2. smart_contracts : (string * int) list;
    (*

    Cost of smart contract calls.

    *)
}

Costs of every kind of transaction used in the stress test.

val stresstest_estimate_gas : ?endpoint:endpoint -> t -> stresstest_gas_estimation Lwt.t

Call the stresstest estimate gas command.

val stresstest_originate_smart_contracts : ?endpoint:endpoint -> Account.key -> t -> unit Lwt.t

Originate all smart contracts for use in the stress test.

val stresstest_fund_accounts_from_source : ?endpoint:endpoint -> source_key_pkh:string -> ?batch_size:int -> ?batches_per_block:int -> ?initial_amount:Tez.t -> t -> unit Lwt.t

Run octez-client stresstest fund accounts from <source_key_pkh>.

source_key_pkh is the address from which the funds will be withdraw.

Optional parameters:

  • batch_size: maximum number of operations that can be put into a single batch,
  • batches_per_block: maximum number of batches that can be put into a single block,
  • initial_amount: number of token, in μtz, that will be funded on each of the accounts to fund.

endpoint: cf create

type run_script_result = {
  1. storage : string;
  2. big_map_diff : string list;
}

The result of a octez-client run script .. on storage .. and input .. call.

val run_script : ?hooks:Tezt.Process.hooks -> ?protocol_hash:string -> ?no_base_dir_warnings:bool -> ?balance:Tez.t -> ?self_address:string -> ?source:string -> ?payer:string -> ?gas:int -> ?trace_stack:bool -> ?level:int -> ?now:string -> prg:string -> storage:string -> input:string -> t -> run_script_result Lwt.t

Run octez-client run script .. on storage .. and input ...

Returns the new storage as a string.

Fails if the new storage cannot be extracted from the output.

Avoid this function when using run_script_at is possible.

val spawn_run_script : ?hooks:Tezt.Process.hooks -> ?protocol_hash:string -> ?no_base_dir_warnings:bool -> ?balance:Tez.t -> ?self_address:string -> ?source:string -> ?payer:string -> ?gas:int -> ?trace_stack:bool -> ?level:int -> ?now:string -> prg:string -> storage:string -> input:string -> t -> Tezt.Process.t

Same as run_script but do not wait for the process to exit.

val run_script_at : ?hooks:Tezt.Process.hooks -> ?protocol_hash:string -> ?balance:Tez.t -> ?self_address:string -> ?source:string -> ?payer:string -> ?prefix:string -> ?now:string -> ?trace_stack:bool -> ?level:int -> storage:string -> input:string -> t -> string list -> Protocol.t -> run_script_result Lwt.t

Run octez-client run script .. on storage .. and input .. on the script name n for a given protocol p.

This function passes n and p to Contract.find. See the documentation there for more info.

Returns the new storage as a string.

Fails if the new storage cannot be extracted from the output.

val spawn_run_script_at : ?hooks:Tezt.Process.hooks -> ?protocol_hash:string -> ?balance:Tez.t -> ?self_address:string -> ?source:string -> ?payer:string -> ?prefix:string -> ?now:string -> ?trace_stack:bool -> ?level:int -> storage:string -> input:string -> t -> string list -> Protocol.t -> Tezt.Process.t

Same as run_script_at but do not wait for the process to exit.

val register_global_constant : ?wait:string -> ?burn_cap:Tez.t -> src:string -> value:string -> t -> string Lwt.t

Run octez-client register global constant value from src. Returns the address hash of the new constant.

val spawn_register_global_constant : ?wait:string -> ?burn_cap:Tez.t -> value:string -> src:string -> t -> Tezt.Process.t

Same as register_global_constant but do not wait for the process to exit.

type hash_data_result = {
  1. packed : string;
  2. script_expr_hash : string;
  3. raw_script_expr_hash : string;
  4. ledger_blake2b_hash : string;
  5. raw_sha256_hash : string;
  6. raw_sha512_hash : string;
}

Represents the result of a octez-client hash data .. of type ... call.

Given the output:

    $ ./tezos-client hash data Unit of type unit
    Raw packed data: 0x05030b
    Script-expression-ID-Hash: expruaDPoTWXcTR6fiQPy4KZSW72U6Swc1rVmMiP...
    Raw Script-expression-ID-Hash: 0x8b456a4530fb6d0fea9a0dcd0e9d6ff6b3...
    Ledger Blake2b hash: ANf4YSkDc71Uy14uWg3wL8u49LUAHdVVnVHbSwNKyEJo
    Raw Sha256 hash: 0x5f6d1c5a35306dc8be3a54058774f9cb8f1bc71a6a743a25...
    Raw Sha512 hash: 0xe89c39b714a041046cf421532526b466a8ad29a89a4f0279...
    Gas remaining: 1039999.624 units remaining

we obtain a hash_data_result record with each field filled from the corresponding line above (omitting the last Gas remaining line).

val hash_data : ?hooks:Tezt.Process.hooks -> data:string -> typ:string -> t -> hash_data_result Lwt.t

Run octez-client hash data .. of type ...

val spawn_hash_data : ?hooks:Tezt.Process.hooks -> data:string -> typ:string -> t -> Tezt.Process.t

Same as hash_data, but do not wait for the process to exit.

type hash_script_format =
  1. | TSV
  2. | CSV

Arguments to the hash_script's and hash_data's ?for_script

val hash_script : ?hooks:Tezt.Process_hooks.t -> ?for_script:hash_script_format -> script:string -> t -> string Lwt.t

Run octez-client hash script ..

val spawn_hash_script : ?hooks:Tezt.Process_hooks.t -> ?for_script:hash_script_format -> script:string -> t -> Tezt.Process.t

Same as hash_script, but do not wait for the process to exit.

val get_contract_hash : ?hooks:Tezt.Process_hooks.t -> contract:string -> t -> string Lwt.t

Run octez-client get contract script hash for ..

val spawn_get_contract_hash : ?hooks:Tezt.Process_hooks.t -> contract:string -> t -> Tezt.Process.t

Same as get_contract_hash, but do not wait for the process to exit.

val hash_scripts : ?hooks:Tezt.Process_hooks.t -> ?display_names:bool -> ?for_script:hash_script_format -> string list -> t -> string list Lwt.t

Run octez-client hash script .. with a list of scripts to hash

val spawn_hash_scripts : ?hooks:Tezt.Process_hooks.t -> ?display_names:bool -> ?for_script:hash_script_format -> string list -> t -> Tezt.Process.t

Same as hash_scripts, but do not wait for the process to exit.

val normalize_data : ?hooks:Tezt.Process_hooks.t -> ?mode:normalize_mode -> ?legacy:bool -> data:string -> typ:string -> t -> string Lwt.t

Run octez-client normalize data .. of type ...

val spawn_normalize_data : ?hooks:Tezt.Process_hooks.t -> ?mode:normalize_mode -> ?legacy:bool -> data:string -> typ:string -> t -> Tezt.Process.t

Same as normalize_data, but do not wait for the process to exit.

val normalize_stack : ?hooks:Tezt.Process_hooks.t -> ?mode:normalize_mode -> ?legacy:bool -> stack:string -> t -> string Lwt.t

Run octez-client normalize stack ...

val spawn_normalize_stack : ?hooks:Tezt.Process_hooks.t -> ?mode:normalize_mode -> ?legacy:bool -> stack:string -> t -> Tezt.Process.t

Same as normalize_stack, but do not wait for the process to exit.

val normalize_script : ?hooks:Tezt.Process_hooks.t -> ?mode:normalize_mode -> script:string -> t -> string Lwt.t

Run octez-client normalize script ..

val spawn_normalize_script : ?hooks:Tezt.Process_hooks.t -> ?mode:normalize_mode -> script:string -> t -> Tezt.Process.t

Same as normalize_script, but do not wait for the process to exit.

val normalize_type : ?hooks:Tezt.Process_hooks.t -> typ:string -> t -> string Lwt.t

Run octez-client normalize type ..

val spawn_normalize_type : ?hooks:Tezt.Process_hooks.t -> typ:string -> t -> Tezt.Process.t

Same as normalize_type, but do not wait for the process to exit.

val typecheck_data : data:string -> typ:string -> ?gas:int -> ?legacy:bool -> t -> unit Lwt.t

Run octez-client typecheck data ..

val spawn_typecheck_data : data:string -> typ:string -> ?gas:int -> ?legacy:bool -> t -> Tezt.Process.t

Same as typecheck_data, but do not wait for the process to exit.

val typecheck_script : ?hooks:Tezt.Process.hooks -> ?protocol_hash:string -> scripts:string list -> ?no_base_dir_warnings:bool -> ?details:bool -> ?emacs:bool -> ?no_print_source:bool -> ?gas:int -> ?legacy:bool -> ?display_names:bool -> t -> unit Lwt.t

Run octez-client typecheck script ..

val spawn_typecheck_script : ?hooks:Tezt.Process.hooks -> ?protocol_hash:string -> scripts:string list -> ?no_base_dir_warnings:bool -> ?details:bool -> ?emacs:bool -> ?no_print_source:bool -> ?gas:int -> ?legacy:bool -> ?display_names:bool -> t -> Tezt.Process.t

Same as typecheck_script, but do not wait for the process to exit.

val spawn_run_tzip4_view : ?hooks:Tezt.Process.hooks -> ?source:string -> ?payer:string -> ?gas:int -> ?unparsing_mode:normalize_mode -> entrypoint:string -> contract:string -> ?input:string -> ?unlimited_gas:bool -> t -> Tezt.Process.t

Same as run_tzip4_view but does not wait for the process to exit.

val run_tzip4_view : ?hooks:Tezt.Process.hooks -> ?source:string -> ?payer:string -> ?gas:int -> ?unparsing_mode:normalize_mode -> entrypoint:string -> contract:string -> ?input:string -> ?unlimited_gas:bool -> t -> string Lwt.t

Run tezos-client run tzip4 view .. on contract .. with input ..

Returns the value returned by a view as a string.

Fails if the view or the contract does not exist. If input is None, it runs tezos-client run tzip4 view .. on contract ...

val spawn_run_view : ?hooks:Tezt.Process.hooks -> ?source:string -> ?payer:string -> ?gas:int -> ?unparsing_mode:normalize_mode -> view:string -> contract:string -> ?input:string -> ?unlimited_gas:bool -> t -> Tezt.Process.t

Same as run_view but does not wait for the process to exit.

val run_view : ?hooks:Tezt.Process.hooks -> ?source:string -> ?payer:string -> ?gas:int -> ?unparsing_mode:normalize_mode -> view:string -> contract:string -> ?input:string -> ?unlimited_gas:bool -> t -> string Lwt.t

Run octez-client run view .. on contract .. with input ...

Returns the value returned by a view as a string.

Fails if the view or the contract does not exist. If input is None, it runs octez-client run view .. on contract ...

val list_protocols : [< `Light | `Mockup | `Proxy ] -> t -> string list Lwt.t

Run octez-client list mode protocols.

Note: the list protocols command (without mode) is an admin command (see Admin.list_protocols).

val spawn_list_protocols : [< `Light | `Mockup | `Proxy ] -> t -> Tezt.Process.t

Same as list_protocols, but do not wait for the process to exit and do not process stdout.

val list_understood_protocols : ?config_file:string -> t -> string list Lwt.t

Run octez-client list understood protocols.

val spawn_list_understood_protocols : ?config_file:string -> t -> Tezt.Process.t

Same as list_understood_protocols, but do not wait for the process to exit and do not process stdout.

val migrate_mockup : next_protocol:Protocol.t -> t -> unit Lwt.t

Run octez-client migrate mockup to.

val spawn_migrate_mockup : next_protocol:Protocol.t -> t -> Tezt.Process.t

Same as migrate_mockup, but do not wait for the process to exit.

val sign_block : t -> string -> delegate:string -> string Lwt.t

Run octez-client sign block <hexdata> for <delegate>.

val spawn_sign_block : t -> string -> delegate:string -> Tezt.Process.t

Same as sign_block, but do not wait for the process to exit.

val sign_message : ?branch:string -> t -> string -> src:string -> string Lwt.t

Run octez-client sign message <message> for <src>.

val spawn_sign_message : ?branch:string -> t -> string -> src:string -> Tezt.Process.t

Same as sign_message, but do not wait for the process to exit.

val check_message : ?branch:string -> t -> src:string -> signature:string -> string -> unit Lwt.t

Run octez-client check that message <message> was signed by <src> to produce <signature>.

val spawn_check_message : ?branch:string -> t -> src:string -> signature:string -> string -> Tezt.Process.t

Same as check_message, but do not wait for the process to exit.

val transfer_tickets : ?wait:string -> ?burn_cap:Tez.t -> ?hooks:Tezt.Process.hooks -> ?expect_failure:bool -> qty:int64 -> src:string -> destination:string -> entrypoint:string -> contents:string -> ty:string -> ticketer:string -> t -> unit Runnable.process
val show_voting_period : ?endpoint:endpoint -> t -> string Lwt.t

Run octez-client show voting period and return the period name.

val spawn_show_voting_period : ?endpoint:endpoint -> t -> Tezt.Process.t

Same as show_voting_period, but do not wait for the process to exit.

module Sc_rollup : sig ... end

Commands for managing FA1.2-compatible smart contracts

val check_contract_implements_fa1_2 : contract:string -> t -> unit Lwt.t

Run octez-client check contract <contract> implements fa1.2.

val spawn_check_contract_implements_fa1_2 : contract:string -> t -> Tezt.Process.t

Same as check_contract_implements_fa1_2, but do not wait for the process to exit.

val from_fa1_2_contract_get_balance : contract:string -> from:string -> t -> int Lwt.t

Run octez-client from fa1.2 contract <contract> get balance for <from>.

val spawn_from_fa1_2_contract_get_balance : contract:string -> from:string -> t -> Tezt.Process.t

Same as from_fa1_2_contract_get_balance, but do not wait for the process to exit.

val from_fa1_2_contract_get_allowance : contract:string -> owner:string -> operator:string -> t -> int Lwt.t

Run octez-client from fa1.2 contract <contract> get allowance on <owner> as <operator>.

val spawn_from_fa1_2_contract_get_allowance : contract:string -> owner:string -> operator:string -> t -> Tezt.Process.t

Same as from_fa1_2_contract_get_allowance, but do not wait for the process to exit.

val from_fa1_2_contract_get_total_supply : contract:string -> t -> int Lwt.t

Run octez-client from fa1.2 contract <contract> get total supply.

val spawn_from_fa1_2_contract_get_total_supply : contract:string -> t -> Tezt.Process.t

Same as from_fa1_2_contract_get_total_supply, but do not wait for the process to exit.

val from_fa1_2_contract_get_balance_callback : ?burn_cap:Tez.t -> contract:string -> from:string -> callback:string -> t -> unit Lwt.t

Run octez-client from fa1.2 contract <contract> get balance for <from> callback on <callback>.

val spawn_from_fa1_2_contract_get_balance_callback : ?burn_cap:Tez.t -> contract:string -> from:string -> callback:string -> t -> Tezt.Process.t

Same as from_fa1_2_contract_get_balance_callback, but do not wait for the process to exit.

val from_fa1_2_contract_get_allowance_callback : ?burn_cap:Tez.t -> contract:string -> from:string -> to_:string -> callback:string -> t -> unit Lwt.t

Run octez-client from fa1.2 contract <contract> get allowance on <from> as <to> callback on <callback>.

val spawn_from_fa1_2_contract_get_allowance_callback : ?burn_cap:Tez.t -> contract:string -> from:string -> to_:string -> callback:string -> t -> Tezt.Process.t

Same as from_fa1_2_contract_get_allowance_callback, but do not wait for the process to exit.

val from_fa1_2_contract_get_total_supply_callback : ?burn_cap:Tez.t -> contract:string -> from:string -> callback:string -> t -> unit Lwt.t

Run octez-client from fa1.2 contract <contract> get total supply as <from> callback on <callback>.

val spawn_from_fa1_2_contract_get_total_supply_callback : ?burn_cap:Tez.t -> contract:string -> from:string -> callback:string -> t -> Tezt.Process.t

Same as from_fa1_2_contract_get_total_supply_callback, but do not wait for the process to exit.

val from_fa1_2_contract_transfer : ?wait:string -> ?burn_cap:Tez.t -> contract:string -> amount:int -> from:string -> to_:string -> ?as_:string -> t -> unit Lwt.t

Run octez-client from fa1.2 contract <contract> transfer <amount> from <from> to <to>.

val spawn_from_fa1_2_contract_transfer : ?wait:string -> ?burn_cap:Tez.t -> contract:string -> amount:int -> from:string -> to_:string -> ?as_:string -> t -> Tezt.Process.t

Same as from_fa1_2_contract_transfer, but do not wait for the process to exit.

val from_fa1_2_contract_approve : ?wait:string -> ?burn_cap:Tez.t -> contract:string -> as_:string -> amount:int -> from:string -> t -> unit Lwt.t

Run octez-client from fa1.2 contract <contract> as <as> approve <amount> from <from>.

val spawn_from_fa1_2_contract_approve : ?wait:string -> ?burn_cap:Tez.t -> contract:string -> as_:string -> amount:int -> from:string -> t -> Tezt.Process.t

Same as from_fa1_2_contract_approve, but do not wait for the process to exit.

val multiple_fa1_2_transfers : ?burn_cap:Tez.t -> src:string -> transfers_json:string -> ?as_:string -> t -> unit Lwt.t

Run octez-client multiple fa1.2 transfers from <src> using <transfers.json>.

val spawn_multiple_fa1_2_transfers : ?burn_cap:Tez.t -> src:string -> transfers_json:string -> ?as_:string -> t -> Tezt.Process.t

Same as multiple_fa1_2_transfers, but do not wait for the process to exit.

module Zk_rollup : sig ... end

Commands for working with Sapling transactions

val sapling_gen_key : name:string -> ?force:bool -> ?unencrypted:bool -> t -> string list Lwt.t

Run octez-client sapling gen key <name>.

Returns mnemonic of the generated key.

val spawn_sapling_gen_key : name:string -> ?force:bool -> ?unencrypted:bool -> t -> Tezt.Process.t

Same as sapling_gen_key, but do not wait for the process to exit.

val sapling_use_key : sapling_key:string -> contract:string -> ?memo_size:int -> t -> unit Lwt.t

Run octez-client sapling use key <sapling-key> for contract <contract>.

val spawn_sapling_use_key : sapling_key:string -> contract:string -> ?memo_size:int -> t -> Tezt.Process.t

Same as sapling_use_key, but do not wait for the process to exit.

val sapling_import_key : new_:string -> ?force:bool -> ?unencrypted:bool -> ?mnemonic:string list -> t -> unit Lwt.t

Run octez-client sapling import key <new>.

val spawn_sapling_import_key : new_:string -> ?force:bool -> ?unencrypted:bool -> ?mnemonic:string list -> t -> Tezt.Process.t

Same as sapling_import_key, but do not wait for the process to exit.

val sapling_derive_key : new_:string -> name:string -> child_index:int -> ?force:bool -> ?for_contract:string -> ?unencrypted:bool -> ?memo_size:int -> t -> string Lwt.t

Run octez-client sapling derive key <new> from <name> at index <child-index>.

val spawn_sapling_derive_key : new_:string -> name:string -> child_index:int -> ?force:bool -> ?for_contract:string -> ?unencrypted:bool -> ?memo_size:int -> t -> Tezt.Process.t

Same as sapling_derive_key, but do not wait for the process to exit.

val sapling_gen_address : name:string -> ?address_index:int -> t -> (string * int) Lwt.t

Run octez-client sapling gen address <name>.

Returns the generated address and its index.

val spawn_sapling_gen_address : name:string -> ?address_index:int -> t -> Tezt.Process.t

Same as sapling_gen_address, but do not wait for the process to exit.

val sapling_export_key : name:string -> file:string -> t -> unit Lwt.t

Run octez-client sapling export key <name> in <file>.

val spawn_sapling_export_key : name:string -> file:string -> t -> Tezt.Process.t

Same as sapling_export_key, but do not wait for the process to exit.

val sapling_get_balance : sapling_key:string -> contract:string -> ?verbose:bool -> t -> Tez.t Lwt.t

Run octez-client sapling get balance for <sapling-key> in contract <contract>.

val spawn_sapling_get_balance : sapling_key:string -> contract:string -> ?verbose:bool -> t -> Tezt.Process.t

Same as sapling_get_balance, but do not wait for the process to exit.

val sapling_list_keys : t -> string list Lwt.t

Run octez-client sapling list keys.

val spawn_sapling_list_keys : t -> Tezt.Process.t

Same as sapling_list_keys, but do not wait for the process to exit.

val sapling_shield : ?wait:string -> ?burn_cap:Tez.t -> qty:Tez.t -> src_tz:string -> dst_sap:string -> sapling_contract:string -> ?message:string -> t -> (Tez.t * Tez.t) Lwt.t

Run octez-client sapling shield <qty> from <src-tz> to <dst-sap> using <sapling contract>.

Returns (balance_diff, fees) where balance_diff is sapling_contract's diff in balance and fees is the amount of fees paid.

val spawn_sapling_shield : ?wait:string -> ?burn_cap:Tez.t -> qty:Tez.t -> src_tz:string -> dst_sap:string -> sapling_contract:string -> ?message:string -> t -> Tezt.Process.t

Same as sapling_shield, but do not wait for the process to exit.

val sapling_unshield : ?wait:string -> ?burn_cap:Tez.t -> qty:Tez.t -> src_sap:string -> dst_tz:string -> sapling_contract:string -> t -> (Tez.t * Tez.t) Lwt.t

Run octez-client sapling unshield <qty> from <src-sap> to <dst-tz> using <sapling_contract>.

Returns (balance_diff, fees) where balance_diff is sapling_contract's diff in balance and fees is the amount of fees payed.

val spawn_sapling_unshield : ?wait:string -> ?burn_cap:Tez.t -> qty:Tez.t -> src_sap:string -> dst_tz:string -> sapling_contract:string -> t -> Tezt.Process.t

Same as sapling_unshield, but do not wait for the process to exit.

val sapling_forge_transaction : ?wait:string -> ?burn_cap:Tez.t -> qty:Tez.t -> src_sap:string -> dst_sap:string -> sapling_contract:string -> ?file:string -> ?json:bool -> t -> unit Lwt.t

Run octez-client sapling forge transaction <qty> from <src-sap> to <dst-sap> using <sapling contract>.

val spawn_sapling_forge_transaction : ?wait:string -> ?burn_cap:Tez.t -> qty:Tez.t -> src_sap:string -> dst_sap:string -> sapling_contract:string -> ?file:string -> ?json:bool -> t -> Tezt.Process.t

Same as sapling_forge_transaction, but do not wait for the process to exit.

val sapling_submit : ?wait:string -> ?burn_cap:Tez.t -> file:string -> alias_tz:string -> sapling_contract:string -> ?json:bool -> t -> unit Lwt.t

Run octez-client sapling submit <file> from <alias-tz> using <sapling contract>.

val spawn_sapling_submit : ?wait:string -> ?burn_cap:Tez.t -> file:string -> alias_tz:string -> sapling_contract:string -> ?json:bool -> t -> Tezt.Process.t

Same as sapling_submit, but do not wait for the process to exit.

High-Level Functions

val init : ?path:string -> ?admin_path:string -> ?name:string -> ?color:Tezt.Log.Color.t -> ?base_dir:string -> ?endpoint:endpoint -> ?media_type:media_type -> unit -> t Lwt.t

Create a client with mode Client and import all secret keys listed in Constant.all_secret_keys.

val init_with_node : ?path:string -> ?admin_path:string -> ?name:string -> ?color:Tezt.Log.Color.t -> ?base_dir:string -> ?event_level:Daemon.Level.default_level -> ?event_sections_levels:(string * Daemon.Level.level) list -> ?nodes_args:Node.argument list -> ?keys:Account.key list -> [ `Client | `Light | `Proxy ] -> unit -> (Node.t * t) Lwt.t

Set up a client and node(s).

In addition to the client, returns the first created node (if `Light is passed, a second node has been created, but it is not exposed).

val init_with_protocol : ?path:string -> ?admin_path:string -> ?name:string -> ?color:Tezt.Log.Color.t -> ?base_dir:string -> ?event_level:Daemon.Level.default_level -> ?event_sections_levels:(string * Daemon.Level.level) list -> ?nodes_args:Node.argument list -> ?additional_bootstrap_account_count:int -> ?additional_revealed_bootstrap_account_count:int -> ?default_accounts_balance:int -> ?parameter_file:string -> ?timestamp:timestamp -> ?keys:Account.key list -> [ `Client | `Light | `Proxy ] -> protocol:Protocol.t -> unit -> (Node.t * t) Lwt.t

Set up a client and node(s) and activate a protocol.

  • Create a client with mode Client, Light, or Proxy
  • Import all secret keys listed in Constant.all_secret_keys
  • Create additional_bootstrap_account_count unrevealed accounts and additional_revealed_bootstrap_account_count revealed accounts. These accounts are created with default_accounts_balance.
  • Activate the given protocol with additional_account_count additional bootstrap accounts whose aliases are given by Account.bootstrap.

In addition to the client, returns the first created node (if `Light is passed, a second node has been created, but it is not exposed).

val init_mockup : ?path:string -> ?admin_path:string -> ?name:string -> ?color:Tezt.Log.Color.t -> ?base_dir:string -> ?sync_mode:mockup_sync_mode -> ?parameter_file:string -> ?constants:Protocol.constants -> protocol:Protocol.t -> unit -> t Lwt.t

Create a client with mode Mockup and run create mockup.

Contrary to init, this does not import any secret key, because octez-client create mockup already initializes the mockup with bootstrap keys.

val init_light : ?path:string -> ?admin_path:string -> ?name:string -> ?color:Tezt.Log.Color.t -> ?base_dir:string -> ?min_agreement:float -> ?event_level:Daemon.Level.default_level -> ?event_sections_levels:(string * Daemon.Level.level) list -> ?nodes_args:Node.argument list -> unit -> (t * Node.t * Node.t) Lwt.t

Create a client with mode Light. In addition to the client, created nodes are returned, as they are created by this call; and the light mode needs tight interaction with the nodes. The nodes_args argument allows to configure the created nodes, but note that arguments Node.Connections and Node.Synchronisation_threshold are ignored.

val spawn_command : ?log_command:bool -> ?log_status_on_exit:bool -> ?log_output:bool -> ?env:string Tezt.Base.String_map.t -> ?endpoint:endpoint -> ?hooks:Tezt.Process.hooks -> ?admin:bool -> ?protocol_hash:string -> ?config_file:string -> ?no_base_dir_warnings:bool -> ?block:string -> t -> string list -> Tezt.Process.t

Spawn a low-level client command.

Prefer using higher-level functions defined in this module, or adding a new one, to deferring to spawn_command.

It can be used, for example, for low-level one-shot customization of client commands.

val spawn_command_with_stdin : ?log_command:bool -> ?log_status_on_exit:bool -> ?log_output:bool -> ?env:string Tezt.Base.String_map.t -> ?endpoint:endpoint -> ?hooks:Tezt.Process.hooks -> ?admin:bool -> ?protocol_hash:string -> t -> string list -> Tezt.Process.t * Lwt_io.output_channel

Spawn a low-level client command as in spawn_command but with a channel to send data to the process stdin.

val spawn_register_key : ?hooks:Tezt.Process.hooks -> ?consensus:string -> string -> t -> Tezt.Process.t

Register public key for given account with given client.

val register_key : ?hooks:Tezt.Process.hooks -> ?expect_failure:bool -> ?consensus:string -> string -> t -> unit Lwt.t

Register public key for given account with given client.

val contract_storage : ?hooks:Tezt.Process.hooks -> ?unparsing_mode:normalize_mode -> string -> t -> string Lwt.t

Get contract storage for a contract. Returns a Micheline expression representing the storage as a string.

val contract_code : ?unparsing_mode:normalize_mode -> string -> t -> string Lwt.t

Get contract code for a contract. Returns a Micheline expression representing the code as a string.

val contract_entrypoint_type : entrypoint:string -> contract:string -> t -> string Lwt.t

Get contract entrypoint type for a contract.

val spawn_contract_entrypoint_type : entrypoint:string -> contract:string -> t -> Tezt.Process.t

Same as contract_entrypoint_type, but do not wait for the process to exit.

val sign_bytes : signer:string -> data:string -> t -> string Lwt.t

Sign a string of bytes with secret key of the given account.

val conversion_format_to_string : [< `Binary | `Json | `Michelson | `OCaml ] -> string

Show a conversion format as used for the convert* function family

val convert_script : script:string -> src_format:[ `Michelson | `Json | `Binary ] -> dst_format:[ `Michelson | `Json | `Binary | `OCaml ] -> ?typecheck:string -> t -> string Lwt.t

Use octez-client to convert a script between given forms.

val convert_data : data:string -> src_format:[ `Michelson | `Json | `Binary ] -> dst_format:[ `Michelson | `Json | `Binary | `OCaml ] -> ?typecheck:string -> t -> string Lwt.t

Use octez-client to convert a script between given forms.

val convert_script_to_json : ?endpoint:endpoint -> script:string -> t -> Tezt.JSON.u Lwt.t

Convert the given smart contract from Michelson to JSON string.

val convert_data_to_json : ?endpoint:endpoint -> data:string -> t -> Tezt.JSON.u Lwt.t

Convert the given Michelson constant to JSON string.

val bootstrapped : t -> unit Lwt.t

Run octez-client bootstrapped.

val config_show : ?config_file:string -> ?protocol:Protocol.t -> t -> string Lwt.t

Run tezos-client config show.

val spawn_config_show : ?config_file:string -> ?protocol:Protocol.t -> t -> Tezt.Process.t

Same as config_show, but do not wait for the process to exit.

val config_init : ?config_file:string -> ?protocol:Protocol.t -> ?bootstrap_accounts:string -> ?protocol_constants:string -> ?output:string -> t -> unit Lwt.t

Run tezos-client config show.

val spawn_config_init : ?config_file:string -> ?protocol:Protocol.t -> ?bootstrap_accounts:string -> ?protocol_constants:string -> ?output:string -> t -> Tezt.Process.t

Same as config_init, but do not wait for the process to exit.

val compute_chain_id_from_block_hash : ?endpoint:endpoint -> t -> string -> string Lwt.t

Run tezos-client compute chain id from block hash.

val spawn_compute_chain_id_from_block_hash : ?endpoint:endpoint -> t -> string -> Tezt.Process.t

Same as compute_chain_id_from_block_hash, but do not wait for the process to exit.

val compute_chain_id_from_seed : ?endpoint:endpoint -> t -> string -> string Lwt.t

Run tezos-client compute chain id from seed.

val spawn_compute_chain_id_from_seed : ?endpoint:endpoint -> t -> string -> Tezt.Process.t

Same as compute_chain_id_from_seed, but do not wait for the process to exit.

Commands for managing a multisig smart contract

val show_supported_multisig_hashes : t -> unit Lwt.t

Run octez-client show supported multisig hashes.

val spawn_show_supported_multisig_hashes : t -> Tezt.Process.t

Same as show_supported_multisig_hashes, but do not wait for the process to exit.

val show_multisig_script : t -> unit Lwt.t

Run octez-client show multisig script.

val spawn_show_multisig_script : t -> Tezt.Process.t

Same as show_multisig_script, but do not wait for the process to exit.

val deploy_multisig : new_multisig:string -> qty:Tez.t -> src:string -> threshold:int -> keys:string list -> ?delegate:string -> ?force:bool -> ?burn_cap:Tez.t -> t -> unit Lwt.t

Run octez-client deploy multisig <new_multisig> transferring <qty> from <src> with threshold <threshold> on public keys <key>.

val spawn_deploy_multisig : new_multisig:string -> qty:Tez.t -> src:string -> threshold:int -> keys:string list -> ?delegate:string -> ?force:bool -> ?burn_cap:Tez.t -> t -> Tezt.Process.t

Same as deploy_multisig, but do not wait for the process to exit.

val sign_multisig_transaction_transfer : multisig:string -> qty:Tez.t -> dst:string -> key:string -> ?arg:string -> ?entrypoint:string -> t -> string Lwt.t

Run octez-client sign multisig transaction on <multisig> transferring <qty> to <dst> using secret key <key>.

val spawn_sign_multisig_transaction_transfer : multisig:string -> qty:Tez.t -> dst:string -> key:string -> ?arg:string -> ?entrypoint:string -> t -> Tezt.Process.t

Same as sign_multisig_transaction_transfer, but do not wait for the process to exit.

val sign_multisig_transaction_run_lambda : multisig:string -> lambda:string -> key:string -> t -> string Lwt.t

Run octez-client sign multisig transaction on <multisig> running lambda <lambda> using secret key <key>.

val spawn_sign_multisig_transaction_run_lambda : multisig:string -> lambda:string -> key:string -> t -> Tezt.Process.t

Same as sign_multisig_transaction_run_lambda, but do not wait for the process to exit.

val sign_multisig_transaction_set_delegate : multisig:string -> dlgt:string -> key:string -> t -> string Lwt.t

Run octez-client sign multisig transaction on <multisig> setting delegate to <dlgt> using secret key <key>.

val spawn_sign_multisig_transaction_set_delegate : multisig:string -> dlgt:string -> key:string -> t -> Tezt.Process.t

Same as sign_multisig_transaction_set_delegate, but do not wait for the process to exit.

val sign_multisig_transaction_withdraw_delegate : multisig:string -> key:string -> t -> string Lwt.t

Run octez-client sign multisig transaction on <multisig> withdrawing delegate using secret key <key>.

val spawn_sign_multisig_transaction_withdraw_delegate : multisig:string -> key:string -> t -> Tezt.Process.t

Same as sign_multisig_transaction_withdraw_delegate, but do not wait for the process to exit.

val sign_multisig_transaction_set_threshold_and_public_keys : multisig:string -> signing_key:string -> threshold:int -> public_keys:string list -> t -> string Lwt.t

Run octez-client sign multisig transaction on <multisig> using secret key <key> setting threshold to <threshold> and public keys to <key>.

val spawn_sign_multisig_transaction_set_threshold_and_public_keys : multisig:string -> signing_key:string -> threshold:int -> public_keys:string list -> t -> Tezt.Process.t

Same as sign_multisig_transaction_set_threshold_and_public_keys, but do not wait for the process to exit.

val from_multisig_transfer : multisig:string -> qty:Tez.t -> dst:string -> src:string -> signatures:string list -> ?arg:string -> ?burn_cap:Tez.t -> ?entrypoint:string -> t -> unit Lwt.t

Run octez-client from multisig contract <multisig> transfer <qty> to <dst> on behalf of <src> with signatures <signature>.

val spawn_from_multisig_transfer : multisig:string -> qty:Tez.t -> dst:string -> src:string -> signatures:string list -> ?arg:string -> ?burn_cap:Tez.t -> ?entrypoint:string -> t -> Tezt.Process.t

Same as from_multisig_transfer, but do not wait for the process to exit.

val from_multisig_run_lambda : multisig:string -> lambda:string -> src:string -> signatures:string list -> ?burn_cap:Tez.t -> t -> unit Lwt.t

Run octez-client from multisig contract <multisig> run lambda <lambda> on behalf of <src> with signatures <signature>.

val spawn_from_multisig_run_lambda : multisig:string -> lambda:string -> src:string -> signatures:string list -> ?burn_cap:Tez.t -> t -> Tezt.Process.t

Same as from_multisig_run_lambda, but do not wait for the process to exit.

val set_delegate_of_multisig : multisig:string -> dlgt:string -> src:string -> signatures:string list -> ?burn_cap:Tez.t -> t -> unit Lwt.t

Run octez-client set delegate of multisig contract <multisig> to <dlgt> on behalf of <src> with signatures <signature>.

val spawn_set_delegate_of_multisig : multisig:string -> dlgt:string -> src:string -> signatures:string list -> ?burn_cap:Tez.t -> t -> Tezt.Process.t

Same as set_delegate_of_multisig, but do not wait for the process to exit.

val withdraw_delegate_of_multisig : multisig:string -> src:string -> signatures:string list -> ?burn_cap:Tez.t -> t -> unit Lwt.t

Run octez-client withdraw delegate of multisig contract <multisig> on behalf of <src> with signatures <signature>.

val spawn_withdraw_delegate_of_multisig : multisig:string -> src:string -> signatures:string list -> ?burn_cap:Tez.t -> t -> Tezt.Process.t

Same as withdraw_delegate_of_multisig, but do not wait for the process to exit.

val set_threshold_of_multisig : multisig:string -> threshold:int -> public_keys:string list -> src:string -> signatures:string list -> ?burn_cap:Tez.t -> t -> unit Lwt.t

Run octez-client set threshold of multisig contract <multisig> to <threshold> and public keys to <public_keys> on behalf of <src> with signatures <signature>.

val spawn_set_threshold_of_multisig : multisig:string -> threshold:int -> public_keys:string list -> src:string -> signatures:string list -> ?burn_cap:Tez.t -> t -> Tezt.Process.t

Same as set_threshold_of_multisig, but do not wait for the process to exit.

val run_transaction_on_multisig : bytes:string -> multisig:string -> src:string -> signatures:string list -> ?burn_cap:Tez.t -> t -> unit Lwt.t

Run octez-client run transaction <bytes> on multisig contract <multisig> on behalf of <src> with signatures <signature>.

val spawn_run_transaction_on_multisig : bytes:string -> multisig:string -> src:string -> signatures:string list -> ?burn_cap:Tez.t -> t -> Tezt.Process.t

Same as run_transaction_on_multisig, but do not wait for the process to exit.

val prepare_multisig_transaction : multisig:string -> qty:Tez.t -> dst:string -> ?arg:string -> ?entrypoint:string -> ?bytes_only:bool -> t -> string Lwt.t

Run octez-client prepare multisig transaction on <multisig> transferring <qty> to <dst>.

val spawn_prepare_multisig_transaction : multisig:string -> qty:Tez.t -> dst:string -> ?arg:string -> ?entrypoint:string -> ?bytes_only:bool -> t -> Tezt.Process.t

Same as prepare_multisig_transaction, but do not wait for the process to exit.

val prepare_multisig_transaction_run_lambda : multisig:string -> lambda:string -> ?bytes_only:bool -> t -> string Lwt.t

Run octez-client prepare multisig transaction on <multisig> running lambda <lambda>.

val spawn_prepare_multisig_transaction_run_lambda : multisig:string -> lambda:string -> ?bytes_only:bool -> t -> Tezt.Process.t

Same as prepare_multisig_transaction_run_lambda, but do not wait for the process to exit.

val prepare_multisig_transaction_set_delegate : multisig:string -> dlgt:string -> ?bytes_only:bool -> t -> string Lwt.t

Run octez-client prepare multisig transaction on <multisig> setting delegate to <dlgt>.

val spawn_prepare_multisig_transaction_set_delegate : multisig:string -> dlgt:string -> ?bytes_only:bool -> t -> Tezt.Process.t

Same as prepare_multisig_transaction_set_delegate, but do not wait for the process to exit.

val prepare_multisig_transaction_withdraw_delegate : multisig:string -> ?bytes_only:bool -> t -> string Lwt.t

Run octez-client prepare multisig transaction on <multisig> withdrawing delegate.

val spawn_prepare_multisig_transaction_withdraw_delegate : multisig:string -> ?bytes_only:bool -> t -> Tezt.Process.t

Same as prepare_multisig_transaction_withdraw_delegate, but do not wait for the process to exit.

val prepare_multisig_transaction_set_threshold_and_public_keys : multisig:string -> threshold:int -> public_keys:string list -> ?bytes_only:bool -> t -> string Lwt.t

Run octez-client prepare multisig transaction on <multisig> setting threshold to <threshold> and public keys to <public_keys>.

val spawn_prepare_multisig_transaction_set_threshold_and_public_keys : multisig:string -> threshold:int -> public_keys:string list -> ?bytes_only:bool -> t -> Tezt.Process.t

Same as prepare_multisig_transaction_set_threshold_and_public_keys, but do not wait for the process to exit.

val expand_macros : ?endpoint:endpoint -> ?hooks:Tezt.Process_hooks.t -> ?protocol_hash:string -> ?no_base_dir_warnings:bool -> t -> string -> string Lwt.t

Run tezos-client expand macros in <script>.

val spawn_expand_macros : ?endpoint:endpoint -> ?hooks:Tezt.Process_hooks.t -> ?protocol_hash:string -> ?no_base_dir_warnings:bool -> t -> string -> Tezt.Process.t

Same as expand_macros, but do not wait for the process to exit.

val get_timestamp : ?endpoint:endpoint -> ?block:string -> ?seconds:bool -> t -> string Lwt.t

Run tezos-client get timestamp.

val spawn_get_timestamp : ?endpoint:endpoint -> ?block:string -> ?seconds:bool -> t -> Tezt.Process.t

Same as get_timestamp, but do not wait for the process to exit.

OCaml

Innovation. Community. Security.