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

chore: rename and add comments to server-running function #430

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
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
Loading