Skip to content

Commit

Permalink
Log RPC server address
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Oct 21, 2024
1 parent fa38758 commit 423d07d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/subspace-gateway/src/commands/run/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use clap::Parser;
use jsonrpsee::server::{ServerBuilder, ServerHandle};
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
use subspace_gateway_rpc::{SubspaceGatewayRpc, SubspaceGatewayRpcApiServer};
use tracing::info;

/// The default gateway RPC port.
pub const RPC_DEFAULT_PORT: u16 = 9955;
Expand Down Expand Up @@ -42,7 +43,10 @@ pub async fn launch_rpc_server<const P: u16>(
let server = ServerBuilder::default()
.build(rpc_options.rpc_listen_on)
.await?;
let addr = server.local_addr()?;
let server_handle = server.start(rpc_api.into_rpc());

info!(?addr, "Running JSON-RPC server");

Ok(server_handle)
}

0 comments on commit 423d07d

Please sign in to comment.