From 6256f74e61c664bc80c40972d2535fe40f24b35f Mon Sep 17 00:00:00 2001 From: Troy Kessler <43882936+troykessler@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:06:20 +0200 Subject: [PATCH] chore: added dry-run flag to kysor (#153) --- tools/kysor/src/commands/start.ts | 9 +++++++++ tools/kysor/src/kysor.ts | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/tools/kysor/src/commands/start.ts b/tools/kysor/src/commands/start.ts index b406d637..3b3873f7 100644 --- a/tools/kysor/src/commands/start.ts +++ b/tools/kysor/src/commands/start.ts @@ -15,6 +15,15 @@ start "Specify the path to an .env file which should be used when starting a binary" ) .option("--debug", "Run the validator node in debug mode") + .option( + "--dry-run", + "Run the node without uploading or voting on bundles so the operator can test his setup before joining as a validator." + ) + .option( + "--dry-run-bundles ", + "Specify the number of bundles that should be tested before the node properly exits. If zero the node will run indefinitely [default = 0]", + "0" + ) .action(async (options) => { await run(options); }); diff --git a/tools/kysor/src/kysor.ts b/tools/kysor/src/kysor.ts index 92622f3e..0cea2699 100644 --- a/tools/kysor/src/kysor.ts +++ b/tools/kysor/src/kysor.ts @@ -408,6 +408,15 @@ export const run = async (options: any) => { args.push("--debug"); } + if (options.dryRun) { + args.push("--dry-run"); + } + + if (options.dryRunBundles > 0) { + args.push("--dry-run-bundles"); + args.push(`${options.dryRunBundles}`); + } + if (valaccount.requestBackoff) { args.push(`--request-backoff`); args.push(`${valaccount.requestBackoff}`);