Skip to content

Commit

Permalink
fix: make gRPC server print its bound address
Browse files Browse the repository at this point in the history
It would previously print its config address
  • Loading branch information
huitseeker committed May 31, 2022
1 parent 384be6f commit 8befa76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion narwhal/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ impl Parameters {
.as_millis()
);
info!(
"Consensus API gRPC Server listening on {}",
"Consensus API gRPC Server set to listen on on {}",
self.consensus_api_grpc.socket_addr
);
info!(
Expand Down
10 changes: 6 additions & 4 deletions narwhal/primary/src/grpc_server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crypto::traits::VerifyingKey;
use multiaddr::Multiaddr;
use std::{sync::Arc, time::Duration};
use tokio::sync::mpsc::Sender;
use tracing::error;
use tracing::{error, info};
use types::{ConfigurationServer, ProposerServer, ValidatorServer};

mod configuration;
Expand Down Expand Up @@ -78,15 +78,17 @@ impl<PublicKey: VerifyingKey, SynchronizerHandler: Handler<PublicKey> + Send + S
let narwhal_configuration = NarwhalConfiguration::new();

let config = mysten_network::config::Config::default();
config
let server = config
.server_builder()
.add_service(ValidatorServer::new(narwhal_validator))
.add_service(ConfigurationServer::new(narwhal_configuration))
.add_service(ProposerServer::new(narwhal_proposer))
.bind(&self.socket_addr)
.await?
.serve()
.await?;
let local_addr = server.local_addr();
info!("Consensus API gRPC Server listening on {local_addr}");

server.serve().await?;

Ok(())
}
Expand Down

0 comments on commit 8befa76

Please sign in to comment.