From efb89fb6ff8e9d7210c6eb1deaf31ec9aa1ce81e Mon Sep 17 00:00:00 2001 From: Thomas Letan Date: Thu, 20 Mar 2025 11:51:37 +0100 Subject: [PATCH 1/4] EVM Node: Clean-up of the man page --- etherlink/CHANGES_NODE.md | 5 + etherlink/bin_node/main.ml | 27 +- etherlink/tezt/lib/evm_node.ml | 2 +- .../evm_sequencer.ml/EVM Node- man.out | 280 +++++++++++++++--- src/lib_clic/tezos_clic.ml | 6 +- 5 files changed, 265 insertions(+), 55 deletions(-) diff --git a/etherlink/CHANGES_NODE.md b/etherlink/CHANGES_NODE.md index fc5fdeb3f325..45d2fdb1f890 100644 --- a/etherlink/CHANGES_NODE.md +++ b/etherlink/CHANGES_NODE.md @@ -41,6 +41,11 @@ - Augment L1/L2 relationships with a new table to keep more accurate information. (!16848) +### Documentation changes + +- Improves and cleans up the `man` command of the node. (!17289 !17311 !17282 + !17295 !17331 !17317 !17309) + ### Experimental features changes *No guarantees are provided regarding backward compatibility of experimental diff --git a/etherlink/bin_node/main.ml b/etherlink/bin_node/main.ml index 1dc6440bd38f..db2c7591795f 100644 --- a/etherlink/bin_node/main.ml +++ b/etherlink/bin_node/main.ml @@ -201,18 +201,10 @@ let wallet_dir_arg = ~long:"wallet-dir" ~short:'d' ~placeholder:"path" + ~env:Client_config.base_dir_env_name ~default:Client_config.default_base_dir - ~doc: - (Format.asprintf - "@[@[<2>client data directory (absent: %s env)@,\ - The directory where the Tezos client stores all its wallet data.@,\ - If absent, its value is the value of the %s@,\ - environment variable. If %s is itself not specified,@,\ - defaults to %s@]@]@." - Client_config.base_dir_env_name - Client_config.base_dir_env_name - Client_config.base_dir_env_name - Client_config.default_base_dir) + ~pp_default:(fun fmt -> Format.pp_print_string fmt "$HOME/.tezos-client") + ~doc:"The directory where the Tezos client stores all its wallet data" Params.string let rpc_addr_arg = @@ -1622,13 +1614,12 @@ let init_config_command = let open Lwt_result_syntax in command ~desc: - {|Create an initial config with default value. -If the is set then adds the configuration for the proxy -mode. -If the is set,then adds the configuration for the sequencer and -threshold encryption sequencer modes. -If the is set then adds the configuration for the observer -mode.|} + "Create an initial config with default value.\n\ + If the is set then adds the configuration for \ + the proxy mode. If the is set,then adds the \ + configuration for the sequencer and threshold encryption sequencer \ + modes. If the is set then adds the configuration \ + for the observer mode." (merge_options common_config_args (args20 diff --git a/etherlink/tezt/lib/evm_node.ml b/etherlink/tezt/lib/evm_node.ml index bc05c2f66f4a..8170a7ce869e 100644 --- a/etherlink/tezt/lib/evm_node.ml +++ b/etherlink/tezt/lib/evm_node.ml @@ -1568,7 +1568,7 @@ let debug_print_store_schemas ?(path = Uses.path Constant.octez_evm_node) ?hooks Process.check process let man ?(path = Uses.path Constant.octez_evm_node) ?hooks () = - let args = ["man"; "-v"; "2"] in + let args = ["man"; "-v"; "3"] in let process = Process.spawn ?hooks path @@ args in Process.check process diff --git a/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- man.out b/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- man.out index c07de94a7a72..014a3bfc8bf0 100644 --- a/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- man.out +++ b/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- man.out @@ -1,5 +1,5 @@ -./octez-evm-node man -v 2 +./octez-evm-node man -v 3 Usage: octez-evm-node command [command options] octez-evm-node --help (for global options) @@ -12,19 +12,33 @@ To browse the documentation: Access the documentation: - man [...] + man [...] [-v --verbosity <0|1|2|3>] + [--format ] Print documentation of commands. + Add search keywords to narrow list. + Will display only the commands by default, unless [-verbosity <2|3>] is + passed or the list of matching commands if less than 3. : keyword to search for + If several are given they must all appear in the command. -v --verbosity <0|1|2|3>: level of details + 0. Only shows command mnemonics, without documentation. + 1. Shows command mnemonics with short descriptions. + 2. Show commands and arguments with short descriptions + 3. Show everything --format : the manual's output format + Defaults to `plain`. Snapshots commands: - snapshot export + snapshot export [--data-dir ] [--config-file ] + [-s --snapshot-file ] [--compress-on-the-fly] [--uncompressed] Export a snapshot of the EVM node. --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. --config-file : Path to a configuration file. Defaults to `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. -s --snapshot-file : Path to the snapshot file to create, with string interpolation. %r is replaced by the short form of the Smart Rollup address, %R by the complete Smart Rollup address, %l by the @@ -38,22 +52,43 @@ Snapshots commands: around the size of the data dir. --uncompressed: Produce an uncompressed snapshot. - snapshot import + snapshot import [--data-dir ] [-f --force] Import a snapshot of the EVM node. : Snapshot archive file or URL --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. -f --force: Allow importing snapshot in already populated data dir (previous contents is removed first, even if the snapshot is corrupted), or importing a legacy snapshot in an empty data dir. Miscellaneous commands: - run sandbox + run sandbox [--data-dir ] [--config-file ] + [--rpc-addr ] [--rpc-port ] [--rpc-batch-limit ] + [--cors-origins ] [--cors-headers ] + [--max-number-blocks <100>] [--max-number-logs <1000>] + [--chunk-size <10>] [-K --keep-alive] [--rollup-node-endpoint ] + [--tx-pool-timeout-limit <3_600>] [--tx-pool-addr-limit <4_000>] + [--tx-pool-tx-per-addr-limit <16>] [-v --verbose] + [--restricted-rpcs ] [--blacklisted-rpcs ] + [--whitelisted-rpcs ] [--finalized-view] + [--preimages-dir <_evm_installer_preimages>] + [--preimages-endpoint ] [-n --native-execution-policy ] + [--time-between-blocks <10.>] [--max-number-of-chunks <10.>] + [--private-rpc-port ] + [--genesis-timestamp <[TIMESTAMP]>] + [--kernel ] [-d --wallet-dir ] + [-f --password-filename ] [--network ] + [--init-from-snapshot [snapshot url]] [--fund <0x...>] Start the EVM node in sandbox mode. The sandbox mode is a sequencer-like mode that produces blocks with a fake key and no rollup node connection. --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. --config-file : Path to a configuration file. Defaults to `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. --rpc-addr : The EVM node server rpc address. --rpc-port : The EVM node server rpc port. --rpc-batch-limit : A limit on the number of requests allowed in a @@ -103,11 +138,14 @@ Miscellaneous commands: genesis block, uses machine's clock if not provided --kernel : Path to the EVM kernel used to launch the PVM, it will be loaded from storage afterward - -d --wallet-dir : client data directory (absent: TEZOS_CLIENT_DIR - env) + -d --wallet-dir : The directory where the Tezos client stores all + its wallet data + Defaults to the value of the environment variable `$TEZOS_CLIENT_DIR` + if it exists, or `$HOME/.tezos-client` otherwise. -f --password-filename : path to the password filename --network : The network the EVM node will be connecting to. Can be `mainnet` or `testnet`. + If set, defaults to the value of EVM_NODE_NETWORK. --init-from-snapshot [snapshot url]: Automatically download and import a recent snapshot for supported networks on fresh data directories. If no snapshot provider is given e.g. `--init-from-snapshot` with no @@ -117,14 +155,28 @@ Miscellaneous commands: address, %n by the network (given by the argument --network), %h by the history mode used by the node, and %% by %. Also accepts a path to an existing snapshot. + Defaults to + `https://snapshotter-sandbox.nomadic-labs.eu/local/etherlink-%n/%h/etherlink-%n-%h-latest.gz`. --fund <0x...>: The address of an account to provide with funds in the sandbox (can be repeated to fund multiple accounts) - run proxy + run proxy [--data-dir ] [--config-file ] + [--rpc-addr ] [--rpc-port ] [--rpc-batch-limit ] + [--cors-origins ] [--cors-headers ] + [--max-number-blocks <100>] [--max-number-logs <1000>] + [--chunk-size <10>] [-K --keep-alive] [--rollup-node-endpoint ] + [--tx-pool-timeout-limit <3_600>] [--tx-pool-addr-limit <4_000>] + [--tx-pool-tx-per-addr-limit <16>] [-v --verbose] + [--restricted-rpcs ] [--blacklisted-rpcs ] + [--whitelisted-rpcs ] [--finalized-view] [--read-only] + [--ignore-block-param] [--evm-node-endpoint ] Start the EVM node in proxy mode. --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. --config-file : Path to a configuration file. Defaults to `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. --rpc-addr : The EVM node server rpc address. --rpc-port : The EVM node server rpc port. --rpc-batch-limit : A limit on the number of requests allowed in a @@ -163,11 +215,32 @@ Miscellaneous commands: block for unsupported blocks. --evm-node-endpoint : The address of an EVM node to connect to. - run sequencer + run sequencer [--data-dir ] [--config-file ] + [--rpc-addr ] [--rpc-port ] [--rpc-batch-limit ] + [--cors-origins ] [--cors-headers ] + [--max-number-blocks <100>] [--max-number-logs <1000>] + [--chunk-size <10>] [-K --keep-alive] [--rollup-node-endpoint ] + [--tx-pool-timeout-limit <3_600>] [--tx-pool-addr-limit <4_000>] + [--tx-pool-tx-per-addr-limit <16>] [-v --verbose] + [--restricted-rpcs ] [--blacklisted-rpcs ] + [--whitelisted-rpcs ] [--finalized-view] + [--preimages-dir <_evm_installer_preimages>] + [--preimages-endpoint ] [--time-between-blocks <10.>] + [--max-number-of-chunks <10.>] [--private-rpc-port ] + [--sequencer-key ] [--maximum-blueprints-lag ] + [--maximum-blueprints-ahead ] + [--maximum-blueprints-catch-up ] + [--catch-up-cooldown ] + [--genesis-timestamp <[TIMESTAMP]>] + [--initial-kernel ] [-d --wallet-dir ] + [-f --password-filename ] [--dal-slots ] Start the EVM node in sequencer mode --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. --config-file : Path to a configuration file. Defaults to `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. --rpc-addr : The EVM node server rpc address. --rpc-port : The EVM node server rpc port. --rpc-batch-limit : A limit on the number of requests allowed in a @@ -224,17 +297,36 @@ Miscellaneous commands: genesis block, uses machine's clock if not provided --initial-kernel : Path to the EVM kernel used to launch the PVM, it will be loaded from storage afterward - -d --wallet-dir : client data directory (absent: TEZOS_CLIENT_DIR - env) + -d --wallet-dir : The directory where the Tezos client stores all + its wallet data + Defaults to the value of the environment variable `$TEZOS_CLIENT_DIR` + if it exists, or `$HOME/.tezos-client` otherwise. -f --password-filename : path to the password filename --dal-slots : The DAL slots indices on which the sequencer is allowed to send blueprints. - run observer + run observer [--data-dir ] [--config-file ] + [--rpc-addr ] [--rpc-port ] [--rpc-batch-limit ] + [--cors-origins ] [--cors-headers ] + [--max-number-blocks <100>] [--max-number-logs <1000>] + [--chunk-size <10>] [-K --keep-alive] [--rollup-node-endpoint ] + [--tx-pool-timeout-limit <3_600>] [--tx-pool-addr-limit <4_000>] + [--tx-pool-tx-per-addr-limit <16>] [-v --verbose] + [--restricted-rpcs ] [--blacklisted-rpcs ] + [--whitelisted-rpcs ] [--finalized-view] + [--evm-node-endpoint ] [--bundler-node-endpoint ] + [--preimages-dir <_evm_installer_preimages>] + [--preimages-endpoint ] [-n --native-execution-policy ] + [--initial-kernel ] [--dont-track-rollup-node] + [--no-sync] [--init-from-snapshot [snapshot url]] + [--history ] [--network ] Start the EVM node in observer mode --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. --config-file : Path to a configuration file. Defaults to `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. --rpc-addr : The EVM node server rpc address. --rpc-port : The EVM node server rpc port. --rpc-batch-limit : A limit on the number of requests allowed in a @@ -293,17 +385,34 @@ Miscellaneous commands: address, %n by the network (given by the argument --network), %h by the history mode used by the node, and %% by %. Also accepts a path to an existing snapshot. + Defaults to + `https://snapshotter-sandbox.nomadic-labs.eu/local/etherlink-%n/%h/etherlink-%n-%h-latest.gz`. --history : History mode for the EVM node. ':n' means n days of history. --network : The network the EVM node will be connecting to. Can be `mainnet` or `testnet`. If set, additional sanity checks are performed on the node’s startup. + If set, defaults to the value of EVM_NODE_NETWORK. - experimental run rpc + experimental run rpc [--data-dir ] [--config-file ] + [--rpc-addr ] [--rpc-port ] [--rpc-batch-limit ] + [--cors-origins ] [--cors-headers ] + [--max-number-blocks <100>] [--max-number-logs <1000>] + [--chunk-size <10>] [-K --keep-alive] [--rollup-node-endpoint ] + [--tx-pool-timeout-limit <3_600>] [--tx-pool-addr-limit <4_000>] + [--tx-pool-tx-per-addr-limit <16>] [-v --verbose] + [--restricted-rpcs ] [--blacklisted-rpcs ] + [--whitelisted-rpcs ] [--finalized-view] + [--evm-node-endpoint ] [--evm-node-private-endpoint ] + [--preimages-dir <_evm_installer_preimages>] + [--preimages-endpoint ] [-n --native-execution-policy ] Start the EVM node in rpc mode --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. --config-file : Path to a configuration file. Defaults to `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. --rpc-addr : The EVM node server rpc address. --rpc-port : The EVM node server rpc port. --rpc-batch-limit : A limit on the number of requests allowed in a @@ -352,15 +461,22 @@ Miscellaneous commands: Display information about an EVM node snapshot file. : Snapshot archive file - switch history to + switch history to [--data-dir ] [--config-file ] Switch history mode of the node : History mode, either archive, rolling:n or full:n where n is the number of days of history to retain. --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. --config-file : Path to a configuration file. Defaults to `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. - chunk data [...] + chunk data [...] [--rollup-address ] [--as-blueprint] + [--timestamp <[TIMESTAMP]>] [--number <0>] + [--parent-hash ] + [--sequencer-key ] [-d --wallet-dir ] + [-f --password-filename ] Chunk hexadecimal data according to the message representation of the EVM rollup : Data to prepare and chunk with the EVM rollup format. If @@ -368,14 +484,21 @@ Miscellaneous commands: filename and can contain a list of data separated by a whitespace. --rollup-address : The smart rollup address in Base58 encoding used to produce the chunked messages + Defaults to `[SMART_ROLLUP_HASH]`. --as-blueprint: Chunk the data into a blueprint usable in sequencer mode --timestamp <[TIMESTAMP]>: + Defaults to `0`. --number <0>: Level of the blueprint + Defaults to `0`. --parent-hash : Blueprint's parent hash + Defaults to + `ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`. --sequencer-key : key to sign the blueprints. - -d --wallet-dir : client data directory (absent: TEZOS_CLIENT_DIR - env) + -d --wallet-dir : The directory where the Tezos client stores all + its wallet data + Defaults to the value of the environment variable `$TEZOS_CLIENT_DIR` + if it exists, or `$HOME/.tezos-client` otherwise. -f --password-filename : path to the password filename make upgrade payload with root hash at activation timestamp @@ -387,46 +510,60 @@ Miscellaneous commands: make sequencer upgrade payload with pool address at activation timestamp for - + [-d --wallet-dir ] Create bytes payload for the sequencer upgrade entrypoint : pool address of the sequencer : After activation timestamp, the kernel will upgrade to this value : key to sign the blueprints. - -d --wallet-dir : client data directory (absent: TEZOS_CLIENT_DIR - env) + -d --wallet-dir : The directory where the Tezos client stores all + its wallet data + Defaults to the value of the environment variable `$TEZOS_CLIENT_DIR` + if it exists, or `$HOME/.tezos-client` otherwise. - init from rollup node + init from rollup node [--data-dir ] + [--config-file ] [--omit-delayed-tx-events] initialises the EVM node data-dir using the data-dir of a rollup node. : The path to the rollup node data directory. --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. --config-file : Path to a configuration file. Defaults to `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. --omit-delayed-tx-events: Don't populate the delayed transactions in the store of the EVM node. This is necessary when creating the data dir for an observer EVM node because delayed transactions are going to be fetched from the sequencer. - transform dump to rlp + transform dump to rlp [-k --keep-everything] Transforms the JSON list of instructions to a RLP list : Description : Description -k --keep-everything: Do not filter out files outside of the `/evm` directory - reset at + reset at [--data-dir ] [-f --force] Reset evm node data-dir to a specific block level. : level to reset to state to. --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. -f --force: force suppression of data to reset state of sequencer to a specified l2 level. - replay blueprint + replay blueprint [--data-dir ] [--config-file ] + [--preimages-dir <_evm_installer_preimages>] + [--preimages-endpoint ] [-n --native-execution-policy ] + [--kernel ] [--kernel-verbosity ] [--profile] Replay a specific block level. : level to replay --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. --config-file : Path to a configuration file. Defaults to `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. --preimages-dir <_evm_installer_preimages>: Path to the preimages directory --preimages-endpoint : The address of a service which provides @@ -441,26 +578,57 @@ Miscellaneous commands: `fatal`, `error`, `info`, `debug` --profile: Profile the execution of the WASM PVM - patch kernel with + patch kernel with [--data-dir ] + [--config-file ] [--block-number ] [-f --force] Patch the kernel used by the EVM node from its current HEAD. This is an unsafe command, which can lead to the EVM node diverging from the Etherlink main branch if the new kernel is not compatible with the one deployed on the network. : Path to the kernel --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. --config-file : Path to a configuration file. Defaults to `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. --block-number : If provided, the state resulting in the application of the requested block will be used instead of the latest state. In that case, the patch will only impact replays of the successor block only. -f --force: Force patching the kernel - init config + init config [--data-dir ] [--config-file ] + [--rpc-addr ] [--rpc-port ] [--rpc-batch-limit ] + [--cors-origins ] [--cors-headers ] + [--max-number-blocks <100>] [--max-number-logs <1000>] + [--chunk-size <10>] [-K --keep-alive] [--rollup-node-endpoint ] + [--tx-pool-timeout-limit <3_600>] [--tx-pool-addr-limit <4_000>] + [--tx-pool-tx-per-addr-limit <16>] [-v --verbose] + [--restricted-rpcs ] [--blacklisted-rpcs ] + [--whitelisted-rpcs ] [--finalized-view] + [--preimages-dir <_evm_installer_preimages>] + [--preimages-endpoint ] [-n --native-execution-policy ] + [--time-between-blocks <10.>] [--max-number-of-chunks <10.>] + [--private-rpc-port ] [--sequencer-key ] + [--maximum-blueprints-lag ] [--maximum-blueprints-ahead ] + [--maximum-blueprints-catch-up ] + [--catch-up-cooldown ] [--evm-node-endpoint ] + [--bundler-node-endpoint ] [--sequencer-sidecar-endpoint ] + [--history ] [--dont-track-rollup-node] + [-d --wallet-dir ] [-f --force] [--dal-slots ] + [--network ] Create an initial config with default value. + If the is set then adds the configuration for the + proxy mode. If the is set,then adds the configuration + for the sequencer and threshold encryption sequencer modes. If the + is set then adds the configuration for the observer + mode. --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. --config-file : Path to a configuration file. Defaults to `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. --rpc-addr : The EVM node server rpc address. --rpc-port : The EVM node server rpc port. --rpc-batch-limit : A limit on the number of requests allowed in a @@ -526,31 +694,56 @@ Miscellaneous commands: --dont-track-rollup-node: Disable tracking the head of the rollup node. Tracking the state of a rollup node allows to confirm the blocks received from the upstream EVM node. - -d --wallet-dir : client data directory (absent: TEZOS_CLIENT_DIR - env) + -d --wallet-dir : The directory where the Tezos client stores all + its wallet data + Defaults to the value of the environment variable `$TEZOS_CLIENT_DIR` + if it exists, or `$HOME/.tezos-client` otherwise. -f --force: Overwrites the configuration file when it exists. --dal-slots : The DAL slots indices on which the sequencer is allowed to send blueprints. --network : The network the EVM node will be connecting to. Can be `mainnet` or `testnet`. If set, some configuration options defaults to well-known values for the selected network. + If set, defaults to the value of EVM_NODE_NETWORK. - check config + check config [--data-dir ] [--config-file ] [-p --print] + [--network ] Read and validate configuration files. By default, look for config.json in the data-dir. If --filename is used, check this config file instead. --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. --config-file : Path to a configuration file. Defaults to `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. -p --print: Print the full configuration to the standard output --network : The network the EVM node will be connecting to. Can be `mainnet` or `testnet`. If set, check as if `--network N` is set when running the node (as it turns some required configuration fields into optional ones). + If set, defaults to the value of EVM_NODE_NETWORK. describe config Prints the JSON schema of the configuration file to the standard output. - make kernel installer config + make kernel installer config [--mainnet-compat] + [--kernel-root-hash ] [--chain-id ] + [--sequencer ] [--delayed-bridge ] + [--ticketer ] [--admin ] + [--sequencer-governance ] [--kernel-governance ] + [--kernel-security-governance ] + [--minimum-base-fee-per-gas <111...>] [--da-fee-per-byte <111...>] + [--delayed-inbox-timeout <111...>] + [--delayed-inbox-min-levels <111...>] + [--sequencer-pool-address <0x...>] [--maximum-allowed-ticks <11000...>] + [--maximum-gas-per-transaction <30000...>] + [--max-blueprint-lookahead-in-seconds <500>] [--remove-whitelist] + [--bootstrap-balance <9999000000000000000000>] + [--bootstrap-account <0x...>] [--set-code <0x...,0x....>] + [--enable-fa-bridge] [--enable-dal] [--dal-slots <0,1,4,6,...>] + [--enable-multichain] [--l2-chain-id <1>] + [--max-delayed-inbox-blueprint-length <1000>] + [--enable-fast-withdrawal] Transforms the JSON list of instructions to a RLP list : file path where the config will be written to --mainnet-compat: Generate a configuration compatible with the first @@ -588,6 +781,7 @@ Miscellaneous commands: --remove-whitelist: enable flag remove_whitelist in the installer config --bootstrap-balance <9999000000000000000000>: balance of the bootstrap accounts + Defaults to `9999000000000000000000`. --bootstrap-account <0x...>: add a bootstrap account in the installer config. --set-code <0x...,0x....>: add code to an account in the installer @@ -605,7 +799,13 @@ Miscellaneous commands: installer config make l2 kernel installer config - + [--minimum-base-fee-per-gas <111...>] [--da-fee-per-byte <111...>] + [--sequencer-pool-address <0x...>] + [--maximum-gas-per-transaction <30000...>] + [--bootstrap-balance <9999000000000000000000>] + [--bootstrap-account <0x...>] [--set-code <0x...,0x....>] + [--world-state-path >] [--l2-chain-id <1>] + [--l2-chain-family ] Produce a file containing the part of the kernel configuration instructions related to a particular L2 chain. : file path where the config will be written to @@ -619,6 +819,7 @@ Miscellaneous commands: maximum_gas_per_transaction in the installer config --bootstrap-balance <9999000000000000000000>: balance of the bootstrap accounts + Defaults to `9999000000000000000000`. --bootstrap-account <0x...>: add a bootstrap account in the installer config. --set-code <0x...,0x....>: add code to an account in the installer @@ -628,26 +829,36 @@ Miscellaneous commands: --l2-chain-id <1>: L2 chain id --l2-chain-family : Configure the family (either EVM or Michelson) of the L2 chain. + Defaults to `EVM`. - patch state at with + patch state at with [--data-dir ] + [--config-file ] [--block-number ] [-f --force] Patches the state with an arbitrary value. This is an unsafe command, it should be used for debugging only. Patched state is persisted and you need to use the command `reset` to revert the changes. : Durable storage path : Patched value --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. --config-file : Path to a configuration file. Defaults to `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. --block-number : If provided, the state resulting in the application of the requested block will be used instead of the latest state. -f --force: Force patching the state - download kernel with root hash + download kernel with root hash [--data-dir ] + [--config-file ] [--preimages-dir <_evm_installer_preimages>] + [--preimages-endpoint ] [--retry <1>] Transforms the JSON list of instructions to a RLP list : root hash of the kernel to download --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. --config-file : Path to a configuration file. Defaults to `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. --preimages-dir <_evm_installer_preimages>: Path to the preimages directory --preimages-endpoint : The address of a service which provides @@ -663,8 +874,9 @@ Miscellaneous commands: list metrics List the metrics exported by the EVM node. - list events + list events [-l --level ] [-j --json] List the events emitted by the EVM node. -l --level : Set list_events filter level to either `fatal`, `error`, `warning`, `notice` `info`, `debug` + Defaults to `none`. -j --json: Enables the display of json schemas diff --git a/src/lib_clic/tezos_clic.ml b/src/lib_clic/tezos_clic.ml index 4261dab17981..8b31be77b027 100644 --- a/src/lib_clic/tezos_clic.ml +++ b/src/lib_clic/tezos_clic.ml @@ -239,10 +239,12 @@ let rec print_options_detailed : in let doc = match env with - | None -> Format.sprintf "%s\nDefaults to `%s`." doc default + | None -> Format.asprintf "%s\nDefaults to `%a`." doc pp_default default | Some env -> Format.asprintf - "%s\nIf set, defaults to the value of %s, or `%a` otherwise." + "%s\n\ + Defaults to the value of the environment variable `$%s` if it \ + exists, or `%a` otherwise." doc env pp_default -- GitLab From 0e85dfa029cc6a7d6a4330ada84a9cd0f9fe5699 Mon Sep 17 00:00:00 2001 From: Alain Mebsout Date: Thu, 20 Mar 2025 20:33:30 +0100 Subject: [PATCH 2/4] Tezos_clic: show commands in the same order as provided --- src/lib_clic/tezos_clic.ml | 185 ++++++++++++++++++------------------- 1 file changed, 90 insertions(+), 95 deletions(-) diff --git a/src/lib_clic/tezos_clic.ml b/src/lib_clic/tezos_clic.ml index 8b31be77b027..837ff8be92f8 100644 --- a/src/lib_clic/tezos_clic.ml +++ b/src/lib_clic/tezos_clic.ml @@ -479,10 +479,11 @@ let group_commands commands = in List.map (fun (g, c) -> (g, List.rev !c)) - (match ungrouped with - | [] -> grouped + (match List.rev ungrouped with + | [] -> List.rev grouped | l -> - grouped @ [({name = "misc"; title = "Miscellaneous commands"}, ref l)]) + List.rev grouped + @ [({name = "misc"; title = "Miscellaneous commands"}, ref l)]) let print_group print_command ppf ({title; _}, commands) = Format.fprintf @@ -1928,98 +1929,92 @@ let manual_group = {name = "man"; title = "Access the documentation"} let add_manual ~executable_name ~global_options format ppf commands = let rec with_manual = lazy - (commands - @ [ - command - ~group:manual_group - ~desc: - "Print documentation of commands.\n\ - Add search keywords to narrow list.\n\ - Will display only the commands by default, unless [-verbosity \ - <2|3>] is passed or the list of matching commands if less than \ - 3." - (args2 - (arg - ~doc: - "level of details\n\ - 0. Only shows command mnemonics, without documentation.\n\ - 1. Shows command mnemonics with short descriptions.\n\ - 2. Show commands and arguments with short descriptions\n\ - 3. Show everything" - ~long:"verbosity" - ~short:'v' - ~placeholder:"0|1|2|3" - (parameter - ~autocomplete:(fun _ -> Lwt.return_ok ["0"; "1"; "2"; "3"]) - (fun _ arg -> - let open Lwt_result_syntax in - match arg with - | "0" -> return Terse - | "1" -> return Short - | "2" -> return Details - | "3" -> return Full - | _ -> failwith "Level of details out of range"))) - (default_arg - ~doc:"the manual's output format" - ~placeholder:"plain|colors|html" - ~long:"format" - ~default: - (match format with - | Ansi -> "colors" - | Plain -> "plain" - | Html -> "html") - (parameter - ~autocomplete:(fun _ -> - Lwt.return_ok ["colors"; "plain"; "html"]) - (fun _ arg -> - let open Lwt_result_syntax in - match arg with - | "colors" -> return Ansi - | "plain" -> return Plain - | "html" -> return Html - | _ -> failwith "Unknown manual format")))) - (prefix - "man" - (seq_of_param - (string - ~name:"keyword" - ~desc: - "keyword to search for\n\ - If several are given they must all appear in the \ - command."))) - (fun (verbosity, format) keywords _ -> - let commands = - List.fold_left - (fun commands keyword -> - List.filter (search_command keyword) commands) - (Lazy.force with_manual) - keywords - in - let verbosity = - match verbosity with - | Some verbosity -> verbosity - | None when Compare.List_length_with.(commands <= 1) -> Full - | None when Compare.List_length_with.(commands <= 3) -> Details - | None -> Short - in - let open Lwt_result_syntax in - match commands with - | [] -> tzfail (No_manual_entry keywords) - | _ -> - let state = - internal_setup_formatter ppf format verbosity None - in - let commands = List.map (fun c -> Ex c) commands in - usage_internal - ppf - ~prefix_executable:(format = Html) - ~executable_name - ~global_options - ~highlights:keywords - commands ; - restore_formatter ppf state ; - return_unit); - ]) + (command + ~group:manual_group + ~desc: + "Print documentation of commands.\n\ + Add search keywords to narrow list.\n\ + Will display only the commands by default, unless [-verbosity \ + <2|3>] is passed or the list of matching commands if less than 3." + (args2 + (arg + ~doc: + "level of details\n\ + 0. Only shows command mnemonics, without documentation.\n\ + 1. Shows command mnemonics with short descriptions.\n\ + 2. Show commands and arguments with short descriptions\n\ + 3. Show everything" + ~long:"verbosity" + ~short:'v' + ~placeholder:"0|1|2|3" + (parameter + ~autocomplete:(fun _ -> Lwt.return_ok ["0"; "1"; "2"; "3"]) + (fun _ arg -> + let open Lwt_result_syntax in + match arg with + | "0" -> return Terse + | "1" -> return Short + | "2" -> return Details + | "3" -> return Full + | _ -> failwith "Level of details out of range"))) + (default_arg + ~doc:"the manual's output format" + ~placeholder:"plain|colors|html" + ~long:"format" + ~default: + (match format with + | Ansi -> "colors" + | Plain -> "plain" + | Html -> "html") + (parameter + ~autocomplete:(fun _ -> + Lwt.return_ok ["colors"; "plain"; "html"]) + (fun _ arg -> + let open Lwt_result_syntax in + match arg with + | "colors" -> return Ansi + | "plain" -> return Plain + | "html" -> return Html + | _ -> failwith "Unknown manual format")))) + (prefix + "man" + (seq_of_param + (string + ~name:"keyword" + ~desc: + "keyword to search for\n\ + If several are given they must all appear in the command."))) + (fun (verbosity, format) keywords _ -> + let commands = + List.fold_left + (fun commands keyword -> + List.filter (search_command keyword) commands) + (Lazy.force with_manual) + keywords + in + let verbosity = + match verbosity with + | Some verbosity -> verbosity + | None when Compare.List_length_with.(commands <= 1) -> Full + | None when Compare.List_length_with.(commands <= 3) -> Details + | None -> Short + in + let open Lwt_result_syntax in + match commands with + | [] -> tzfail (No_manual_entry keywords) + | _ -> + let state = internal_setup_formatter ppf format verbosity None in + let commands = List.map (fun c -> Ex c) commands in + usage_internal + ppf + ~prefix_executable:(format = Html) + ~executable_name + ~global_options + ~highlights:keywords + commands ; + restore_formatter ppf state ; + return_unit) + :: commands) in Lazy.force with_manual -- GitLab From d4b90d629f6a2d5bef2a5fc5f9ea22a29452f244 Mon Sep 17 00:00:00 2001 From: Alain Mebsout Date: Thu, 20 Mar 2025 17:28:30 +0100 Subject: [PATCH 3/4] EVM node: group commands in man page --- etherlink/bin_node/main.ml | 56 +++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/etherlink/bin_node/main.ml b/etherlink/bin_node/main.ml index db2c7591795f..f255b225bbaa 100644 --- a/etherlink/bin_node/main.ml +++ b/etherlink/bin_node/main.ml @@ -831,6 +831,20 @@ let snapshot_file_arg = information." Params.string +module Groups = struct + let run = Tezos_clic.{name = "run"; title = "Run commands"} + + let config = Tezos_clic.{name = "config"; title = "Configuration commands"} + + let snapshot = Tezos_clic.{name = "snapshot"; title = "Snapshots commands"} + + let storage = Tezos_clic.{name = "storage"; title = "Storage commands"} + + let kernel = Tezos_clic.{name = "kernel"; title = "Kernel commands"} + + let debug = Tezos_clic.{name = "debug"; title = "Debug commands"} +end + let websocket_checks config = match config.experimental_features with | {enable_websocket = true; rpc_server = Dream; _} -> @@ -1055,6 +1069,7 @@ let rpc_command = let open Lwt_result_syntax in let open Tezos_clic in command + ~group:Groups.run ~desc:"Start the EVM node in rpc mode" (merge_options common_config_args rpc_run_args) (prefixes ["experimental"; "run"; "rpc"] stop) @@ -1282,6 +1297,7 @@ let chunker_command = let open Tezos_clic in let open Lwt_result_syntax in command + ~group:Groups.kernel ~desc: "Chunk hexadecimal data according to the message representation of the \ EVM rollup" @@ -1348,6 +1364,7 @@ let make_upgrade_command = let open Tezos_clic in let open Lwt_result_syntax in command + ~group:Groups.kernel ~desc:"Create bytes payload for the upgrade entrypoint" no_options (prefixes ["make"; "upgrade"; "payload"; "with"; "root"; "hash"] @@ -1374,6 +1391,7 @@ let make_sequencer_upgrade_command = let open Tezos_clic in let open Lwt_result_syntax in command + ~group:Groups.kernel ~desc:"Create bytes payload for the sequencer upgrade entrypoint" (args1 wallet_dir_arg) (prefixes ["make"; "sequencer"; "upgrade"; "payload"] @@ -1418,6 +1436,7 @@ let init_from_rollup_node_command = Params.string in command + ~group:Groups.run ~desc: "initialises the EVM node data-dir using the data-dir of a rollup node." (args3 data_dir_arg config_path_arg omit_delayed_tx_events_arg) @@ -1439,6 +1458,7 @@ let dump_to_rlp_command = let open Tezos_clic in let open Lwt_result_syntax in command + ~group:Groups.debug ~desc:"Transforms the JSON list of instructions to a RLP list" (args1 keep_everything_arg) (prefixes ["transform"; "dump"] @@ -1484,6 +1504,7 @@ let dump_to_rlp_command = let reset_command = let open Tezos_clic in command + ~group:Groups.debug ~desc:"Reset evm node data-dir to a specific block level." (args2 data_dir_arg @@ -1509,6 +1530,7 @@ let reset_command = let replay_command = let open Tezos_clic in command + ~group:Groups.debug ~desc:"Replay a specific block level." (args8 data_dir_arg @@ -1559,6 +1581,7 @@ let replay_command = let patch_kernel_command = let open Tezos_clic in command + ~group:Groups.kernel ~desc: "Patch the kernel used by the EVM node from its current HEAD. This is an \ unsafe command, which can lead to the EVM node diverging from the \ @@ -1601,6 +1624,7 @@ let describe_config_command = let open Tezos_clic in let open Lwt_result_syntax in command + ~group:Groups.config ~desc: {|Prints the JSON schema of the configuration file to the standard output.|} no_options @@ -1613,6 +1637,7 @@ let init_config_command = let open Tezos_clic in let open Lwt_result_syntax in command + ~group:Groups.config ~desc: "Create an initial config with default value.\n\ If the is set then adds the configuration for \ @@ -1758,6 +1783,7 @@ let check_config_command = let open Tezos_clic in let open Lwt_result_syntax in command + ~group:Groups.config ~desc: "Read and validate configuration files. By default, look for config.json \ in the data-dir. If --filename is used, check this config file instead." @@ -1820,6 +1846,7 @@ let make_l2_kernel_config_command = let open Lwt_result_syntax in let open Evm_node_lib_dev_encoding.Ethereum_types in command + ~group:Groups.kernel ~desc: "Produce a file containing the part of the kernel configuration \ instructions related to a particular L2 chain." @@ -1906,7 +1933,8 @@ let make_kernel_config_command = let open Tezos_clic in let open Lwt_result_syntax in command - ~desc:"Transforms the JSON list of instructions to a RLP list" + ~group:Groups.kernel + ~desc:"Create a configuration for the kernel installer" (merge_options (args25 mainnet_compat_arg @@ -2029,6 +2057,7 @@ let make_kernel_config_command = let proxy_command = let open Tezos_clic in command + ~group:Groups.run ~desc:"Start the EVM node in proxy mode." (merge_options common_config_args @@ -2129,6 +2158,7 @@ let sandbox_config_args = let sequencer_command = let open Tezos_clic in command + ~group:Groups.run ~desc:"Start the EVM node in sequencer mode" (merge_options common_config_args sequencer_config_args) (prefixes ["run"; "sequencer"] stop) @@ -2211,6 +2241,7 @@ let sequencer_command = let sandbox_command = let open Tezos_clic in command + ~group:Groups.run ~desc: "Start the EVM node in sandbox mode. The sandbox mode is a \ sequencer-like mode that produces blocks with a fake key and no rollup \ @@ -2328,6 +2359,7 @@ let observer_run_args = let observer_command = let open Tezos_clic in command + ~group:Groups.run ~desc:"Start the EVM node in observer mode" (merge_options common_config_args observer_run_args) (prefixes ["run"; "observer"] stop) @@ -2424,13 +2456,10 @@ let export_snapshot Format.printf "Snapshot exported to %s@." snapshot_file ; return_unit -let snapshot_group = - Tezos_clic.{name = "snapshot"; title = "Snapshots commands"} - let export_snapshot_command = let open Tezos_clic in command - ~group:snapshot_group + ~group:Groups.snapshot ~desc:"Export a snapshot of the EVM node." (args5 data_dir_arg @@ -2444,7 +2473,7 @@ let export_snapshot_command = let import_snapshot_command = let open Tezos_clic in command - ~group:snapshot_group + ~group:Groups.snapshot ~desc:"Import a snapshot of the EVM node." (args2 data_dir_arg @@ -2470,6 +2499,7 @@ let import_snapshot_command = let snapshot_info_command = let open Tezos_clic in command + ~group:Groups.snapshot ~desc:"Display information about an EVM node snapshot file." no_options (prefixes ["snapshot"; "info"] @@ Params.snapshot_file @@ stop) @@ -2546,6 +2576,7 @@ let snapshot_info_command = let switch_history_mode_command = let open Tezos_clic in command + ~group:Groups.storage ~desc:"Switch history mode of the node" (args2 data_dir_arg config_path_arg) (prefixes ["switch"; "history"; "to"] @@ Params.history @@ stop) @@ -2590,6 +2621,7 @@ let patch_state_command = let open Tezos_clic in let open Lwt_result_syntax in command + ~group:Groups.debug ~desc: "Patches the state with an arbitrary value. This is an unsafe command, \ it should be used for debugging only. Patched state is persisted and \ @@ -2629,7 +2661,8 @@ let patch_state_command = let preemptive_kernel_download_command = let open Tezos_clic in command - ~desc:"Transforms the JSON list of instructions to a RLP list" + ~group:Groups.kernel + ~desc:"Preemptively download a kernel before running the EVM node" (args5 data_dir_arg config_path_arg @@ -2681,6 +2714,7 @@ let preemptive_kernel_download_command = let debug_print_store_schemas_command = let open Tezos_clic in command + ~group:Groups.debug ~desc:"Print SQL statements describing the tables created in the store" no_options (prefixes ["debug"; "print"; "store"; "schemas"] @@ stop) @@ -2697,6 +2731,7 @@ let debug_print_store_schemas_command = let list_metrics_command = let open Tezos_clic in command + ~group:Groups.debug ~desc:"List the metrics exported by the EVM node." no_options (prefixes ["list"; "metrics"] @@ stop) @@ -2709,6 +2744,7 @@ let list_metrics_command = let list_events_command = let open Tezos_clic in command + ~group:Groups.debug ~desc:"List the events emitted by the EVM node." (args2 level_arg json_arg) (prefixes ["list"; "events"] stop) @@ -2769,6 +2805,7 @@ let commands = sequencer_command; observer_command; rpc_command; + init_config_command; snapshot_info_command; export_snapshot_command; import_snapshot_command; @@ -2777,17 +2814,16 @@ let commands = make_upgrade_command; make_sequencer_upgrade_command; init_from_rollup_node_command; - dump_to_rlp_command; reset_command; replay_command; patch_kernel_command; - init_config_command; check_config_command; describe_config_command; make_kernel_config_command; make_l2_kernel_config_command; - patch_state_command; preemptive_kernel_download_command; + dump_to_rlp_command; + patch_state_command; debug_print_store_schemas_command; list_metrics_command; list_events_command; -- GitLab From 6377e22179768ac894cc8e5f7aae7216f3d0b17b Mon Sep 17 00:00:00 2001 From: Alain Mebsout Date: Thu, 20 Mar 2025 20:46:18 +0100 Subject: [PATCH 4/4] Tezt: evm node man regression --- .../evm_sequencer.ml/EVM Node- man.out | 368 +++++++++--------- 1 file changed, 188 insertions(+), 180 deletions(-) diff --git a/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- man.out b/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- man.out index 014a3bfc8bf0..c52a43af062d 100644 --- a/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- man.out +++ b/etherlink/tezt/tests/expected/evm_sequencer.ml/EVM Node- man.out @@ -28,41 +28,7 @@ Access the documentation: --format : the manual's output format Defaults to `plain`. -Snapshots commands: - - snapshot export [--data-dir ] [--config-file ] - [-s --snapshot-file ] [--compress-on-the-fly] [--uncompressed] - Export a snapshot of the EVM node. - --data-dir : The path to the EVM node data directory - Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` - if it exists, or `$HOME/.octez-evm-node` otherwise. - --config-file : Path to a configuration file. Defaults to - `config.json` inside the data directory of the node. - If set, defaults to the value of EVM_NODE_CONFIG_FILE. - -s --snapshot-file : Path to the snapshot file to create, with - string interpolation. %r is replaced by the short form of the Smart - Rollup address, %R by the complete Smart Rollup address, %l by the - current head of the node, %h by the history mode used by the node, and - %% by %. Default is located in the current directory, and the filename - is based on the snapshot information. - --compress-on-the-fly: Produce a compressed snapshot on the fly. The - rollup node will use less disk space to produce the snapshot but will - lock the rollup node (if running) for a longer time. Without this - option, producing a snaphsot requires the available disk space to be - around the size of the data dir. - --uncompressed: Produce an uncompressed snapshot. - - snapshot import [--data-dir ] [-f --force] - Import a snapshot of the EVM node. - : Snapshot archive file or URL - --data-dir : The path to the EVM node data directory - Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` - if it exists, or `$HOME/.octez-evm-node` otherwise. - -f --force: Allow importing snapshot in already populated data dir - (previous contents is removed first, even if the snapshot is - corrupted), or importing a legacy snapshot in an empty data dir. - -Miscellaneous commands: +Run commands: run sandbox [--data-dir ] [--config-file ] [--rpc-addr ] [--rpc-port ] [--rpc-batch-limit ] @@ -457,70 +423,6 @@ Miscellaneous commands: execution for supported kernels. Can be `never`, `rpcs_only` or `always`. - snapshot info - Display information about an EVM node snapshot file. - : Snapshot archive file - - switch history to [--data-dir ] [--config-file ] - Switch history mode of the node - : History mode, either archive, rolling:n or full:n where n is - the number of days of history to retain. - --data-dir : The path to the EVM node data directory - Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` - if it exists, or `$HOME/.octez-evm-node` otherwise. - --config-file : Path to a configuration file. Defaults to - `config.json` inside the data directory of the node. - If set, defaults to the value of EVM_NODE_CONFIG_FILE. - - chunk data [...] [--rollup-address ] [--as-blueprint] - [--timestamp <[TIMESTAMP]>] [--number <0>] - [--parent-hash ] - [--sequencer-key ] [-d --wallet-dir ] - [-f --password-filename ] - Chunk hexadecimal data according to the message representation of the EVM - rollup - : Data to prepare and chunk with the EVM rollup format. If - the data is prefixed with `file:`, the content is read from the given - filename and can contain a list of data separated by a whitespace. - --rollup-address : The smart rollup address in Base58 encoding - used to produce the chunked messages - Defaults to `[SMART_ROLLUP_HASH]`. - --as-blueprint: Chunk the data into a blueprint usable in sequencer mode - --timestamp <[TIMESTAMP]>: - Defaults to `0`. - --number <0>: Level of the blueprint - Defaults to `0`. - --parent-hash : Blueprint's - parent hash - Defaults to - `ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`. - --sequencer-key : key to sign the blueprints. - -d --wallet-dir : The directory where the Tezos client stores all - its wallet data - Defaults to the value of the environment variable `$TEZOS_CLIENT_DIR` - if it exists, or `$HOME/.tezos-client` otherwise. - -f --password-filename : path to the password filename - - make upgrade payload with root hash at activation timestamp - - Create bytes payload for the upgrade entrypoint - : Root hash of the kernel to upgrade to - : After activation timestamp, the kernel will - upgrade to this value - - make sequencer upgrade payload with pool address at - activation timestamp for - [-d --wallet-dir ] - Create bytes payload for the sequencer upgrade entrypoint - : pool address of the sequencer - : After activation timestamp, the kernel will - upgrade to this value - : key to sign the blueprints. - -d --wallet-dir : The directory where the Tezos client stores all - its wallet data - Defaults to the value of the environment variable `$TEZOS_CLIENT_DIR` - if it exists, or `$HOME/.tezos-client` otherwise. - init from rollup node [--data-dir ] [--config-file ] [--omit-delayed-tx-events] initialises the EVM node data-dir using the data-dir of a rollup node. @@ -535,68 +437,9 @@ Miscellaneous commands: store of the EVM node. This is necessary when creating the data dir for an observer EVM node because delayed transactions are going to be fetched from the sequencer. - - transform dump to rlp [-k --keep-everything] - Transforms the JSON list of instructions to a RLP list - : Description - : Description - -k --keep-everything: Do not filter out files outside of the `/evm` - directory - - reset at [--data-dir ] [-f --force] - Reset evm node data-dir to a specific block level. - : level to reset to state to. - --data-dir : The path to the EVM node data directory - Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` - if it exists, or `$HOME/.octez-evm-node` otherwise. - -f --force: force suppression of data to reset state of sequencer to a - specified l2 level. - - replay blueprint [--data-dir ] [--config-file ] - [--preimages-dir <_evm_installer_preimages>] - [--preimages-endpoint ] [-n --native-execution-policy ] - [--kernel ] [--kernel-verbosity ] [--profile] - Replay a specific block level. - : level to replay - --data-dir : The path to the EVM node data directory - Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` - if it exists, or `$HOME/.octez-evm-node` otherwise. - --config-file : Path to a configuration file. Defaults to - `config.json` inside the data directory of the node. - If set, defaults to the value of EVM_NODE_CONFIG_FILE. - --preimages-dir <_evm_installer_preimages>: Path to the preimages - directory - --preimages-endpoint : The address of a service which provides - pre-images for the rollup. Missing pre-images will be downloaded - remotely if they are not already present on disk. - -n --native-execution-policy : Policy regarding the use of native - execution for supported kernels. Can be `never`, `rpcs_only` or - `always`. - --kernel : Path to the EVM kernel used to launch the - PVM, it will be loaded from storage afterward - --kernel-verbosity : Sets kernel's logging verbosity, either - `fatal`, `error`, `info`, `debug` - --profile: Profile the execution of the WASM PVM - - patch kernel with [--data-dir ] - [--config-file ] [--block-number ] [-f --force] - Patch the kernel used by the EVM node from its current HEAD. This is an - unsafe command, which can lead to the EVM node diverging from the - Etherlink main branch if the new kernel is not compatible with the one - deployed on the network. - : Path to the kernel - --data-dir : The path to the EVM node data directory - Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` - if it exists, or `$HOME/.octez-evm-node` otherwise. - --config-file : Path to a configuration file. Defaults to - `config.json` inside the data directory of the node. - If set, defaults to the value of EVM_NODE_CONFIG_FILE. - --block-number : If provided, the state resulting in the application - of the requested block will be used instead of the latest state. In - that case, the patch will only impact replays of the successor block - only. - -f --force: Force patching the kernel - + +Configuration commands: + init config [--data-dir ] [--config-file ] [--rpc-addr ] [--rpc-port ] [--rpc-batch-limit ] [--cors-origins ] [--cors-headers ] @@ -725,6 +568,127 @@ Miscellaneous commands: describe config Prints the JSON schema of the configuration file to the standard output. + +Snapshots commands: + + snapshot info + Display information about an EVM node snapshot file. + : Snapshot archive file + + snapshot export [--data-dir ] [--config-file ] + [-s --snapshot-file ] [--compress-on-the-fly] [--uncompressed] + Export a snapshot of the EVM node. + --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. + --config-file : Path to a configuration file. Defaults to + `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. + -s --snapshot-file : Path to the snapshot file to create, with + string interpolation. %r is replaced by the short form of the Smart + Rollup address, %R by the complete Smart Rollup address, %l by the + current head of the node, %h by the history mode used by the node, and + %% by %. Default is located in the current directory, and the filename + is based on the snapshot information. + --compress-on-the-fly: Produce a compressed snapshot on the fly. The + rollup node will use less disk space to produce the snapshot but will + lock the rollup node (if running) for a longer time. Without this + option, producing a snaphsot requires the available disk space to be + around the size of the data dir. + --uncompressed: Produce an uncompressed snapshot. + + snapshot import [--data-dir ] [-f --force] + Import a snapshot of the EVM node. + : Snapshot archive file or URL + --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. + -f --force: Allow importing snapshot in already populated data dir + (previous contents is removed first, even if the snapshot is + corrupted), or importing a legacy snapshot in an empty data dir. + +Storage commands: + + switch history to [--data-dir ] [--config-file ] + Switch history mode of the node + : History mode, either archive, rolling:n or full:n where n is + the number of days of history to retain. + --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. + --config-file : Path to a configuration file. Defaults to + `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. + +Kernel commands: + + chunk data [...] [--rollup-address ] [--as-blueprint] + [--timestamp <[TIMESTAMP]>] [--number <0>] + [--parent-hash ] + [--sequencer-key ] [-d --wallet-dir ] + [-f --password-filename ] + Chunk hexadecimal data according to the message representation of the EVM + rollup + : Data to prepare and chunk with the EVM rollup format. If + the data is prefixed with `file:`, the content is read from the given + filename and can contain a list of data separated by a whitespace. + --rollup-address : The smart rollup address in Base58 encoding + used to produce the chunked messages + Defaults to `[SMART_ROLLUP_HASH]`. + --as-blueprint: Chunk the data into a blueprint usable in sequencer mode + --timestamp <[TIMESTAMP]>: + Defaults to `0`. + --number <0>: Level of the blueprint + Defaults to `0`. + --parent-hash : Blueprint's + parent hash + Defaults to + `ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`. + --sequencer-key : key to sign the blueprints. + -d --wallet-dir : The directory where the Tezos client stores all + its wallet data + Defaults to the value of the environment variable `$TEZOS_CLIENT_DIR` + if it exists, or `$HOME/.tezos-client` otherwise. + -f --password-filename : path to the password filename + + make upgrade payload with root hash at activation timestamp + + Create bytes payload for the upgrade entrypoint + : Root hash of the kernel to upgrade to + : After activation timestamp, the kernel will + upgrade to this value + + make sequencer upgrade payload with pool address at + activation timestamp for + [-d --wallet-dir ] + Create bytes payload for the sequencer upgrade entrypoint + : pool address of the sequencer + : After activation timestamp, the kernel will + upgrade to this value + : key to sign the blueprints. + -d --wallet-dir : The directory where the Tezos client stores all + its wallet data + Defaults to the value of the environment variable `$TEZOS_CLIENT_DIR` + if it exists, or `$HOME/.tezos-client` otherwise. + + patch kernel with [--data-dir ] + [--config-file ] [--block-number ] [-f --force] + Patch the kernel used by the EVM node from its current HEAD. This is an + unsafe command, which can lead to the EVM node diverging from the + Etherlink main branch if the new kernel is not compatible with the one + deployed on the network. + : Path to the kernel + --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. + --config-file : Path to a configuration file. Defaults to + `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. + --block-number : If provided, the state resulting in the application + of the requested block will be used instead of the latest state. In + that case, the patch will only impact replays of the successor block + only. + -f --force: Force patching the kernel make kernel installer config [--mainnet-compat] [--kernel-root-hash ] [--chain-id ] @@ -744,7 +708,7 @@ Miscellaneous commands: [--enable-multichain] [--l2-chain-id <1>] [--max-delayed-inbox-blueprint-length <1000>] [--enable-fast-withdrawal] - Transforms the JSON list of instructions to a RLP list + Create a configuration for the kernel installer : file path where the config will be written to --mainnet-compat: Generate a configuration compatible with the first Etherlink Mainnet kernel @@ -831,27 +795,10 @@ Miscellaneous commands: of the L2 chain. Defaults to `EVM`. - patch state at with [--data-dir ] - [--config-file ] [--block-number ] [-f --force] - Patches the state with an arbitrary value. This is an unsafe command, it - should be used for debugging only. Patched state is persisted and you - need to use the command `reset` to revert the changes. - : Durable storage path - : Patched value - --data-dir : The path to the EVM node data directory - Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` - if it exists, or `$HOME/.octez-evm-node` otherwise. - --config-file : Path to a configuration file. Defaults to - `config.json` inside the data directory of the node. - If set, defaults to the value of EVM_NODE_CONFIG_FILE. - --block-number : If provided, the state resulting in the application - of the requested block will be used instead of the latest state. - -f --force: Force patching the state - download kernel with root hash [--data-dir ] [--config-file ] [--preimages-dir <_evm_installer_preimages>] [--preimages-endpoint ] [--retry <1>] - Transforms the JSON list of instructions to a RLP list + Preemptively download a kernel before running the EVM node : root hash of the kernel to download --data-dir : The path to the EVM node data directory Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` @@ -867,6 +814,67 @@ Miscellaneous commands: --retry <1>: Number of times a revealed preimage can be redownloaded in case the it doesn't pass the sanity check. It can be useful if the download is corrupted for some reason. + +Debug commands: + + reset at [--data-dir ] [-f --force] + Reset evm node data-dir to a specific block level. + : level to reset to state to. + --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. + -f --force: force suppression of data to reset state of sequencer to a + specified l2 level. + + replay blueprint [--data-dir ] [--config-file ] + [--preimages-dir <_evm_installer_preimages>] + [--preimages-endpoint ] [-n --native-execution-policy ] + [--kernel ] [--kernel-verbosity ] [--profile] + Replay a specific block level. + : level to replay + --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. + --config-file : Path to a configuration file. Defaults to + `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. + --preimages-dir <_evm_installer_preimages>: Path to the preimages + directory + --preimages-endpoint : The address of a service which provides + pre-images for the rollup. Missing pre-images will be downloaded + remotely if they are not already present on disk. + -n --native-execution-policy : Policy regarding the use of native + execution for supported kernels. Can be `never`, `rpcs_only` or + `always`. + --kernel : Path to the EVM kernel used to launch the + PVM, it will be loaded from storage afterward + --kernel-verbosity : Sets kernel's logging verbosity, either + `fatal`, `error`, `info`, `debug` + --profile: Profile the execution of the WASM PVM + + transform dump to rlp [-k --keep-everything] + Transforms the JSON list of instructions to a RLP list + : Description + : Description + -k --keep-everything: Do not filter out files outside of the `/evm` + directory + + patch state at with [--data-dir ] + [--config-file ] [--block-number ] [-f --force] + Patches the state with an arbitrary value. This is an unsafe command, it + should be used for debugging only. Patched state is persisted and you + need to use the command `reset` to revert the changes. + : Durable storage path + : Patched value + --data-dir : The path to the EVM node data directory + Defaults to the value of the environment variable `$EVM_NODE_DATA_DIR` + if it exists, or `$HOME/.octez-evm-node` otherwise. + --config-file : Path to a configuration file. Defaults to + `config.json` inside the data directory of the node. + If set, defaults to the value of EVM_NODE_CONFIG_FILE. + --block-number : If provided, the state resulting in the application + of the requested block will be used instead of the latest state. + -f --force: Force patching the state debug print store schemas Print SQL statements describing the tables created in the store -- GitLab