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

Implement gateway RPC launch and piece getting #3148

Merged
merged 15 commits into from
Oct 22, 2024
Prev Previous commit
Next Next commit
Log RPC server address
  • Loading branch information
teor2345 committed Oct 21, 2024
commit 423d07d15f1bb6b2cd3c1026a1308aa5a9641bf3
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)
}