From 7d45f6dd9c47e15438b0eaecca3a54f53c5a4cd9 Mon Sep 17 00:00:00 2001 From: Ermal Kaleci Date: Tue, 4 Jun 2024 11:05:10 +0200 Subject: [PATCH] add docs --- README.md | 3 +++ .../src/plugins/try-runtime/README.md | 21 +++++++++++++++++++ .../src/plugins/try-runtime/index.ts | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 packages/chopsticks/src/plugins/try-runtime/README.md diff --git a/README.md b/README.md index 4c2776a5..c957b871 100644 --- a/README.md +++ b/README.md @@ -221,3 +221,6 @@ The subcommand arguments could be: Please note that for both ways, fetched storages will be saved in the sqlite file specified by `--db` option (`db: ./acala.sqlite` in a config file), if not provided, it will default to `./db-{network}-{block}.sqlite`. +## Try-Runtime CLI + +Documentation can be found [here](packages/chopsticks/src/plugins/try-runtime/README.md) diff --git a/packages/chopsticks/src/plugins/try-runtime/README.md b/packages/chopsticks/src/plugins/try-runtime/README.md new file mode 100644 index 00000000..21461117 --- /dev/null +++ b/packages/chopsticks/src/plugins/try-runtime/README.md @@ -0,0 +1,21 @@ +# Try-Runtime CLI + +🚧 EXPERIMENTAL FEATURE 🚧 + +You can use Chopsticks to perform runtime migration checks. It doesn't support PoV measure yet, only weight check is support. + +```bash +# try-runtime print help +npx @acala-network/chopsticks try-runtime --help +``` + +Basic example: + +```bash +npx @acala-network/chopsticks try-runtime \ + --endpoint \ + --runtime \ + --checks PreAndPost +``` + +__NOTE__: You can also use `--config` to pass arguments diff --git a/packages/chopsticks/src/plugins/try-runtime/index.ts b/packages/chopsticks/src/plugins/try-runtime/index.ts index 4d1ac5b8..cf1a1207 100644 --- a/packages/chopsticks/src/plugins/try-runtime/index.ts +++ b/packages/chopsticks/src/plugins/try-runtime/index.ts @@ -11,7 +11,7 @@ const schema = z.object({ endpoint: configSchema.shape.endpoint, block: configSchema.shape.block, db: configSchema.shape.db, - ['runtime-log-level']: configSchema.shape['runtime-log-level'], + ['runtime-log-level']: configSchema.shape['runtime-log-level'].default(5), ['runtime']: z.string({ description: 'Path to WASM built with feature `try-runtime` enabled', }),