Tezt_tezos.Sc_rollup_nodeSourceSpawn smart-contract rollup nodes and control them.
This module follows the same conventions as in Node. We write sc node to refer to smart-contract rollup node.
Smart contract rollup node states.
Returns the associated mode, fails if the mode is not valid.
val create :
?runner:Tezt.Runner.t ->
?path:string ->
?name:string ->
?color:Tezt.Log.Color.t ->
?data_dir:string ->
base_dir:string ->
?event_pipe:string ->
?rpc_host:string ->
?rpc_port:int ->
?operators:(string * string) list ->
?default_operator:string ->
?dal_node:Dal_node.t ->
mode ->
Node.t ->
tCreate a smart contract rollup node.
A smart contract rollup node is associated to a tezos node passed as argument.
The standard output and standard error output of the sc node will be logged with prefix name and color color.
Default data_dir is a temporary directory which is always the same for each name.
dal_node is a node node from the data availability layer the rollup should be connected to.
Default event_pipe is a temporary file whose name is derived from name. It will be created as a named pipe so that sc node events can be received.
Default values for net_port or rpc_port are chosen automatically with values starting from 17384 (configurable with `--starting-port`). They are used by config_init and by functions from the Client module. They are not used by run, so if you do not call config_init or generate the configuration file through some other means, your sc node will not listen.
val create_with_endpoint :
?runner:Tezt.Runner.t ->
?path:string ->
?name:string ->
?color:Tezt.Log.Color.t ->
?data_dir:string ->
base_dir:string ->
?event_pipe:string ->
?rpc_host:string ->
?rpc_port:int ->
?operators:(string * string) list ->
?default_operator:string ->
?dal_node:Dal_node.t ->
mode ->
Client.endpoint ->
tDo not assume we are running the rollup node against a local octez node.
Wait until an sc node terminates and check its status.
If the sc node is not running, or if the process returns an exit code which is not exit_code, or if msg does not match the stderr output, fail the test.
If exit_code is not specified, any non-zero code is accepted. If no msg is given, the stderr is ignored.
val run :
?legacy:bool ->
?restart:bool ->
?mode:mode ->
?event_level:Daemon.Level.default_level ->
?event_sections_levels:(string * Daemon.Level.level) list ->
?loser_mode:string ->
?wait_ready:bool ->
t ->
string ->
string list ->
unit Lwt.trun ?event_level ?event_sections_levels ?loser_mode ?wait_ready node rollup_address arguments launches the given smart contract rollup node for the rollup at rollup_address with the given extra arguments. event_level and event_sections_levels allow to select which events we want the node to emit (see Daemon). legacy (by default false) must be set if we want to use the legacy run command of the node (which requires a config file to exist). If wait_ready is false, tezt does not wait for the node to be ready. If restart is true, it will stop and restart the node if it is already running.
val run_sequencer :
?event_level:Daemon.Level.default_level ->
?event_sections_levels:(string * Daemon.Level.level) list ->
?wait_ready:bool ->
t ->
string ->
string list ->
unit Lwt.trun_sequencer ?event_level ?event_sections_levels ?wait_ready node rollup_address arguments launches the sequencer node for the rollup at rollup_address with the given extra arguments. event_level and event_sections_levels allow to select which events we want the node to emit (see Daemon). If wait_ready is false, tezt does not wait for the node to be ready.
spawn_run node rollup_address arguments is a lightweight version of run that spawns a process.
Wait until a node terminates and return its status. If the node is not running, make the test fail.
Returns None if node is already terminated or returns the node process if it still running.
Send SIGTERM and wait for the process to terminate.
Default timeout is 30 seconds, after which SIGKILL is sent.
Initialize the rollup node configuration file with octez-sc-rollup-node-alpha config init. Returns the name of the resulting configuration file.
Initialize the rollup node configuration file with octez-sc-rollup-node-alpha config init and return the corresponding process.
Sc node configuration files.
Wait until the sc node is ready.
More precisely, wait until a node_is_ready event occurs. If such an event already occurred, return immediately.
Wait until the layer 1 of the sc node is synchronized with some given tezos level.
More precisely, wait until a new_head event with a large enough level occurs. If such an event already occurred, return immediately.
If timeout is provided, stop waiting if timeout seconds have passed.
Unbounded variant of wait_for_sync. Do not use in a Tezt tests, as it has been proven time and again that it is a source of waste of CI time when a test is buggy or flaky.
This variant of wait_for_sync should not be used in sandboxes, as it has been witnessed time and time again that these tests are more subject to race conditions when setting up rollup infrastructure. On open testnets like mondaynet and dailynet, this does not happen because of the large block time.
Wait until the layer 1 of the sc node is synchronized with its underlying l1 node.
wait_for ?where sc_node event_name filter waits for the SCORU node sc_node to emit an event named name (usually this is the name the event is declared with, concatenated with ".v0"). wait_for continues to wait until an event which satisfies the filter (i.e. for which the function returns Some _) is produced, in which case the result of the filter is returned. where, if present, should describe the constraint that filter applies.
val change_node_and_restart :
?event_level:Daemon.Level.default_level ->
t ->
string ->
Node.t ->
unit Lwt.tStops the rollup node and restart it, connected to another Tezos Layer 1 node.