From 285f249179bfb5a19714977d3e71319305341b84 Mon Sep 17 00:00:00 2001 From: glihm Date: Sun, 8 Sep 2024 22:08:50 -0600 Subject: [PATCH 1/3] fix: rename to dev and fix args flag --- cli/src/command/deployments/create.rs | 2 +- .../command/deployments/services/katana.rs | 10 +- slot/schema.json | 619 ++++++++++++++---- 3 files changed, 482 insertions(+), 149 deletions(-) diff --git a/cli/src/command/deployments/create.rs b/cli/src/command/deployments/create.rs index c9a729a..e06fe17 100644 --- a/cli/src/command/deployments/create.rs +++ b/cli/src/command/deployments/create.rs @@ -55,7 +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, + dev: config.dev, }), torii: None, madara: None, diff --git a/cli/src/command/deployments/services/katana.rs b/cli/src/command/deployments/services/katana.rs index 896bdc2..351316f 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::{ArgAction, Args}; +use clap::Args; use katana_primitives::genesis; use katana_primitives::genesis::json::GenesisJson; @@ -52,9 +52,9 @@ pub struct KatanaCreateArgs { #[arg(value_parser = genesis_value_parser)] pub genesis: Option, - #[arg(long, action = ArgAction::Set, default_value_t = false)] + #[arg(long)] #[arg(help = "Enable Katana dev mode for specific endpoints.")] - pub dev_mode: bool, + pub dev: bool, } #[derive(Debug, Args, serde::Serialize)] @@ -92,9 +92,9 @@ pub struct KatanaUpdateArgs { #[arg(help = "Gas Price.")] pub gas_price: Option, - #[arg(long, action = ArgAction::Set, default_value_t = false)] + #[arg(long)] #[arg(help = "Enable Katana dev mode for specific endpoints.")] - pub dev_mode: bool, + pub dev: bool, } #[derive(Debug, Args, serde::Serialize)] diff --git a/slot/schema.json b/slot/schema.json index d1eb1e8..4205ce9 100644 --- a/slot/schema.json +++ b/slot/schema.json @@ -2845,6 +2845,12 @@ "description": null, "isDeprecated": false, "name": "injected" + }, + { + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "starknet_account" } ], "fields": [], @@ -11734,20 +11740,6 @@ "name": "String", "ofType": null } - }, - { - "defaultValue": null, - "description": null, - "name": "devMode", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - } } ], "interfaces": [], @@ -11836,6 +11828,199 @@ "name": "CreateMadaraConfigInput", "possibleTypes": [] }, + { + "description": null, + "enumValues": [], + "fields": [], + "inputFields": [ + { + "defaultValue": null, + "description": null, + "name": "mode", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "defaultValue": null, + "description": null, + "name": "rpcUrl", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "defaultValue": null, + "description": null, + "name": "registry", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "defaultValue": null, + "description": null, + "name": "settlementContract", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "defaultValue": null, + "description": null, + "name": "world", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "defaultValue": null, + "description": null, + "name": "proverUrl", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "defaultValue": null, + "description": null, + "name": "storeProofs", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + } + }, + { + "defaultValue": null, + "description": null, + "name": "starknetUrl", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "defaultValue": null, + "description": null, + "name": "signerKey", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "defaultValue": null, + "description": null, + "name": "signerAddress", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "defaultValue": null, + "description": null, + "name": "privateKey", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "defaultValue": null, + "description": null, + "name": "batchSize", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + }, + { + "defaultValue": null, + "description": null, + "name": "startBlock", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + } + ], + "interfaces": [], + "kind": "INPUT_OBJECT", + "name": "CreateSayaConfigInput", + "possibleTypes": [] + }, { "description": null, "enumValues": [], @@ -11870,6 +12055,16 @@ "name": "CreateMadaraConfigInput", "ofType": null } + }, + { + "defaultValue": null, + "description": null, + "name": "saya", + "type": { + "kind": "INPUT_OBJECT", + "name": "CreateSayaConfigInput", + "ofType": null + } } ], "interfaces": [], @@ -12478,6 +12673,11 @@ "kind": "OBJECT", "name": "MadaraConfig", "ofType": null + }, + { + "kind": "OBJECT", + "name": "SayaConfig", + "ofType": null } ] }, @@ -13364,6 +13564,12 @@ "description": null, "isDeprecated": false, "name": "madara" + }, + { + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "saya" } ], "fields": [], @@ -20158,20 +20364,6 @@ "ofType": null } } - }, - { - "defaultValue": null, - "description": null, - "name": "devMode", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - } } ], "inputFields": [], @@ -20681,101 +20873,38 @@ "name": null, "ofType": { "kind": "SCALAR", - "name": "ID", + "name": "String", "ofType": null } } - }, + } + ], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "beginLogin", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "JSON", + "ofType": null + } + } + }, + { + "args": [ { "defaultValue": null, "description": null, - "name": "chainId", + "name": "credentials", "type": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "SCALAR", - "name": "ChainID", - "ofType": null - } - } - }, - { - "defaultValue": null, - "description": null, - "name": "starterpackIds", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - } - } - } - ], - "deprecationReason": null, - "description": null, - "isDeprecated": false, - "name": "deployAccount", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - }, - { - "args": [ - { - "defaultValue": null, - "description": null, - "name": "id", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - } - ], - "deprecationReason": null, - "description": null, - "isDeprecated": false, - "name": "beginLogin", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "JSON", - "ofType": null - } - } - }, - { - "args": [ - { - "defaultValue": null, - "description": null, - "name": "credentials", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", + "name": "String", "ofType": null } } @@ -20795,37 +20924,6 @@ } } }, - { - "args": [ - { - "defaultValue": null, - "description": null, - "name": "token", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - } - ], - "deprecationReason": null, - "description": null, - "isDeprecated": false, - "name": "discordRevoke", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - } - }, { "args": [ { @@ -27850,6 +27948,241 @@ "name": "Role", "possibleTypes": [] }, + { + "description": null, + "enumValues": [], + "fields": [ + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "version", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "mode", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "rpcUrl", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "registry", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "settlementContract", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "world", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "proverUrl", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "storeProofs", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "starknetUrl", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "signerKey", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "signerAddress", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "privateKey", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "batchSize", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "startBlock", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + } + } + ], + "inputFields": [], + "interfaces": [], + "kind": "OBJECT", + "name": "SayaConfig", + "possibleTypes": [] + }, { "description": null, "enumValues": [], From c8e260958011f94c39579909533818755b1e8ff2 Mon Sep 17 00:00:00 2001 From: steebchen Date: Mon, 9 Sep 2024 10:15:54 -0400 Subject: [PATCH 2/3] adapt schema --- slot/schema.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/slot/schema.json b/slot/schema.json index 4205ce9..6f60cb0 100644 --- a/slot/schema.json +++ b/slot/schema.json @@ -11740,6 +11740,16 @@ "name": "String", "ofType": null } + }, + { + "defaultValue": null, + "description": null, + "name": "dev", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } } ], "interfaces": [], @@ -39456,6 +39466,16 @@ "name": "Long", "ofType": null } + }, + { + "defaultValue": null, + "description": null, + "name": "dev", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } } ], "interfaces": [], From 095708d1aa12a63ca44d5bbce226ac8416bc015e Mon Sep 17 00:00:00 2001 From: glihm Date: Mon, 9 Sep 2024 08:25:44 -0600 Subject: [PATCH 3/3] fix: take dev in account and set Saya to None --- cli/src/command/deployments/create.rs | 5 ++++- cli/src/command/deployments/update.rs | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/src/command/deployments/create.rs b/cli/src/command/deployments/create.rs index e06fe17..af54561 100644 --- a/cli/src/command/deployments/create.rs +++ b/cli/src/command/deployments/create.rs @@ -55,10 +55,11 @@ impl CreateArgs { invoke_max_steps: config.invoke_max_steps, validate_max_steps: config.validate_max_steps, genesis: config.genesis.clone(), - dev: config.dev, + dev: config.dev.then_some(true), }), torii: None, madara: None, + saya: None, }), }, CreateServiceCommands::Torii(config) => CreateServiceInput { @@ -74,6 +75,7 @@ impl CreateArgs { index_pending: config.index_pending, polling_interval: config.polling_interval, }), + saya: None, }), }, CreateServiceCommands::Madara(config) => CreateServiceInput { @@ -91,6 +93,7 @@ impl CreateArgs { sealing: config.sealing.clone().map(|s| s.to_string()), chain: config.chain.clone().map(|c| c.to_string()), }), + saya: None, }), }, }; diff --git a/cli/src/command/deployments/update.rs b/cli/src/command/deployments/update.rs index 396f957..953c3d4 100644 --- a/cli/src/command/deployments/update.rs +++ b/cli/src/command/deployments/update.rs @@ -42,6 +42,7 @@ impl UpdateArgs { gas_price: config.gas_price, invoke_max_steps: config.invoke_max_steps, validate_max_steps: config.validate_max_steps, + dev: config.dev.then_some(true), }), }), },