package tezt-tezos

  1. Overview
  2. Docs

Spawn Data-availability-layer (DAL) nodes and control them

type t

DAL Node state

type history_mode =
  1. | Full
  2. | Auto
  3. | Custom of int

Period for the shards to be kept in the storage Full : never delete Auto : period depending on the node profile Custom (i) : keeps the shards during i blocks

Creates a DAL node

val create : ?runner:Tezt_wrapper.Runner.t -> ?path:string -> ?name:string -> ?color:Tezt_wrapper.Log.Color.t -> ?data_dir:string -> ?event_pipe:string -> ?rpc_host:string -> ?rpc_port:int -> ?listen_addr:string -> ?public_addr:string -> ?metrics_addr:string -> node:Node.t -> unit -> t
val create_from_endpoint : ?runner:Tezt_wrapper.Runner.t -> ?path:string -> ?name:string -> ?color:Tezt_wrapper.Log.Color.t -> ?data_dir:string -> ?event_pipe:string -> ?rpc_host:string -> ?rpc_port:int -> ?listen_addr:string -> ?public_addr:string -> ?metrics_addr:string -> l1_node_endpoint:Client.endpoint -> unit -> t
val name : t -> string

Get the name of an dal node.

val rpc_host : t -> string

Get the RPC host given as --rpc-addr to an dal node.

val rpc_port : t -> int

Get the RPC port given as --rpc-addr to an dal node.

val rpc_endpoint : t -> string

Return the endpoint of the DAL node's RPC server, i.e., http://rpc_host:rpc_port.

val listen_addr : t -> string

Get the node's point pair "address:port" given as --net-addr to a dal node.

val metrics_addr : t -> string

Get the node's metrics server point pair "address:port" given as --metrics-addr to a dal node.

val data_dir : t -> string

Get the data-dir of an dal node.

val run : ?wait_ready:bool -> ?env:string Tezt_wrapper.Base.String_map.t -> ?event_level:Daemon.Level.default_level -> t -> unit Lwt.t

run ?wait_ready ?env ?event_level node launches the given dal node where env is a map of environment variable.

If wait_ready is true, the promise waits for the dal node to be ready. true by default.

event_level allows to determine the printed levels. By default, it is set to `Debug by default.

val terminate : ?timeout:float -> t -> unit Lwt.t

Send SIGTERM and wait for the process to terminate.

Default timeout is 30 seconds, after which SIGKILL is sent.

val kill : t -> unit Lwt.t

Send SIGKILL and wait for the process to terminate.

val stop : t -> unit Lwt.t

Send SIGSTOP to a daemon. Do not wait for the process to terminate.

val log_events : ?max_length:int -> t -> unit

Shows in stdout every events sent by the node

val wait_for : ?where:string -> t -> string -> (Tezt_wrapper.JSON.t -> 'a option) -> 'a Lwt.t

See Daemon.Make.wait_for.

val is_running_not_ready : t -> bool

is_running_not_ready dal_node returns true if the given node is running but its status is not ready

Wait until a node terminates and return its status. If the node is not running, make the test fail.

val init_config : ?expected_pow:float -> ?peers:string list -> ?attester_profiles:string list -> ?producer_profiles:int list -> ?observer_profiles:int list -> ?bootstrap_profile:bool -> ?history_mode:history_mode -> t -> unit Lwt.t

Run octez-dal-node config init.

expected_pow allows to change the PoW difficulty. Default value is 0.

module Config_file : sig ... end

DAL node configuration files.

val read_identity : t -> string

Read the peer id from the node's identity file.

val as_rpc_endpoint : t -> Endpoint.t

Expose the RPC server address of this node as a foreign endpoint.

val wait_for_connections : t -> int -> unit Lwt.t

Wait for a node to receive a given number of connections.

wait_for_connections node n waits until node receives n "new_connection.v0" events.

val wait_for_disconnection : t -> peer_id:string -> unit Lwt.t

Wait for a node to receive a disconnection for some peer_id.

wait_for_disconnection node peer_id waits until node receives a "disconnected.v0" event from the given peer id.

OCaml

Innovation. Community. Security.