Make gRPC and HTTP on by default

This commit is contained in:
Paul Hauner
2019-09-01 19:33:21 +10:00
parent 543e9457b7
commit fa6ba51eb7
4 changed files with 18 additions and 15 deletions

View File

@@ -16,7 +16,7 @@ pub struct Config {
impl Default for Config {
fn default() -> Self {
Config {
enabled: false, // rpc disabled by default
enabled: true,
listen_address: Ipv4Addr::new(127, 0, 0, 1),
port: 5051,
}
@@ -25,8 +25,8 @@ impl Default for Config {
impl Config {
pub fn apply_cli_args(&mut self, args: &ArgMatches) -> Result<(), &'static str> {
if args.is_present("rpc") {
self.enabled = true;
if args.is_present("no-grpc") {
self.enabled = false;
}
if let Some(rpc_address) = args.value_of("rpc-address") {

View File

@@ -80,7 +80,12 @@ pub fn start_server<T: BeaconChainTypes + Clone + 'static>(
let spawn_rpc = {
server.start();
for &(ref host, port) in server.bind_addrs() {
info!(log, "gRPC listening on {}:{}", host, port);
info!(
log,
"gRPC API started";
"port" => port,
"host" => host,
);
}
rpc_exit.and_then(move |_| {
info!(log, "RPC Server shutting down");