Skip to content

Commit

Permalink
Update torii params
Browse files Browse the repository at this point in the history
  • Loading branch information
broody committed Oct 30, 2024
1 parent 260ba82 commit 4ad318d
Show file tree
Hide file tree
Showing 6 changed files with 302 additions and 15 deletions.
22 changes: 19 additions & 3 deletions cli/src/command/deployments/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
Expand Down Expand Up @@ -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);
Expand Down
20 changes: 15 additions & 5 deletions cli/src/command/deployments/describe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 15 additions & 0 deletions cli/src/command/deployments/services/torii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,

#[arg(short, long)]
#[arg(help = "Specify a block to start indexing from.")]
pub start_block: Option<u64>,
Expand All @@ -29,6 +34,16 @@ pub struct ToriiCreateArgs {
#[arg(long)]
#[arg(help = "Polling interval in milliseconds.")]
pub polling_interval: Option<u64>,

#[arg(long)]
#[arg(value_name = "index_transactions")]
#[arg(help = "Whether or not to index world transactions")]
pub index_transactions: Option<bool>,

#[arg(long)]
#[arg(value_name = "index_raw_events")]
#[arg(help = "Whether or not to index raw events")]
pub index_raw_events: Option<bool>,
}

#[derive(Clone, Debug, Args, serde::Serialize)]
Expand Down
Loading

0 comments on commit 4ad318d

Please sign in to comment.