From d7ea66b6a138d7877e9836f1060c0ae6cf9b5c1a Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Tue, 6 Nov 2018 12:57:41 -0700 Subject: [PATCH] RPC and Pubsub, bind to 0.0.0.0 --- src/fullnode.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/fullnode.rs b/src/fullnode.rs index 9887e6e753..0cf1ae28d4 100644 --- a/src/fullnode.rs +++ b/src/fullnode.rs @@ -11,8 +11,8 @@ use rpc::JsonRpcService; use rpc_pubsub::PubSubService; use service::Service; use signature::{Keypair, KeypairUtil}; -use std::net::SocketAddr; use std::net::UdpSocket; +use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, RwLock}; use std::thread::Result; @@ -581,11 +581,20 @@ impl Fullnode { bank: &Arc, cluster_info: &Arc>, ) -> (JsonRpcService, PubSubService) { + let rpc_port = rpc_addr.port(); + let rpc_pubsub_port = rpc_pubsub_addr.port(); // TODO: The RPC service assumes that there is a drone running on the leader // Drone location/id will need to be handled a different way as soon as leader rotation begins ( - JsonRpcService::new(bank, cluster_info, rpc_addr), - PubSubService::new(bank, rpc_pubsub_addr), + JsonRpcService::new( + bank, + cluster_info, + SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), rpc_port), + ), + PubSubService::new( + bank, + SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), rpc_pubsub_port), + ), ) } }