Module Evm_node_lib_dev.Services_backend_sig

module type S = sig ... end
module type Backend = sig ... end
type endpoint =
  1. | Rpc of Uri.t
  2. | Websocket of Websocket_client.t

Inject transactions with either RPCs or on a websocket connection.

module type Tx_container = sig ... end

Tx_container is the signature of the module that deals with storing and forwarding transactions. the module type is used by Services.dispatch_request to request informations about pending transactions.

'f tx_container is a GADT parametrized by the same type argument as L2_types.chain_family. It is useful to statically guarantee that the launched tx-container uses types compatible with the chain's chain family.

val tx_container_module : 'f tx_container -> (module Tx_container)

Some functions of the Tx_container module, such as add, have interfaces which actually depend on the chain family but many others, such as clear don't.

In the former case, we usually know statically the type of the chain family and hence of the tx-container and we can for example invoke add as follows:

let Evm_tx_container (module Tx_container) = tx_container in
let** hash = Tx_container.add ~next_nonce ~raw_tx tx_obj in

In the latter case, statically knowing the type of the chain family is not required and the following tx_container_module function can be used to get a Tx_container module:

let (module Tx_container) = Services_backend_sig.tx_container_module tx_container in
let* () = Tx_container.clear () in
type ex_tx_container =
  1. | Ex_tx_container : _ tx_container -> ex_tx_container