Expand beacon_chain_sim

This commit is contained in:
Paul Hauner
2019-11-20 14:40:28 +11:00
parent 90d63a46c7
commit 40a0bd0544
9 changed files with 181 additions and 24 deletions

View File

@@ -25,6 +25,7 @@ pub struct Client<T: BeaconChainTypes> {
libp2p_network: Option<Arc<NetworkService<T>>>,
http_listen_addr: Option<SocketAddr>,
websocket_listen_addr: Option<SocketAddr>,
grpc_listen_addr: Option<(String, u16)>,
/// Exit signals will "fire" when dropped, causing each service to exit gracefully.
_exit_signals: Vec<Signal>,
}
@@ -40,6 +41,11 @@ impl<T: BeaconChainTypes> Client<T> {
self.http_listen_addr
}
/// Returns the address of the client's gRPC API server, if it was started.
pub fn grpc_listen_addr(&self) -> Option<(String, u16)> {
self.grpc_listen_addr.clone()
}
/// Returns the address of the client's WebSocket API server, if it was started.
pub fn websocket_listen_addr(&self) -> Option<SocketAddr> {
self.websocket_listen_addr