From 23f9d7a3eba6f5182ea86f4c80d85f60764b7885 Mon Sep 17 00:00:00 2001 From: Danil Date: Thu, 1 Aug 2024 16:55:26 +0200 Subject: [PATCH] docs(zk_toolbox): Add markdown help (#2562) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Autogenerated markdown help, it will allow to make the integration a bit more straight forward ## Why ❔ ## Checklist - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. --------- Signed-off-by: Danil --- zk_toolbox/Cargo.lock | 11 + zk_toolbox/Cargo.toml | 1 + zk_toolbox/crates/zk_inception/Cargo.toml | 1 + zk_toolbox/crates/zk_inception/README.md | 568 ++++++++++++++++++ .../zk_inception/src/commands/chain/mod.rs | 2 +- zk_toolbox/crates/zk_inception/src/main.rs | 5 + zk_toolbox/crates/zk_supervisor/Cargo.toml | 1 + zk_toolbox/crates/zk_supervisor/README.md | 270 +++++++++ .../zk_supervisor/src/commands/clean/mod.rs | 3 + zk_toolbox/crates/zk_supervisor/src/main.rs | 5 + 10 files changed, 866 insertions(+), 1 deletion(-) create mode 100644 zk_toolbox/crates/zk_inception/README.md create mode 100644 zk_toolbox/crates/zk_supervisor/README.md diff --git a/zk_toolbox/Cargo.lock b/zk_toolbox/Cargo.lock index 35e3067482e1..cc2640f1f029 100644 --- a/zk_toolbox/Cargo.lock +++ b/zk_toolbox/Cargo.lock @@ -551,6 +551,15 @@ dependencies = [ "clap_derive", ] +[[package]] +name = "clap-markdown" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ebc67e6266e14f8b31541c2f204724fa2ac7ad5c17d6f5908fbb92a60f42cff" +dependencies = [ + "clap", +] + [[package]] name = "clap_builder" version = "4.5.8" @@ -6263,6 +6272,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap", + "clap-markdown", "cliclack", "common", "config", @@ -6291,6 +6301,7 @@ version = "0.1.0" dependencies = [ "anyhow", "clap", + "clap-markdown", "common", "config", "human-panic", diff --git a/zk_toolbox/Cargo.toml b/zk_toolbox/Cargo.toml index ef47b9f7015a..e1b11d8495bc 100644 --- a/zk_toolbox/Cargo.toml +++ b/zk_toolbox/Cargo.toml @@ -54,3 +54,4 @@ tokio = { version = "1.37", features = ["full"] } toml = "0.8.12" url = { version = "2.5.0", features = ["serde"] } xshell = "0.2.6" +clap-markdown = "0.1.4" diff --git a/zk_toolbox/crates/zk_inception/Cargo.toml b/zk_toolbox/crates/zk_inception/Cargo.toml index 2626611376fe..3e44303951bf 100644 --- a/zk_toolbox/crates/zk_inception/Cargo.toml +++ b/zk_toolbox/crates/zk_inception/Cargo.toml @@ -33,3 +33,4 @@ thiserror.workspace = true zksync_config.workspace = true slugify-rs.workspace = true zksync_basic_types.workspace = true +clap-markdown.workspace = true diff --git a/zk_toolbox/crates/zk_inception/README.md b/zk_toolbox/crates/zk_inception/README.md new file mode 100644 index 000000000000..00223851d8d9 --- /dev/null +++ b/zk_toolbox/crates/zk_inception/README.md @@ -0,0 +1,568 @@ +# Command-Line Help for `zk_inception` + +This document contains the help content for the `zk_inception` command-line program. + +**Command Overview:** + +- [`zk_inception`↴](#zk_inception) +- [`zk_inception ecosystem`↴](#zk_inception-ecosystem) +- [`zk_inception ecosystem create`↴](#zk_inception-ecosystem-create) +- [`zk_inception ecosystem init`↴](#zk_inception-ecosystem-init) +- [`zk_inception ecosystem change-default-chain`↴](#zk_inception-ecosystem-change-default-chain) +- [`zk_inception chain`↴](#zk_inception-chain) +- [`zk_inception chain create`↴](#zk_inception-chain-create) +- [`zk_inception chain init`↴](#zk_inception-chain-init) +- [`zk_inception chain genesis`↴](#zk_inception-chain-genesis) +- [`zk_inception chain initialize-bridges`↴](#zk_inception-chain-initialize-bridges) +- [`zk_inception chain deploy-l2-contracts`↴](#zk_inception-chain-deploy-l2-contracts) +- [`zk_inception chain upgrader`↴](#zk_inception-chain-upgrader) +- [`zk_inception chain deploy-paymaster`↴](#zk_inception-chain-deploy-paymaster) +- [`zk_inception prover`↴](#zk_inception-prover) +- [`zk_inception prover init`↴](#zk_inception-prover-init) +- [`zk_inception prover generate-sk`↴](#zk_inception-prover-generate-sk) +- [`zk_inception prover run`↴](#zk_inception-prover-run) +- [`zk_inception prover init-bellman-cuda`↴](#zk_inception-prover-init-bellman-cuda) +- [`zk_inception server`↴](#zk_inception-server) +- [`zk_inception external-node`↴](#zk_inception-external-node) +- [`zk_inception external-node configs`↴](#zk_inception-external-node-configs) +- [`zk_inception external-node init`↴](#zk_inception-external-node-init) +- [`zk_inception external-node run`↴](#zk_inception-external-node-run) +- [`zk_inception containers`↴](#zk_inception-containers) +- [`zk_inception contract-verifier`↴](#zk_inception-contract-verifier) +- [`zk_inception contract-verifier run`↴](#zk_inception-contract-verifier-run) +- [`zk_inception contract-verifier init`↴](#zk_inception-contract-verifier-init) +- [`zk_inception update`↴](#zk_inception-update) + +## `zk_inception` + +ZK Toolbox is a set of tools for working with zk stack. + +**Usage:** `zk_inception [OPTIONS] ` + +###### **Subcommands:** + +- `ecosystem` — Ecosystem related commands +- `chain` — Chain related commands +- `prover` — Prover related commands +- `server` — Run server +- `external-node` — External Node related commands +- `containers` — Run containers for local development +- `contract-verifier` — Run contract verifier +- `update` — Update zkSync + +###### **Options:** + +- `-v`, `--verbose` — Verbose mode +- `--chain ` — Chain to use +- `--ignore-prerequisites` — Ignores prerequisites checks + +## `zk_inception ecosystem` + +Ecosystem related commands + +**Usage:** `zk_inception ecosystem ` + +###### **Subcommands:** + +- `create` — Create a new ecosystem and chain, setting necessary configurations for later initialization +- `init` — Initialize ecosystem and chain, deploying necessary contracts and performing on-chain operations +- `change-default-chain` — Change the default chain + +## `zk_inception ecosystem create` + +Create a new ecosystem and chain, setting necessary configurations for later initialization + +**Usage:** `zk_inception ecosystem create [OPTIONS] [CHAIN_ID]` + +###### **Arguments:** + +- `` + +###### **Options:** + +- `--ecosystem-name ` +- `--l1-network ` — L1 Network + + Possible values: `localhost`, `sepolia`, `mainnet` + +- `--link-to-code ` — Code link +- `--chain-name ` +- `--prover-mode ` — Prover options + + Possible values: `no-proofs`, `gpu` + +- `--wallet-creation ` — Wallet options + + Possible values: + + - `localhost`: Load wallets from localhost mnemonic, they are funded for localhost env + - `random`: Generate random wallets + - `empty`: Generate placeholder wallets + - `in-file`: Specify file with wallets + +- `--wallet-path ` — Wallet path +- `--l1-batch-commit-data-generator-mode ` — Commit data generation mode + + Possible values: `rollup`, `validium` + +- `--base-token-address ` — Base token address +- `--base-token-price-nominator ` — Base token nominator +- `--base-token-price-denominator ` — Base token denominator +- `--set-as-default ` — Set as default chain + + Possible values: `true`, `false` + +- `--start-containers ` — Start reth and postgres containers after creation + + Possible values: `true`, `false` + +## `zk_inception ecosystem init` + +Initialize ecosystem and chain, deploying necessary contracts and performing on-chain operations + +**Usage:** `zk_inception ecosystem init [OPTIONS]` + +###### **Options:** + +- `--deploy-paymaster ` — Deploy Paymaster contract + + Possible values: `true`, `false` + +- `--deploy-erc20 ` — Deploy ERC20 contracts + + Possible values: `true`, `false` + +- `--deploy-ecosystem ` — Deploy ecosystem contracts + + Possible values: `true`, `false` + +- `--ecosystem-contracts-path ` — Path to ecosystem contracts +- `--l1-rpc-url ` — L1 RPC URL +- `--verify ` — Verify deployed contracts + + Possible values: `true`, `false` + +- `--verifier ` — Verifier to use + + Default value: `etherscan` + + Possible values: `etherscan`, `sourcify`, `blockscout`, `oklink` + +- `--verifier-url ` — Verifier URL, if using a custom provider +- `--verifier-api-key ` — Verifier API key +- `--resume` +- `-a`, `--additional-args ` — List of additional arguments that can be passed through the CLI. + + e.g.: `zk_inception init -a --private-key=` + +- `--server-db-url ` — Server database url without database name +- `--server-db-name ` — Server database name +- `--prover-db-url ` — Prover database url without database name +- `--prover-db-name ` — Prover database name +- `-u`, `--use-default` — Use default database urls and names +- `-d`, `--dont-drop` +- `--dev` — Deploy ecosystem using all defaults. Suitable for local development + +## `zk_inception ecosystem change-default-chain` + +Change the default chain + +**Usage:** `zk_inception ecosystem change-default-chain [NAME]` + +###### **Arguments:** + +- `` + +## `zk_inception chain` + +Chain related commands + +**Usage:** `zk_inception chain ` + +###### **Subcommands:** + +- `create` — Create a new chain, setting the necessary configurations for later initialization +- `init` — Initialize chain, deploying necessary contracts and performing on-chain operations +- `genesis` — Run server genesis +- `initialize-bridges` — Initialize bridges on l2 +- `deploy-l2-contracts` — Deploy all l2 contracts +- `upgrader` — Deploy Default Upgrader +- `deploy-paymaster` — Deploy paymaster smart contract + +## `zk_inception chain create` + +Create a new chain, setting the necessary configurations for later initialization + +**Usage:** `zk_inception chain create [OPTIONS] [CHAIN_ID]` + +###### **Arguments:** + +- `` + +###### **Options:** + +- `--chain-name ` +- `--prover-mode ` — Prover options + + Possible values: `no-proofs`, `gpu` + +- `--wallet-creation ` — Wallet options + + Possible values: + + - `localhost`: Load wallets from localhost mnemonic, they are funded for localhost env + - `random`: Generate random wallets + - `empty`: Generate placeholder wallets + - `in-file`: Specify file with wallets + +- `--wallet-path ` — Wallet path +- `--l1-batch-commit-data-generator-mode ` — Commit data generation mode + + Possible values: `rollup`, `validium` + +- `--base-token-address ` — Base token address +- `--base-token-price-nominator ` — Base token nominator +- `--base-token-price-denominator ` — Base token denominator +- `--set-as-default ` — Set as default chain + + Possible values: `true`, `false` + +## `zk_inception chain init` + +Initialize chain, deploying necessary contracts and performing on-chain operations + +**Usage:** `zk_inception chain init [OPTIONS]` + +###### **Options:** + +- `--verify ` — Verify deployed contracts + + Possible values: `true`, `false` + +- `--verifier ` — Verifier to use + + Default value: `etherscan` + + Possible values: `etherscan`, `sourcify`, `blockscout`, `oklink` + +- `--verifier-url ` — Verifier URL, if using a custom provider +- `--verifier-api-key ` — Verifier API key +- `--resume` +- `-a`, `--additional-args ` — List of additional arguments that can be passed through the CLI. + + e.g.: `zk_inception init -a --private-key=` + +- `--server-db-url ` — Server database url without database name +- `--server-db-name ` — Server database name +- `--prover-db-url ` — Prover database url without database name +- `--prover-db-name ` — Prover database name +- `-u`, `--use-default` — Use default database urls and names +- `-d`, `--dont-drop` +- `--deploy-paymaster ` + + Possible values: `true`, `false` + +- `--l1-rpc-url ` — L1 RPC URL + +## `zk_inception chain genesis` + +Run server genesis + +**Usage:** `zk_inception chain genesis [OPTIONS]` + +###### **Options:** + +- `--server-db-url ` — Server database url without database name +- `--server-db-name ` — Server database name +- `--prover-db-url ` — Prover database url without database name +- `--prover-db-name ` — Prover database name +- `-u`, `--use-default` — Use default database urls and names +- `-d`, `--dont-drop` + +## `zk_inception chain initialize-bridges` + +Initialize bridges on l2 + +**Usage:** `zk_inception chain initialize-bridges [OPTIONS]` + +###### **Options:** + +- `--verify ` — Verify deployed contracts + + Possible values: `true`, `false` + +- `--verifier ` — Verifier to use + + Default value: `etherscan` + + Possible values: `etherscan`, `sourcify`, `blockscout`, `oklink` + +- `--verifier-url ` — Verifier URL, if using a custom provider +- `--verifier-api-key ` — Verifier API key +- `--resume` +- `-a`, `--additional-args ` — List of additional arguments that can be passed through the CLI. + + e.g.: `zk_inception init -a --private-key=` + +## `zk_inception chain deploy-l2-contracts` + +Deploy all l2 contracts + +**Usage:** `zk_inception chain deploy-l2-contracts [OPTIONS]` + +###### **Options:** + +- `--verify ` — Verify deployed contracts + + Possible values: `true`, `false` + +- `--verifier ` — Verifier to use + + Default value: `etherscan` + + Possible values: `etherscan`, `sourcify`, `blockscout`, `oklink` + +- `--verifier-url ` — Verifier URL, if using a custom provider +- `--verifier-api-key ` — Verifier API key +- `--resume` +- `-a`, `--additional-args ` — List of additional arguments that can be passed through the CLI. + + e.g.: `zk_inception init -a --private-key=` + +## `zk_inception chain upgrader` + +Deploy Default Upgrader + +**Usage:** `zk_inception chain upgrader [OPTIONS]` + +###### **Options:** + +- `--verify ` — Verify deployed contracts + + Possible values: `true`, `false` + +- `--verifier ` — Verifier to use + + Default value: `etherscan` + + Possible values: `etherscan`, `sourcify`, `blockscout`, `oklink` + +- `--verifier-url ` — Verifier URL, if using a custom provider +- `--verifier-api-key ` — Verifier API key +- `--resume` +- `-a`, `--additional-args ` — List of additional arguments that can be passed through the CLI. + + e.g.: `zk_inception init -a --private-key=` + +## `zk_inception chain deploy-paymaster` + +Deploy paymaster smart contract + +**Usage:** `zk_inception chain deploy-paymaster [OPTIONS]` + +###### **Options:** + +- `--verify ` — Verify deployed contracts + + Possible values: `true`, `false` + +- `--verifier ` — Verifier to use + + Default value: `etherscan` + + Possible values: `etherscan`, `sourcify`, `blockscout`, `oklink` + +- `--verifier-url ` — Verifier URL, if using a custom provider +- `--verifier-api-key ` — Verifier API key +- `--resume` +- `-a`, `--additional-args ` — List of additional arguments that can be passed through the CLI. + + e.g.: `zk_inception init -a --private-key=` + +## `zk_inception prover` + +Prover related commands + +**Usage:** `zk_inception prover ` + +###### **Subcommands:** + +- `init` — Initialize prover +- `generate-sk` — Generate setup keys +- `run` — Run prover +- `init-bellman-cuda` — Initialize bellman-cuda + +## `zk_inception prover init` + +Initialize prover + +**Usage:** `zk_inception prover init [OPTIONS]` + +###### **Options:** + +- `--proof-store-dir ` +- `--bucket-base-url ` +- `--credentials-file ` +- `--bucket-name ` +- `--location ` +- `--project-id ` +- `--shall-save-to-public-bucket ` + + Possible values: `true`, `false` + +- `--public-store-dir ` +- `--public-bucket-base-url ` +- `--public-credentials-file ` +- `--public-bucket-name ` +- `--public-location ` +- `--public-project-id ` +- `--bellman-cuda-dir ` +- `--download-key ` + + Possible values: `true`, `false` + +- `--setup-key-path ` +- `--cloud-type ` + + Possible values: `gcp`, `local` + +## `zk_inception prover generate-sk` + +Generate setup keys + +**Usage:** `zk_inception prover generate-sk` + +## `zk_inception prover run` + +Run prover + +**Usage:** `zk_inception prover run [OPTIONS]` + +###### **Options:** + +- `--component ` + + Possible values: `gateway`, `witness-generator`, `witness-vector-generator`, `prover`, `compressor` + +- `--round ` + + Possible values: `all-rounds`, `basic-circuits`, `leaf-aggregation`, `node-aggregation`, `recursion-tip`, `scheduler` + +- `--threads ` + +## `zk_inception prover init-bellman-cuda` + +Initialize bellman-cuda + +**Usage:** `zk_inception prover init-bellman-cuda [OPTIONS]` + +###### **Options:** + +- `--bellman-cuda-dir ` + +## `zk_inception server` + +Run server + +**Usage:** `zk_inception server [OPTIONS]` + +###### **Options:** + +- `--components ` — Components of server to run +- `--genesis` — Run server in genesis mode +- `-a`, `--additional-args ` — Additional arguments that can be passed through the CLI +- `--build` — Build server but don't run it + +## `zk_inception external-node` + +External Node related commands + +**Usage:** `zk_inception external-node ` + +###### **Subcommands:** + +- `configs` — Prepare configs for EN +- `init` — Init databases +- `run` — Run external node + +## `zk_inception external-node configs` + +Prepare configs for EN + +**Usage:** `zk_inception external-node configs [OPTIONS]` + +###### **Options:** + +- `--db-url ` +- `--db-name ` +- `--l1-rpc-url ` +- `-u`, `--use-default` — Use default database urls and names + +## `zk_inception external-node init` + +Init databases + +**Usage:** `zk_inception external-node init` + +## `zk_inception external-node run` + +Run external node + +**Usage:** `zk_inception external-node run [OPTIONS]` + +###### **Options:** + +- `--reinit` +- `--components ` — Components of server to run +- `-a`, `--additional-args ` — Additional arguments that can be passed through the CLI + +## `zk_inception containers` + +Run containers for local development + +**Usage:** `zk_inception containers` + +## `zk_inception contract-verifier` + +Run contract verifier + +**Usage:** `zk_inception contract-verifier ` + +###### **Subcommands:** + +- `run` — Run contract verifier +- `init` — Download required binaries for contract verifier + +## `zk_inception contract-verifier run` + +Run contract verifier + +**Usage:** `zk_inception contract-verifier run` + +## `zk_inception contract-verifier init` + +Download required binaries for contract verifier + +**Usage:** `zk_inception contract-verifier init [OPTIONS]` + +###### **Options:** + +- `--zksolc-version ` — Version of zksolc to install +- `--zkvyper-version ` — Version of zkvyper to install +- `--solc-version ` — Version of solc to install +- `--vyper-version ` — Version of vyper to install + +## `zk_inception update` + +Update zkSync + +**Usage:** `zk_inception update [OPTIONS]` + +###### **Options:** + +- `-c`, `--only-config` — Update only the config files + +
+ + This document was generated automatically by +clap-markdown. diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/mod.rs index 5333ead30662..6fcb20478c72 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/mod.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/mod.rs @@ -32,7 +32,7 @@ pub enum ChainCommands { DeployL2Contracts(ForgeScriptArgs), /// Deploy Default Upgrader Upgrader(ForgeScriptArgs), - /// Initialize bridges on l2 + /// Deploy paymaster smart contract #[command(alias = "paymaster")] DeployPaymaster(ForgeScriptArgs), } diff --git a/zk_toolbox/crates/zk_inception/src/main.rs b/zk_toolbox/crates/zk_inception/src/main.rs index 208f1c2ece99..2b5bdeb9c1a5 100644 --- a/zk_toolbox/crates/zk_inception/src/main.rs +++ b/zk_toolbox/crates/zk_inception/src/main.rs @@ -59,6 +59,8 @@ pub enum InceptionSubcommands { /// Update zkSync #[command(alias = "u")] Update(UpdateArgs), + #[command(hide = true)] + Markdown, } #[derive(Parser, Debug)] @@ -117,6 +119,9 @@ async fn run_subcommand(inception_args: Inception, shell: &Shell) -> anyhow::Res commands::contract_verifier::run(shell, args).await? } InceptionSubcommands::Update(args) => commands::update::run(shell, args)?, + InceptionSubcommands::Markdown => { + clap_markdown::print_help_markdown::(); + } } Ok(()) } diff --git a/zk_toolbox/crates/zk_supervisor/Cargo.toml b/zk_toolbox/crates/zk_supervisor/Cargo.toml index 54d9a819a7b9..c600561161c9 100644 --- a/zk_toolbox/crates/zk_supervisor/Cargo.toml +++ b/zk_toolbox/crates/zk_supervisor/Cargo.toml @@ -21,3 +21,4 @@ tokio.workspace = true url.workspace = true xshell.workspace = true serde.workspace = true +clap-markdown.workspace = true diff --git a/zk_toolbox/crates/zk_supervisor/README.md b/zk_toolbox/crates/zk_supervisor/README.md new file mode 100644 index 000000000000..4648fe6cb366 --- /dev/null +++ b/zk_toolbox/crates/zk_supervisor/README.md @@ -0,0 +1,270 @@ +# Command-Line Help for `zk_supervisor` + +This document contains the help content for the `zk_supervisor` command-line program. + +**Command Overview:** + +- [`zk_supervisor`↴](#zk_supervisor) +- [`zk_supervisor database`↴](#zk_supervisor-database) +- [`zk_supervisor database check-sqlx-data`↴](#zk_supervisor-database-check-sqlx-data) +- [`zk_supervisor database drop`↴](#zk_supervisor-database-drop) +- [`zk_supervisor database migrate`↴](#zk_supervisor-database-migrate) +- [`zk_supervisor database new-migration`↴](#zk_supervisor-database-new-migration) +- [`zk_supervisor database prepare`↴](#zk_supervisor-database-prepare) +- [`zk_supervisor database reset`↴](#zk_supervisor-database-reset) +- [`zk_supervisor database setup`↴](#zk_supervisor-database-setup) +- [`zk_supervisor test`↴](#zk_supervisor-test) +- [`zk_supervisor test integration`↴](#zk_supervisor-test-integration) +- [`zk_supervisor test revert`↴](#zk_supervisor-test-revert) +- [`zk_supervisor test recovery`↴](#zk_supervisor-test-recovery) +- [`zk_supervisor test upgrade`↴](#zk_supervisor-test-upgrade) +- [`zk_supervisor clean`↴](#zk_supervisor-clean) +- [`zk_supervisor clean all`↴](#zk_supervisor-clean-all) +- [`zk_supervisor clean containers`↴](#zk_supervisor-clean-containers) +- [`zk_supervisor clean contracts-cache`↴](#zk_supervisor-clean-contracts-cache) +- [`zk_supervisor snapshot`↴](#zk_supervisor-snapshot) +- [`zk_supervisor snapshot create`↴](#zk_supervisor-snapshot-create) + +## `zk_supervisor` + +ZK Toolbox is a set of tools for working with zk stack. + +**Usage:** `zk_supervisor [OPTIONS] ` + +###### **Subcommands:** + +- `database` — Database related commands +- `test` — Run tests +- `clean` — Clean artifacts +- `snapshot` — Snapshots creator + +###### **Options:** + +- `-v`, `--verbose` — Verbose mode +- `--chain ` — Chain to use +- `--ignore-prerequisites` — Ignores prerequisites checks + +## `zk_supervisor database` + +Database related commands + +**Usage:** `zk_supervisor database ` + +###### **Subcommands:** + +- `check-sqlx-data` — Check sqlx-data.json is up to date. If no databases are selected, all databases will be checked. +- `drop` — Drop databases. If no databases are selected, all databases will be dropped. +- `migrate` — Migrate databases. If no databases are selected, all databases will be migrated. +- `new-migration` — Create new migration +- `prepare` — Prepare sqlx-data.json. If no databases are selected, all databases will be prepared. +- `reset` — Reset databases. If no databases are selected, all databases will be reset. +- `setup` — Setup databases. If no databases are selected, all databases will be setup. + +## `zk_supervisor database check-sqlx-data` + +Check sqlx-data.json is up to date. If no databases are selected, all databases will be checked. + +**Usage:** `zk_supervisor database check-sqlx-data [OPTIONS]` + +###### **Options:** + +- `-p`, `--prover ` — Prover database + + Possible values: `true`, `false` + +- `-c`, `--core ` — Core database + + Possible values: `true`, `false` + +## `zk_supervisor database drop` + +Drop databases. If no databases are selected, all databases will be dropped. + +**Usage:** `zk_supervisor database drop [OPTIONS]` + +###### **Options:** + +- `-p`, `--prover ` — Prover database + + Possible values: `true`, `false` + +- `-c`, `--core ` — Core database + + Possible values: `true`, `false` + +## `zk_supervisor database migrate` + +Migrate databases. If no databases are selected, all databases will be migrated. + +**Usage:** `zk_supervisor database migrate [OPTIONS]` + +###### **Options:** + +- `-p`, `--prover ` — Prover database + + Possible values: `true`, `false` + +- `-c`, `--core ` — Core database + + Possible values: `true`, `false` + +## `zk_supervisor database new-migration` + +Create new migration + +**Usage:** `zk_supervisor database new-migration [OPTIONS]` + +###### **Options:** + +- `--database ` — Database to create new migration for + + Possible values: `prover`, `core` + +- `--name ` — Migration name + +## `zk_supervisor database prepare` + +Prepare sqlx-data.json. If no databases are selected, all databases will be prepared. + +**Usage:** `zk_supervisor database prepare [OPTIONS]` + +###### **Options:** + +- `-p`, `--prover ` — Prover database + + Possible values: `true`, `false` + +- `-c`, `--core ` — Core database + + Possible values: `true`, `false` + +## `zk_supervisor database reset` + +Reset databases. If no databases are selected, all databases will be reset. + +**Usage:** `zk_supervisor database reset [OPTIONS]` + +###### **Options:** + +- `-p`, `--prover ` — Prover database + + Possible values: `true`, `false` + +- `-c`, `--core ` — Core database + + Possible values: `true`, `false` + +## `zk_supervisor database setup` + +Setup databases. If no databases are selected, all databases will be setup. + +**Usage:** `zk_supervisor database setup [OPTIONS]` + +###### **Options:** + +- `-p`, `--prover ` — Prover database + + Possible values: `true`, `false` + +- `-c`, `--core ` — Core database + + Possible values: `true`, `false` + +## `zk_supervisor test` + +Run tests + +**Usage:** `zk_supervisor test ` + +###### **Subcommands:** + +- `integration` — Run integration tests +- `revert` — Run revert tests +- `recovery` — Run recovery tests +- `upgrade` — Run upgrade tests + +## `zk_supervisor test integration` + +Run integration tests + +**Usage:** `zk_supervisor test integration [OPTIONS]` + +###### **Options:** + +- `-e`, `--external-node` — Run tests for external node + +## `zk_supervisor test revert` + +Run revert tests + +**Usage:** `zk_supervisor test revert [OPTIONS]` + +###### **Options:** + +- `--enable-consensus` — Enable consensus +- `-e`, `--external-node` — Run tests for external node + +## `zk_supervisor test recovery` + +Run recovery tests + +**Usage:** `zk_supervisor test recovery [OPTIONS]` + +###### **Options:** + +- `-s`, `--snapshot` — Run recovery from a snapshot instead of genesis + +## `zk_supervisor test upgrade` + +Run upgrade tests + +**Usage:** `zk_supervisor test upgrade` + +## `zk_supervisor clean` + +Clean artifacts + +**Usage:** `zk_supervisor clean ` + +###### **Subcommands:** + +- `all` — Remove containers and contracts cache +- `containers` — Remove containers and docker volumes +- `contracts-cache` — Remove contracts caches + +## `zk_supervisor clean all` + +Remove containers and contracts cache + +**Usage:** `zk_supervisor clean all` + +## `zk_supervisor clean containers` + +Remove containers and docker volumes + +**Usage:** `zk_supervisor clean containers` + +## `zk_supervisor clean contracts-cache` + +Remove contracts caches + +**Usage:** `zk_supervisor clean contracts-cache` + +## `zk_supervisor snapshot` + +Snapshots creator + +**Usage:** `zk_supervisor snapshot ` + +###### **Subcommands:** + +- `create` — + +## `zk_supervisor snapshot create` + +**Usage:** `zk_supervisor snapshot create` + +
+ + This document was generated automatically by +clap-markdown. diff --git a/zk_toolbox/crates/zk_supervisor/src/commands/clean/mod.rs b/zk_toolbox/crates/zk_supervisor/src/commands/clean/mod.rs index 7f72427b6941..92c8a0f1086e 100644 --- a/zk_toolbox/crates/zk_supervisor/src/commands/clean/mod.rs +++ b/zk_toolbox/crates/zk_supervisor/src/commands/clean/mod.rs @@ -44,6 +44,9 @@ pub fn containers(shell: &Shell) -> anyhow::Result<()> { pub fn contracts(shell: &Shell, ecosystem_config: &EcosystemConfig) -> anyhow::Result<()> { let path_to_foundry = ecosystem_config.path_to_foundry(); logger::info(MSG_CONTRACTS_CLEANING); + shell + .remove_path(path_to_foundry.join("broadcast")) + .context("broadcast")?; shell .remove_path(path_to_foundry.join("artifacts")) .context("artifacts")?; diff --git a/zk_toolbox/crates/zk_supervisor/src/main.rs b/zk_toolbox/crates/zk_supervisor/src/main.rs index 8b2b469390aa..2976fb554184 100644 --- a/zk_toolbox/crates/zk_supervisor/src/main.rs +++ b/zk_toolbox/crates/zk_supervisor/src/main.rs @@ -38,6 +38,8 @@ enum SupervisorSubcommands { Clean(CleanCommands), #[command(subcommand, about = "Snapshots creator")] Snapshot(SnapshotCommands), + #[command(hide = true)] + Markdown, } #[derive(Parser, Debug)] @@ -89,6 +91,9 @@ async fn run_subcommand(args: Supervisor, shell: &Shell) -> anyhow::Result<()> { SupervisorSubcommands::Test(command) => commands::test::run(shell, command)?, SupervisorSubcommands::Clean(command) => commands::clean::run(shell, command)?, SupervisorSubcommands::Snapshot(command) => commands::snapshot::run(shell, command).await?, + SupervisorSubcommands::Markdown => { + clap_markdown::print_help_markdown::(); + } } Ok(()) }