Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rework torii CLI to be similar to katana #2674

Merged
merged 1 commit into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion bin/katana/src/cli/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,24 @@
/// HTTP-RPC server listening interface.
#[arg(long = "http.addr", value_name = "ADDRESS")]
#[arg(default_value_t = DEFAULT_RPC_ADDR)]
#[serde(default = "default_http_addr")]
pub http_addr: IpAddr,

/// HTTP-RPC server listening port.
#[arg(long = "http.port", value_name = "PORT")]
#[arg(default_value_t = DEFAULT_RPC_PORT)]
#[serde(default = "default_http_port")]
pub http_port: u16,

/// Comma separated list of domains from which to accept cross origin requests.
#[arg(long = "http.corsdomain")]
#[arg(long = "http.cors_origins")]
#[arg(value_delimiter = ',')]
pub http_cors_origins: Option<Vec<String>>,

/// Maximum number of concurrent connections allowed.
#[arg(long = "rpc.max-connections", value_name = "COUNT")]
#[arg(default_value_t = DEFAULT_RPC_MAX_CONNECTIONS)]
#[serde(default = "default_max_connections")]
pub max_connections: u32,
}

Expand Down Expand Up @@ -272,3 +275,15 @@
fn default_invoke_max_steps() -> u32 {
DEFAULT_INVOCATION_MAX_STEPS
}

fn default_http_addr() -> IpAddr {
DEFAULT_RPC_ADDR
}

Check warning on line 281 in bin/katana/src/cli/options.rs

View check run for this annotation

Codecov / codecov/patch

bin/katana/src/cli/options.rs#L279-L281

Added lines #L279 - L281 were not covered by tests

fn default_http_port() -> u16 {
DEFAULT_RPC_PORT
}

Check warning on line 285 in bin/katana/src/cli/options.rs

View check run for this annotation

Codecov / codecov/patch

bin/katana/src/cli/options.rs#L283-L285

Added lines #L283 - L285 were not covered by tests

fn default_max_connections() -> u32 {
DEFAULT_RPC_MAX_CONNECTIONS
}

Check warning on line 289 in bin/katana/src/cli/options.rs

View check run for this annotation

Codecov / codecov/patch

bin/katana/src/cli/options.rs#L287-L289

Added lines #L287 - L289 were not covered by tests
1 change: 1 addition & 0 deletions bin/torii/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ tempfile.workspace = true
clap_config = "0.1.1"

[dev-dependencies]
assert_matches.workspace = true
camino.workspace = true

[features]
Expand Down
Loading
Loading