From a15bbd82490b95af40456102a0988342bdb91124 Mon Sep 17 00:00:00 2001 From: Itay Tsabary Date: Wed, 10 Jul 2024 09:54:18 +0300 Subject: [PATCH] chore: rename and add comments to server-running function commit-id:13175e29 --- crates/mempool_node/src/main.rs | 4 ++-- crates/mempool_node/src/servers.rs | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/mempool_node/src/main.rs b/crates/mempool_node/src/main.rs index 2126e0c1..f54e926b 100644 --- a/crates/mempool_node/src/main.rs +++ b/crates/mempool_node/src/main.rs @@ -7,7 +7,7 @@ use starknet_mempool_infra::trace_util::configure_tracing; use starknet_mempool_node::communication::{create_node_channels, create_node_clients}; use starknet_mempool_node::components::create_components; use starknet_mempool_node::config::MempoolNodeConfig; -use starknet_mempool_node::servers::{create_servers, run_server_components}; +use starknet_mempool_node::servers::{create_servers, run_component_servers}; use tracing::{error, info}; #[tokio::main] @@ -31,7 +31,7 @@ async fn main() -> anyhow::Result<()> { let servers = create_servers(&config, &mut channels, components); info!("Starting components!"); - run_server_components(&config, servers).await?; + run_component_servers(&config, servers).await?; Ok(()) } diff --git a/crates/mempool_node/src/servers.rs b/crates/mempool_node/src/servers.rs index 19ac7cea..647dd95b 100644 --- a/crates/mempool_node/src/servers.rs +++ b/crates/mempool_node/src/servers.rs @@ -41,18 +41,19 @@ pub fn create_servers( Servers { gateway: gateway_server, mempool: mempool_server } } -pub async fn run_server_components( +pub async fn run_component_servers( config: &MempoolNodeConfig, servers: Servers, ) -> anyhow::Result<()> { - // Gateway component. + // Gateway server. let gateway_future = get_server_future("Gateway", config.components.gateway.execute, servers.gateway); - // Mempool component. + // Mempool server. let mempool_future = get_server_future("Mempool", config.components.mempool.execute, servers.mempool); + // Start servers. let gateway_handle = tokio::spawn(gateway_future); let mempool_handle = tokio::spawn(mempool_future);