package tezt-tezos

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Tezt_tezos.Evm_nodeSource

Sourcetype t

EVM node server state.

Sourcetype mode =
  1. | Sequencer of {
    1. kernel : string;
      (*

      Path to the kernel used by the sequencer.

      *)
    2. preimage_dir : string;
      (*

      Path to the directory with the associated preimages.

      *)
    }
  2. | Proxy

EVM node mode.

Sourceval create : ?runner:Tezt_wrapper.Runner.t -> ?mode:mode -> ?data_dir:string -> ?devmode:bool -> ?rpc_addr:string -> ?rpc_port:int -> string -> t

create ?runner ?mode ?data_dir ?devmode ?rpc_addr ?rpc_port rollup_node_endpoint creates an EVM node server.

The server listens to requests at address rpc_addr and the port rpc_port. rpc_addr defaults to "127.0.0.1" and a fresh port is chosen if rpc_port is not set.

To use the node on development set devmode to true. Otherwise to set it to the one on production set devmode to false (or omit the parameter).

The server communicates with a rollup-node and sets its endpoint via rollup_node_endpoint.

mode defaults to Proxy.

Sourceval run : t -> unit Lwt.t

run evm_node launches the EVM node server with the arguments given during create.

Sourceval init : ?runner:Tezt_wrapper.Runner.t -> ?mode:mode -> ?data_dir:string -> ?devmode:bool -> ?rpc_addr:string -> ?rpc_port:int -> string -> t Lwt.t

init ?runner ?mode ?data_dir ?devmode ?rpc_addr ?rpc_port rollup_node_endpoint creates an EVM node server with create and runs it with run.

Sourceval spawn_run : t -> Tezt_wrapper.Process.t

spawn_run evm_node same as run but spawns a process.

Sourceval 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.

Sourceval endpoint : t -> string

endpoint evm_node returns the endpoint to communicate with the evm_node.

Sourcetype request = {
  1. method_ : string;
  2. parameters : Tezt_wrapper.JSON.u;
}

JSON-RPC request.

Sourceval call_evm_rpc : t -> request -> Tezt_wrapper.JSON.t Lwt.t

call_evm_rpc evm_node ~request sends a JSON-RPC request to the evm_node, for the given request.

Sourceval batch_evm_rpc : t -> request list -> Tezt_wrapper.JSON.t Lwt.t

batch_evm_rpc evm_node ~requests sends multiple JSON-RPC requests to the evm_node, for the given requests.

Sourceval extract_result : Tezt_wrapper.JSON.t -> Tezt_wrapper.JSON.t

extract_result json expects a JSON-RPC `result` and returns the value.

Sourceval extract_error_message : Tezt_wrapper.JSON.t -> Tezt_wrapper.JSON.t

extract_error_message json expects a JSON-RPC `error.message` and returns the value.

Sourceval fetch_contract_code : t -> string -> string Lwt.t

fetch_contract_code evm_node contract returns the code associated to the given contract in the rollup.

Sourcetype txpool_slot = {
  1. address : string;
  2. transactions : (int64 * Tezt_wrapper.JSON.t) list;
}

A slot in the transaction pool associates an address to a mapping of nonces to transactions.

Sourceval txpool_content : t -> (txpool_slot list * txpool_slot list) Lwt.t

txpool_content evm_node returns the transaction hash and nonce contained in the `pending` and `queued` pools.

OCaml

Innovation. Community. Security.