From 8f53f9afdbb4c55123d347346b2348ee2983f20d Mon Sep 17 00:00:00 2001 From: steebchen Date: Fri, 20 Sep 2024 17:31:01 -0400 Subject: [PATCH 1/2] Remove Madara service support This commit deletes the Madara service from the CLI, related modules, and configurations. It updates the README, GraphQL queries, and other deployment-related code to reflect the removal of Madara. This change simplifies the deployment options available. --- README.md | 5 +- cli/src/command/deployments/create.rs | 28 +----- cli/src/command/deployments/delete.rs | 2 - cli/src/command/deployments/describe.rs | 8 +- cli/src/command/deployments/logs.rs | 1 - .../command/deployments/services/madara.rs | 86 ------------------- cli/src/command/deployments/services/mod.rs | 5 -- cli/src/command/deployments/update.rs | 3 +- slot/src/graphql/deployments/create.graphql | 5 -- slot/src/graphql/deployments/describe.graphql | 5 -- 10 files changed, 5 insertions(+), 143 deletions(-) delete mode 100644 cli/src/command/deployments/services/madara.rs diff --git a/README.md b/README.md index a805398..706160d 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,6 @@ slot auth login Create service deployments ```sh slot deployments create katana -slot deployments create madara slot deployments create torii --world 0x3fa481f41522b90b3684ecfab7650c259a76387fab9c380b7a959e3d4ac69f ``` @@ -37,7 +36,7 @@ slot deployments delete torii Read service logs ```sh -slot deployments logs +slot deployments logs ``` List all deployments @@ -47,7 +46,7 @@ slot deployments list View deployments configuration ```sh -slot deployments describe +slot deployments describe ``` View predeployed accounts diff --git a/cli/src/command/deployments/create.rs b/cli/src/command/deployments/create.rs index e184eaa..6d0fec7 100644 --- a/cli/src/command/deployments/create.rs +++ b/cli/src/command/deployments/create.rs @@ -5,7 +5,7 @@ use clap::Args; use slot::api::Client; use slot::credential::Credentials; use slot::graphql::deployments::create_deployment::CreateDeploymentCreateDeployment::{ - KatanaConfig, MadaraConfig, SayaConfig, ToriiConfig, + KatanaConfig, SayaConfig, ToriiConfig, }; use slot::graphql::deployments::create_deployment::*; use slot::graphql::deployments::CreateDeployment; @@ -58,7 +58,6 @@ impl CreateArgs { dev: config.dev.then_some(true), }), torii: None, - madara: None, saya: None, }), }, @@ -67,7 +66,6 @@ impl CreateArgs { version: config.version.clone(), config: Some(CreateServiceConfigInput { katana: None, - madara: None, torii: Some(CreateToriiConfigInput { rpc: Some(config.rpc.clone().unwrap_or("".to_string())), world: format!("{:#x}", config.world), @@ -78,31 +76,12 @@ impl CreateArgs { saya: None, }), }, - CreateServiceCommands::Madara(config) => CreateServiceInput { - type_: DeploymentService::madara, - version: config.version.clone(), - config: Some(CreateServiceConfigInput { - katana: None, - torii: None, - madara: Some(CreateMadaraConfigInput { - name: config.name.clone(), - base_path: config.base_path.clone(), - dev: config.dev.then_some(true), - no_grandpa: config.no_grandpa.then_some(true), - validator: config.validator.then_some(true), - sealing: config.sealing.clone().map(|s| s.to_string()), - chain: config.chain.clone().map(|c| c.to_string()), - }), - saya: None, - }), - }, CreateServiceCommands::Saya(config) => CreateServiceInput { type_: DeploymentService::saya, version: config.version.clone(), config: Some(CreateServiceConfigInput { katana: None, torii: None, - madara: None, saya: Some(CreateSayaConfigInput { mode: config.mode.clone(), rpc_url: config.rpc_url.clone(), @@ -163,16 +142,11 @@ impl CreateArgs { println!("\nEndpoints:"); println!(" RPC: {}", config.rpc); } - MadaraConfig(config) => { - println!("\nEndpoints:"); - println!(" RPC: {}", config.rpc); - } } let service = match &self.create_commands { CreateServiceCommands::Katana(_) => "katana", CreateServiceCommands::Torii(_) => "torii", - CreateServiceCommands::Madara(_) => "madara", CreateServiceCommands::Saya(_) => "saya", }; diff --git a/cli/src/command/deployments/delete.rs b/cli/src/command/deployments/delete.rs index a6942e9..420d115 100644 --- a/cli/src/command/deployments/delete.rs +++ b/cli/src/command/deployments/delete.rs @@ -10,7 +10,6 @@ use slot::{api::Client, credential::Credentials}; pub enum Service { Katana, Torii, - Madara, Saya, } @@ -49,7 +48,6 @@ impl DeleteArgs { let service = match &self.service { Service::Katana => DeploymentService::katana, Service::Torii => DeploymentService::torii, - Service::Madara => DeploymentService::madara, Service::Saya => DeploymentService::saya, }; diff --git a/cli/src/command/deployments/describe.rs b/cli/src/command/deployments/describe.rs index 51bf903..39e77fa 100644 --- a/cli/src/command/deployments/describe.rs +++ b/cli/src/command/deployments/describe.rs @@ -4,7 +4,7 @@ use super::services::Service; use anyhow::Result; use clap::Args; use slot::graphql::deployments::describe_deployment::DescribeDeploymentDeploymentConfig::{ - KatanaConfig, MadaraConfig, SayaConfig, ToriiConfig, + KatanaConfig, SayaConfig, ToriiConfig, }; use slot::graphql::deployments::{describe_deployment::*, DescribeDeployment}; use slot::graphql::GraphQLQuery; @@ -25,7 +25,6 @@ impl DescribeArgs { let service = match self.service { Service::Torii => DeploymentService::torii, Service::Katana => DeploymentService::katana, - Service::Madara => DeploymentService::madara, Service::Saya => DeploymentService::saya, }; @@ -67,11 +66,6 @@ impl DescribeArgs { println!(" Version: {}", config.version); println!(" RPC: {}", config.rpc); } - MadaraConfig(config) => { - println!("\nEndpoints:"); - println!(" Version: {}", config.version); - println!(" RPC: {}", config.rpc); - } SayaConfig(config) => { println!("\nEndpoints:"); println!(" RPC URL: {}", config.rpc_url); diff --git a/cli/src/command/deployments/logs.rs b/cli/src/command/deployments/logs.rs index ed400ba..4a8bc95 100644 --- a/cli/src/command/deployments/logs.rs +++ b/cli/src/command/deployments/logs.rs @@ -79,7 +79,6 @@ impl LogReader { let service = match self.service { Service::Katana => DeploymentService::katana, Service::Torii => DeploymentService::torii, - Service::Madara => DeploymentService::madara, Service::Saya => DeploymentService::saya, }; diff --git a/cli/src/command/deployments/services/madara.rs b/cli/src/command/deployments/services/madara.rs deleted file mode 100644 index e870fd1..0000000 --- a/cli/src/command/deployments/services/madara.rs +++ /dev/null @@ -1,86 +0,0 @@ -use core::fmt; - -use clap::{Args, ValueEnum}; -use serde::Serialize; - -#[derive(Debug, Args, Serialize)] -#[command(next_help_heading = "Madara create options")] -pub struct MadaraCreateArgs { - #[arg(long, short, value_name = "version")] - #[arg(help = "Service version to use.")] - pub version: Option, - - #[arg(long, value_name = "dev")] - #[arg( - help = "Specify the development chain. This flag sets `--chain=dev`, `--force-authoring`, `--rpc-cors=all`, `--alice`, and `--tmp` flags, unless explicitly overridden" - )] - pub dev: bool, - - #[arg(long, value_name = "name")] - #[arg(help = "The human-readable name for this node. It's used as network node name.")] - pub name: Option, - - #[arg(long, value_name = "validator")] - #[arg( - help = "Enable validator mode. The node will be started with the authority role and actively participate in any consensus task that it can (e.g. depending on availability of local keys)" - )] - pub validator: bool, - - #[arg(long, value_name = "no_grandpa")] - #[arg( - help = "Disable GRANDPA voter when running in validator mode, otherwise disable the GRANDPA observer" - )] - pub no_grandpa: bool, - - #[arg(long, value_name = "chain")] - #[arg(help = "Specify the chain specification. It can be one of the predefined ones")] - pub chain: Option, - - #[arg(long, value_name = "base_path")] - #[arg(help = "Specify custom base path")] - pub base_path: Option, - - #[arg(long, value_name = "chain")] - #[arg(help = "Choose sealing method")] - pub sealing: Option, - - #[arg(long, value_name = "from_remote")] - #[arg( - help = "Prior to starting the node, the setup cmd will be executed using this value. If none is provided, setup will use the default config." - )] - pub from_remote: Option, -} - -#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum, Serialize)] -pub enum SealingMethod { - Manual, - Instant, - InstantFinality, -} - -impl fmt::Display for SealingMethod { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - SealingMethod::Manual => write!(f, "manual"), - SealingMethod::Instant => write!(f, "instant"), - SealingMethod::InstantFinality => write!(f, "instant-finality"), - } - } -} - -#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum, Serialize)] -pub enum ChainOption { - Dev, - Local, - Staging, -} - -impl fmt::Display for ChainOption { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - ChainOption::Dev => write!(f, "dev"), - ChainOption::Local => write!(f, "local"), - ChainOption::Staging => write!(f, "staging"), - } - } -} diff --git a/cli/src/command/deployments/services/mod.rs b/cli/src/command/deployments/services/mod.rs index bf6b798..d03c8e7 100644 --- a/cli/src/command/deployments/services/mod.rs +++ b/cli/src/command/deployments/services/mod.rs @@ -2,13 +2,11 @@ use clap::{Subcommand, ValueEnum}; use self::{ katana::{KatanaAccountArgs, KatanaCreateArgs, KatanaForkArgs, KatanaUpdateArgs}, - madara::MadaraCreateArgs, saya::{SayaCreateArgs, SayaUpdateArgs}, torii::{ToriiCreateArgs, ToriiUpdateArgs}, }; mod katana; -mod madara; mod saya; mod torii; @@ -19,8 +17,6 @@ pub enum CreateServiceCommands { Katana(KatanaCreateArgs), #[command(about = "Torii deployment.")] Torii(ToriiCreateArgs), - #[command(about = "Madara deployment.")] - Madara(MadaraCreateArgs), #[command(about = "Saya deployment.")] Saya(SayaCreateArgs), } @@ -56,6 +52,5 @@ pub enum KatanaAccountCommands { pub enum Service { Katana, Torii, - Madara, Saya, } diff --git a/cli/src/command/deployments/update.rs b/cli/src/command/deployments/update.rs index 740fbfe..6d67695 100644 --- a/cli/src/command/deployments/update.rs +++ b/cli/src/command/deployments/update.rs @@ -7,7 +7,7 @@ use clap::Args; use slot::api::Client; use slot::credential::Credentials; use slot::graphql::deployments::update_deployment::UpdateDeploymentUpdateDeployment::{ - KatanaConfig, MadaraConfig, SayaConfig, ToriiConfig, + KatanaConfig, SayaConfig, ToriiConfig, }; use slot::graphql::deployments::update_deployment::{ self, UpdateKatanaConfigInput, UpdateServiceConfigInput, UpdateServiceInput, @@ -94,7 +94,6 @@ impl UpdateArgs { println!("\nEndpoints:"); println!(" RPC: {}", config.rpc); } - MadaraConfig => {} // TODO: implement SayaConfig(config) => { println!("\nConfiguration:"); println!(" RPC URL: {}", config.rpc_url); diff --git a/slot/src/graphql/deployments/create.graphql b/slot/src/graphql/deployments/create.graphql index 67eb953..28a445c 100644 --- a/slot/src/graphql/deployments/create.graphql +++ b/slot/src/graphql/deployments/create.graphql @@ -27,11 +27,6 @@ mutation CreateDeployment( indexPending } - ... on MadaraConfig { - rpc - name - } - ... on SayaConfig { rpcUrl } diff --git a/slot/src/graphql/deployments/describe.graphql b/slot/src/graphql/deployments/describe.graphql index 1fcfec7..5c6b8cd 100644 --- a/slot/src/graphql/deployments/describe.graphql +++ b/slot/src/graphql/deployments/describe.graphql @@ -20,11 +20,6 @@ query DescribeDeployment($project: String!, $service: DeploymentService!) { startBlock indexPending } - ... on MadaraConfig { - version - rpc - name - } ... on SayaConfig { rpcUrl From 581bbbce87b2819c68961bb204b4b8b153bb203b Mon Sep 17 00:00:00 2001 From: steebchen Date: Fri, 20 Sep 2024 17:36:01 -0400 Subject: [PATCH 2/2] adapt schema --- slot/schema.json | 231 +---------------------------------------------- 1 file changed, 1 insertion(+), 230 deletions(-) diff --git a/slot/schema.json b/slot/schema.json index 6f60cb0..a91cff1 100644 --- a/slot/schema.json +++ b/slot/schema.json @@ -11757,87 +11757,6 @@ "name": "CreateKatanaConfigInput", "possibleTypes": [] }, - { - "description": null, - "enumValues": [], - "fields": [], - "inputFields": [ - { - "defaultValue": null, - "description": null, - "name": "name", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "defaultValue": null, - "description": null, - "name": "validator", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - { - "defaultValue": null, - "description": null, - "name": "noGrandpa", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - { - "defaultValue": null, - "description": null, - "name": "chain", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "defaultValue": null, - "description": null, - "name": "basePath", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "defaultValue": null, - "description": null, - "name": "dev", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - { - "defaultValue": null, - "description": null, - "name": "sealing", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - ], - "interfaces": [], - "kind": "INPUT_OBJECT", - "name": "CreateMadaraConfigInput", - "possibleTypes": [] - }, { "description": null, "enumValues": [], @@ -12056,16 +11975,6 @@ "ofType": null } }, - { - "defaultValue": null, - "description": null, - "name": "madara", - "type": { - "kind": "INPUT_OBJECT", - "name": "CreateMadaraConfigInput", - "ofType": null - } - }, { "defaultValue": null, "description": null, @@ -12679,11 +12588,6 @@ "name": "ToriiConfig", "ofType": null }, - { - "kind": "OBJECT", - "name": "MadaraConfig", - "ofType": null - }, { "kind": "OBJECT", "name": "SayaConfig", @@ -13569,12 +13473,6 @@ "isDeprecated": false, "name": "torii" }, - { - "deprecationReason": null, - "description": null, - "isDeprecated": false, - "name": "madara" - }, { "deprecationReason": null, "description": null, @@ -20529,133 +20427,6 @@ "name": "Long", "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": "rpc", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - }, - { - "args": [], - "deprecationReason": null, - "description": null, - "isDeprecated": false, - "name": "name", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "args": [], - "deprecationReason": null, - "description": null, - "isDeprecated": false, - "name": "validator", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - { - "args": [], - "deprecationReason": null, - "description": null, - "isDeprecated": false, - "name": "noGrandpa", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - { - "args": [], - "deprecationReason": null, - "description": null, - "isDeprecated": false, - "name": "chain", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "args": [], - "deprecationReason": null, - "description": null, - "isDeprecated": false, - "name": "basePath", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - { - "args": [], - "deprecationReason": null, - "description": null, - "isDeprecated": false, - "name": "dev", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - { - "args": [], - "deprecationReason": null, - "description": null, - "isDeprecated": false, - "name": "sealing", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - ], - "inputFields": [], - "interfaces": [], - "kind": "OBJECT", - "name": "MadaraConfig", - "possibleTypes": [] - }, { "description": null, "enumValues": [], @@ -40490,4 +40261,4 @@ ] } } -} \ No newline at end of file +}