Skip to content

Commit

Permalink
remove intermediary types, update effected tests, add ipc start
Browse files Browse the repository at this point in the history
  • Loading branch information
smatthewenglish committed Jul 8, 2024
1 parent 6e4bc4f commit f841384
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 297 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -535,4 +535,4 @@ proptest-derive = "0.5"
serial_test = "3"
similar-asserts = "1.5.0"
test-fuzz = "5"
iai-callgrind = "0.11"
iai-callgrind = "0.11.1"
29 changes: 14 additions & 15 deletions crates/node/builder/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,19 +288,19 @@ where

extend_rpc_modules.extend_rpc_modules(ctx)?;

let server_config = config.rpc.rpc_server_config();
let launch_rpc = modules.clone().start_server(server_config).map_ok(|handle| {
if let Some(path) = handle.ipc_endpoint() {
info!(target: "reth::cli", %path, "RPC IPC server started");
}
if let Some(addr) = handle.http_local_addr() {
info!(target: "reth::cli", url=%addr, "RPC HTTP server started");
}
if let Some(addr) = handle.ws_local_addr() {
info!(target: "reth::cli", url=%addr, "RPC WS server started");
}
handle
});
let mut server_config = config.rpc.rpc_server_config();
let cloned_modules = modules.clone();
let launch_rpc = server_config.start(&cloned_modules).await?;

if let Some(path) = launch_rpc.ipc_endpoint() {
info!(target: "reth::cli", %path, "RPC IPC server started");
}
if let Some(addr) = launch_rpc.http_local_addr() {
info!(target: "reth::cli", url=%addr, "RPC HTTP server started");
}
if let Some(addr) = launch_rpc.ws_local_addr() {
info!(target: "reth::cli", url=%addr, "RPC WS server started");
}

let launch_auth = auth_module.clone().start_server(auth_config).map_ok(|handle| {
let addr = handle.local_addr();
Expand All @@ -313,8 +313,7 @@ where
});

// launch servers concurrently
let (rpc, auth) = futures::future::try_join(launch_rpc, launch_auth).await?;
let handles = RethRpcServerHandles { rpc, auth };
let handles = RethRpcServerHandles { rpc: launch_rpc, auth: launch_auth.await? };

let ctx = RpcContext {
node,
Expand Down
Loading

0 comments on commit f841384

Please sign in to comment.