diff --git a/sequencer/src/api/options.rs b/sequencer/src/api/options.rs index d4c336e50..d7ce499ce 100644 --- a/sequencer/src/api/options.rs +++ b/sequencer/src/api/options.rs @@ -503,7 +503,7 @@ impl Options { pub struct Http { /// Port that the HTTP API will use. #[clap(long, env = "ESPRESSO_SEQUENCER_API_PORT")] - pub(super) port: u16, + pub port: u16, /// Maximum number of concurrent HTTP connections the server will allow. /// @@ -511,7 +511,7 @@ pub struct Http { /// /// Leave unset for no connection limit. #[clap(long, env = "ESPRESSO_SEQUENCER_MAX_CONNECTIONS")] - pub(super) max_connections: Option, + pub max_connections: Option, } impl Http { @@ -522,10 +522,6 @@ impl Http { max_connections: None, } } - - pub fn port(&self) -> u16 { - self.port - } } /// Options for the submission API module. diff --git a/sequencer/src/bin/espresso-dev-node.rs b/sequencer/src/bin/espresso-dev-node.rs index d1e7b2b38..a7fb6253c 100644 --- a/sequencer/src/bin/espresso-dev-node.rs +++ b/sequencer/src/bin/espresso-dev-node.rs @@ -47,15 +47,20 @@ struct Args { )] account_index: u32, + /// Port that the HTTP API will use. + #[clap(long, env = "ESPRESSO_SEQUENCER_API_PORT")] + sequencer_api_port: u16, + + /// Maximum concurrent connections allowed by the HTTP API server. + #[clap(long, env = "ESPRESSO_SEQUENCER_MAX_CONNECTIONS")] + sequencer_api_max_connections: Option, + /// If provided, the service will run a basic HTTP server on the given port. /// /// The server provides healthcheck and version endpoints. #[clap(short, long, env = "ESPRESSO_COMMITMENT_TASK_PORT")] commitment_task_port: u16, - #[clap(flatten)] - http: options::Http, - #[clap(flatten)] sql: persistence::sql::Options, } @@ -66,11 +71,14 @@ async fn main() -> anyhow::Result<()> { setup_backtrace(); let opt = Args::parse(); - let options = options::Options::from(opt.http) - .status(Default::default()) - .state(Default::default()) - .submit(Default::default()) - .query_sql(Default::default(), opt.sql); + let options = options::Options::from(options::Http { + port: opt.sequencer_api_port, + max_connections: opt.sequencer_api_max_connections, + }) + .status(Default::default()) + .state(Default::default()) + .submit(Default::default()) + .query_sql(Default::default(), opt.sql); let (url, _anvil) = if let Some(url) = opt.rpc_url { (url, None) @@ -118,7 +126,7 @@ async fn main() -> anyhow::Result<()> { start_commitment_server(opt.commitment_task_port, hotshot_address, SEQUENCER_VERSION).unwrap(); let sequencer_url = - Url::parse(format!("http://localhost:{}", opt.http.port()).as_str()).unwrap(); + Url::parse(format!("http://localhost:{}", opt.sequencer_api_port).as_str()).unwrap(); let commitment_task_options = CommitmentTaskOptions { l1_provider: url, l1_chain_id: None,