From ad837ec5230cce9018580079e9f08ae5a0e4c032 Mon Sep 17 00:00:00 2001 From: glihm Date: Thu, 2 May 2024 13:33:51 -0600 Subject: [PATCH 1/2] feat: add torii index pending option --- schema.json | 30 +++++++++++++++++++++++ src/command/deployments/create.graphql | 1 + src/command/deployments/create.rs | 1 + src/command/deployments/describe.graphql | 1 + src/command/deployments/describe.rs | 1 + src/command/deployments/services/torii.rs | 4 +++ src/command/deployments/update.graphql | 1 + src/command/deployments/update.rs | 1 + 8 files changed, 40 insertions(+) diff --git a/schema.json b/schema.json index 7b51c17..191be53 100644 --- a/schema.json +++ b/schema.json @@ -11792,6 +11792,20 @@ "name": "Int", "ofType": null } + }, + { + "defaultValue": null, + "description": null, + "name": "indexPending", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + } } ], "interfaces": [], @@ -33634,6 +33648,22 @@ "ofType": null } } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "indexPending", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + } } ], "inputFields": [], diff --git a/src/command/deployments/create.graphql b/src/command/deployments/create.graphql index 233d08a..bdf49e0 100644 --- a/src/command/deployments/create.graphql +++ b/src/command/deployments/create.graphql @@ -20,6 +20,7 @@ mutation CreateDeployment( rpc world startBlock + indexPending } ... on MadaraConfig { rpc diff --git a/src/command/deployments/create.rs b/src/command/deployments/create.rs index 5ff425a..333771f 100644 --- a/src/command/deployments/create.rs +++ b/src/command/deployments/create.rs @@ -74,6 +74,7 @@ impl CreateArgs { rpc: config.rpc.clone(), world: format!("{:#x}", config.world), start_block: Some(config.start_block), + index_pending: config.index_pending, }), }), }, diff --git a/src/command/deployments/describe.graphql b/src/command/deployments/describe.graphql index 6d6a67c..98b0dea 100644 --- a/src/command/deployments/describe.graphql +++ b/src/command/deployments/describe.graphql @@ -16,6 +16,7 @@ query DescribeDeployment($project: String!, $service: DeploymentService!) { rpc world startBlock + indexPending } ... on MadaraConfig { version diff --git a/src/command/deployments/describe.rs b/src/command/deployments/describe.rs index 1a3bc89..fa23963 100644 --- a/src/command/deployments/describe.rs +++ b/src/command/deployments/describe.rs @@ -71,6 +71,7 @@ impl DescribeArgs { println!(" World: {}", config.world); println!(" RPC: {}", config.rpc); println!(" Start Block: {}", config.start_block); + println!(" Indexing Pending: {}", config.index_pending); println!("\nEndpoints:"); println!(" GraphQL: {}", config.graphql); println!(" GRPC: {}", config.grpc); diff --git a/src/command/deployments/services/torii.rs b/src/command/deployments/services/torii.rs index 228729c..0b1d397 100644 --- a/src/command/deployments/services/torii.rs +++ b/src/command/deployments/services/torii.rs @@ -21,6 +21,10 @@ pub struct ToriiCreateArgs { #[arg(short, long)] #[arg(help = "Specify a block to start indexing from.")] pub start_block: i64, + + #[arg(long)] + #[arg(help = "Enable indexing pending blocks.")] + pub index_pending: bool, } #[derive(Clone, Debug, Args, serde::Serialize)] diff --git a/src/command/deployments/update.graphql b/src/command/deployments/update.graphql index 329bd38..444ebae 100644 --- a/src/command/deployments/update.graphql +++ b/src/command/deployments/update.graphql @@ -20,6 +20,7 @@ mutation UpdateDeployment( rpc world startBlock + indexPending } # TODO: handle update } diff --git a/src/command/deployments/update.rs b/src/command/deployments/update.rs index 0e56da8..3b6879d 100644 --- a/src/command/deployments/update.rs +++ b/src/command/deployments/update.rs @@ -99,6 +99,7 @@ impl UpdateArgs { println!(" World: {}", config.world); println!(" RPC: {}", config.rpc); println!(" Start Block: {}", config.start_block); + println!(" Index Pending: {}", config.index_pending); println!("\nEndpoints:"); println!(" GRAPHQL: {}", config.graphql); println!(" GRPC: {}", config.grpc); From a61030a24e354b68cc22c6b86987cee5aa554d31 Mon Sep 17 00:00:00 2001 From: glihm Date: Thu, 2 May 2024 15:38:29 -0600 Subject: [PATCH 2/2] fix: add missing index pending print in create --- src/command/deployments/create.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/command/deployments/create.rs b/src/command/deployments/create.rs index 333771f..3c9099b 100644 --- a/src/command/deployments/create.rs +++ b/src/command/deployments/create.rs @@ -126,6 +126,7 @@ impl CreateArgs { println!(" World: {}", config.world); println!(" RPC: {}", config.rpc); println!(" Start Block: {}", config.start_block); + println!(" Index Pending: {}", config.index_pending); println!("\nEndpoints:"); println!(" GRAPHQL: {}", config.graphql); println!(" GRPC: {}", config.grpc);