From a5b3913d4ddf41db68d0dcc05d6a165bb53a580d Mon Sep 17 00:00:00 2001 From: glihm Date: Sun, 8 Sep 2024 21:13:29 -0600 Subject: [PATCH] feat: add dev mode support for Katana (#82) --- cli/src/command/deployments/create.rs | 1 + .../command/deployments/services/katana.rs | 10 ++++++- slot/schema.json | 28 +++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/cli/src/command/deployments/create.rs b/cli/src/command/deployments/create.rs index 544b906..c9a729a 100644 --- a/cli/src/command/deployments/create.rs +++ b/cli/src/command/deployments/create.rs @@ -55,6 +55,7 @@ impl CreateArgs { invoke_max_steps: config.invoke_max_steps, validate_max_steps: config.validate_max_steps, genesis: config.genesis.clone(), + dev_mode: config.dev_mode, }), torii: None, madara: None, diff --git a/cli/src/command/deployments/services/katana.rs b/cli/src/command/deployments/services/katana.rs index 56b58c5..896bdc2 100644 --- a/cli/src/command/deployments/services/katana.rs +++ b/cli/src/command/deployments/services/katana.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use clap::Args; +use clap::{ArgAction, Args}; use katana_primitives::genesis; use katana_primitives::genesis::json::GenesisJson; @@ -51,6 +51,10 @@ pub struct KatanaCreateArgs { #[arg(help = "Path to a Katana genesis file.")] #[arg(value_parser = genesis_value_parser)] pub genesis: Option, + + #[arg(long, action = ArgAction::Set, default_value_t = false)] + #[arg(help = "Enable Katana dev mode for specific endpoints.")] + pub dev_mode: bool, } #[derive(Debug, Args, serde::Serialize)] @@ -87,6 +91,10 @@ pub struct KatanaUpdateArgs { #[arg(long, value_name = "gas_price")] #[arg(help = "Gas Price.")] pub gas_price: Option, + + #[arg(long, action = ArgAction::Set, default_value_t = false)] + #[arg(help = "Enable Katana dev mode for specific endpoints.")] + pub dev_mode: bool, } #[derive(Debug, Args, serde::Serialize)] diff --git a/slot/schema.json b/slot/schema.json index 2ec63bf..d1eb1e8 100644 --- a/slot/schema.json +++ b/slot/schema.json @@ -11734,6 +11734,20 @@ "name": "String", "ofType": null } + }, + { + "defaultValue": null, + "description": null, + "name": "devMode", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + } } ], "interfaces": [], @@ -20144,6 +20158,20 @@ "ofType": null } } + }, + { + "defaultValue": null, + "description": null, + "name": "devMode", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + } } ], "inputFields": [],