package tezt-tezos

  1. Overview
  2. Docs
type t

A proxy server instance

type argument =
  1. | Data_dir
    (*

    Whether to pass --data-dir, to read the node's data-dir from disk, instead of using a RPC. This case doesn't need a parameter, because it is computed automatically from the Node.t value in init. Think of this argument as a Boolean flag (not an argument) whether to pass --data-dir to octez-proxy-server.

    *)
  2. | Symbolic_block_caching_time of int
    (*

    Time interval (in seconds) during which data for a symbolic block identifier (like HEAD) is kept. A symbolic identifier is a block identifier that it not a hash and which hence cannot be safely used as a key in any form of cache.

    *)

Command-line arguments of octez-proxy-server.

Not all arguments are available here, because it was not needed so far.

val rpc_port : t -> int

Get the RPC port of a proxy server. It's the port to do request to.

val runner : t -> Tezt.Runner.t option

Get the runner associated to a proxy server.

Return None if the proxy server runs on the local machine.

val spawn : ?rpc_port:int -> ?args:string list -> Node.t -> Tezt.Process.t

spawn ?rpc_port node spawns a new proxy server that serves the given port and delegates its queries to node.

This function is meant to be used by callers that need finer control than what init allows.

val init : ?runner:Tezt.Runner.t -> ?name:string -> ?rpc_port:int -> ?event_level:Daemon.Level.default_level -> ?event_sections_levels:(string * Daemon.Level.level) list -> ?args:argument list -> Node.t -> t Lwt.t

init ?runner ?name ?rpc_port ?event_level ?args node creates and starts a proxy server that serves the given port and delegates its queries to node.

event_level specifies the verbosity of the file descriptor sink.

event_sections_levels specifies the verbosity for events in sections whose prefix is in the list. See Node.run for description.

type event = {
  1. name : string;
  2. value : Tezt.JSON.t;
  3. timestamp : float;
}

Raw events.

val on_event : t -> (event -> unit) -> unit

Add a callback to be called whenever the proxy_server emits an event.

This callback is never removed.

You can have multiple on_event handlers, although the order in which they trigger is unspecified.

OCaml

Innovation. Community. Security.