From 4ad318d973ff486ceffbd8dd548b279e2a1f5925 Mon Sep 17 00:00:00 2001 From: broody Date: Wed, 30 Oct 2024 11:18:40 -1000 Subject: [PATCH] Update torii params --- cli/src/command/deployments/create.rs | 22 +- cli/src/command/deployments/describe.rs | 20 +- cli/src/command/deployments/services/torii.rs | 15 ++ slot/schema.json | 254 +++++++++++++++++- slot/src/graphql/deployments/create.graphql | 3 + slot/src/graphql/deployments/describe.graphql | 3 + 6 files changed, 302 insertions(+), 15 deletions(-) diff --git a/cli/src/command/deployments/create.rs b/cli/src/command/deployments/create.rs index 6d0fec7..ff4fbf3 100644 --- a/cli/src/command/deployments/create.rs +++ b/cli/src/command/deployments/create.rs @@ -69,9 +69,12 @@ impl CreateArgs { torii: Some(CreateToriiConfigInput { rpc: Some(config.rpc.clone().unwrap_or("".to_string())), world: format!("{:#x}", config.world), - start_block: Some(config.start_block.unwrap_or(0)), + contracts: config.contracts.clone(), + start_block: config.start_block, index_pending: config.index_pending, polling_interval: config.polling_interval, + index_transactions: config.index_transactions, + index_raw_events: config.index_raw_events, }), saya: None, }), @@ -132,8 +135,21 @@ impl CreateArgs { println!("\nConfiguration:"); println!(" World: {}", config.world); println!(" RPC: {}", config.rpc); - println!(" Start Block: {}", config.start_block.unwrap_or(0)); - println!(" Index Pending: {}", config.index_pending.unwrap_or(false)); + if let Some(contracts) = config.contracts { + println!(" Contracts: {}", contracts); + } + if let Some(start_block) = config.start_block { + println!(" Start Block: {}", start_block); + } + if let Some(index_pending) = config.index_pending { + println!(" Index Pending: {}", index_pending); + } + if let Some(index_raw_events) = config.index_raw_events { + println!(" Index Raw Events: {}", index_raw_events); + } + if let Some(index_transactions) = config.index_transactions { + println!(" Index Transactions: {}", index_transactions); + } println!("\nEndpoints:"); println!(" GRAPHQL: {}", config.graphql); println!(" GRPC: {}", config.grpc); diff --git a/cli/src/command/deployments/describe.rs b/cli/src/command/deployments/describe.rs index 39e77fa..098330d 100644 --- a/cli/src/command/deployments/describe.rs +++ b/cli/src/command/deployments/describe.rs @@ -52,11 +52,21 @@ impl DescribeArgs { println!(" Version: {}", config.version); println!(" World: {}", config.world); println!(" RPC: {}", config.rpc); - println!(" Start Block: {}", config.start_block.unwrap_or(0)); - println!( - " Indexing Pending: {}", - config.index_pending.unwrap_or(false) - ); + if let Some(contracts) = config.contracts { + println!(" Contracts: {}", contracts); + } + if let Some(start_block) = config.start_block { + println!(" Start Block: {}", start_block); + } + if let Some(index_pending) = config.index_pending { + println!(" Index Pending: {}", index_pending); + } + if let Some(index_raw_events) = config.index_raw_events { + println!(" Index Raw Events: {}", index_raw_events); + } + if let Some(index_transactions) = config.index_transactions { + println!(" Index Transactions: {}", index_transactions); + } println!("\nEndpoints:"); println!(" GraphQL: {}", config.graphql); println!(" GRPC: {}", config.grpc); diff --git a/cli/src/command/deployments/services/torii.rs b/cli/src/command/deployments/services/torii.rs index 2494ba4..6414e16 100644 --- a/cli/src/command/deployments/services/torii.rs +++ b/cli/src/command/deployments/services/torii.rs @@ -18,6 +18,11 @@ pub struct ToriiCreateArgs { #[arg(help = "World address.")] pub world: Felt, + #[arg(short, long)] + #[arg(value_name = "contracts")] + #[arg(help = "Contract addresses to index")] + pub contracts: Option, + #[arg(short, long)] #[arg(help = "Specify a block to start indexing from.")] pub start_block: Option, @@ -29,6 +34,16 @@ pub struct ToriiCreateArgs { #[arg(long)] #[arg(help = "Polling interval in milliseconds.")] pub polling_interval: Option, + + #[arg(long)] + #[arg(value_name = "index_transactions")] + #[arg(help = "Whether or not to index world transactions")] + pub index_transactions: Option, + + #[arg(long)] + #[arg(value_name = "index_raw_events")] + #[arg(help = "Whether or not to index raw events")] + pub index_raw_events: Option, } #[derive(Clone, Debug, Args, serde::Serialize)] diff --git a/slot/schema.json b/slot/schema.json index c362451..85bf6ce 100644 --- a/slot/schema.json +++ b/slot/schema.json @@ -263,6 +263,22 @@ "ofType": null } }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "username", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, { "args": [], "deprecationReason": null, @@ -1455,6 +1471,152 @@ "ofType": null } }, + { + "defaultValue": null, + "description": "username field predicates", + "name": "username", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "defaultValue": null, + "description": null, + "name": "usernameNEQ", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "defaultValue": null, + "description": null, + "name": "usernameIn", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + }, + { + "defaultValue": null, + "description": null, + "name": "usernameNotIn", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + }, + { + "defaultValue": null, + "description": null, + "name": "usernameGT", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "defaultValue": null, + "description": null, + "name": "usernameGTE", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "defaultValue": null, + "description": null, + "name": "usernameLT", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "defaultValue": null, + "description": null, + "name": "usernameLTE", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "defaultValue": null, + "description": null, + "name": "usernameContains", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "defaultValue": null, + "description": null, + "name": "usernameHasPrefix", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "defaultValue": null, + "description": null, + "name": "usernameHasSuffix", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "defaultValue": null, + "description": null, + "name": "usernameEqualFold", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + { + "defaultValue": null, + "description": null, + "name": "usernameContainsFold", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, { "defaultValue": null, "description": "created_at field predicates", @@ -3362,6 +3524,16 @@ } } }, + { + "defaultValue": null, + "description": null, + "name": "contracts", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, { "defaultValue": null, "description": null, @@ -3391,6 +3563,26 @@ "name": "Long", "ofType": null } + }, + { + "defaultValue": null, + "description": null, + "name": "indexTransactions", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + { + "defaultValue": null, + "description": null, + "name": "indexRawEvents", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } } ], "interfaces": [], @@ -5770,6 +5962,12 @@ "description": null, "isDeprecated": false, "name": "legendary" + }, + { + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "insane" } ], "fields": [], @@ -9687,13 +9885,19 @@ "description": null, "name": "id", "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + { + "defaultValue": null, + "description": null, + "name": "username", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null } } ], @@ -14250,6 +14454,18 @@ } } }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "contracts", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, { "args": [], "deprecationReason": null, @@ -14285,6 +14501,30 @@ "name": "Long", "ofType": null } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "indexTransactions", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + { + "args": [], + "deprecationReason": null, + "description": null, + "isDeprecated": false, + "name": "indexRawEvents", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } } ], "inputFields": [], diff --git a/slot/src/graphql/deployments/create.graphql b/slot/src/graphql/deployments/create.graphql index 28a445c..415f24b 100644 --- a/slot/src/graphql/deployments/create.graphql +++ b/slot/src/graphql/deployments/create.graphql @@ -23,8 +23,11 @@ mutation CreateDeployment( grpc rpc world + contracts startBlock indexPending + indexRawEvents + indexTransactions } ... on SayaConfig { diff --git a/slot/src/graphql/deployments/describe.graphql b/slot/src/graphql/deployments/describe.graphql index 5c6b8cd..eb1c2f1 100644 --- a/slot/src/graphql/deployments/describe.graphql +++ b/slot/src/graphql/deployments/describe.graphql @@ -17,8 +17,11 @@ query DescribeDeployment($project: String!, $service: DeploymentService!) { grpc rpc world + contracts startBlock indexPending + indexRawEvents + indexTransactions } ... on SayaConfig {