Skip to content

Commit

Permalink
chore: rename and add comments to server-running function
Browse files Browse the repository at this point in the history
commit-id:13175e29
  • Loading branch information
Itay-Tsabary-Starkware committed Jul 10, 2024
1 parent 09efafe commit a15bbd8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions crates/mempool_node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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(())
}
7 changes: 4 additions & 3 deletions crates/mempool_node/src/servers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit a15bbd8

Please sign in to comment.