Listen on 0.0.0.0, not 127.0.0.1

Turns out when your node faces the internet directly, it has to listen
to those addresses directly.
This commit is contained in:
Deirdre Connolly 2020-06-19 01:44:59 -04:00 committed by Deirdre Connolly
parent e6d986a057
commit 05316dee21
6 changed files with 6 additions and 9 deletions

View File

@ -89,7 +89,7 @@ impl Default for Config {
.collect(); .collect();
Config { Config {
listen_addr: "127.0.0.1:8233" listen_addr: "0.0.0.0:8233"
.parse() .parse()
.expect("Hardcoded address should be parseable"), .expect("Hardcoded address should be parseable"),
user_agent: crate::constants::USER_AGENT.to_owned(), user_agent: crate::constants::USER_AGENT.to_owned(),

View File

@ -121,10 +121,7 @@ where
services: PeerServices::NODE_NETWORK, services: PeerServices::NODE_NETWORK,
timestamp: Utc::now(), timestamp: Utc::now(),
address_recv: (PeerServices::NODE_NETWORK, addr), address_recv: (PeerServices::NODE_NETWORK, addr),
address_from: ( address_from: (PeerServices::NODE_NETWORK, "0.0.0.0:9000".parse().unwrap()),
PeerServices::NODE_NETWORK,
"127.0.0.1:9000".parse().unwrap(),
),
nonce: local_nonce, nonce: local_nonce,
user_agent, user_agent,
// XXX eventually the `PeerConnector` will need to have a handle // XXX eventually the `PeerConnector` will need to have a handle

View File

@ -71,7 +71,7 @@ impl ConnectCmd {
let mut config = app_config().network.clone(); let mut config = app_config().network.clone();
// Use a different listen addr so that we don't conflict with another local node. // Use a different listen addr so that we don't conflict with another local node.
config.listen_addr = "127.0.0.1:38233".parse()?; config.listen_addr = "0.0.0.0:38233".parse()?;
// Connect only to the specified peer. // Connect only to the specified peer.
config.initial_mainnet_peers.insert(self.addr.to_string()); config.initial_mainnet_peers.insert(self.addr.to_string());

View File

@ -22,7 +22,7 @@ impl MetricsEndpoint {
info!("Initializing metrics endpoint"); info!("Initializing metrics endpoint");
// XXX load metrics addr from config // XXX load metrics addr from config
let addr = "127.0.0.1:9999" let addr = "0.0.0.0:9999"
.parse() .parse()
.expect("Hardcoded address should be parseable"); .expect("Hardcoded address should be parseable");

View File

@ -36,7 +36,7 @@ impl TracingEndpoint {
make_service_fn(|_| async { Ok::<_, hyper::Error>(service_fn(request_handler)) }); make_service_fn(|_| async { Ok::<_, hyper::Error>(service_fn(request_handler)) });
// XXX load tracing addr from config // XXX load tracing addr from config
let addr = "127.0.0.1:3000" let addr = "0.0.0.0:3000"
.parse() .parse()
.expect("Hardcoded address should be parseable"); .expect("Hardcoded address should be parseable");

View File

@ -52,7 +52,7 @@ pub struct MetricsSection {
impl Default for MetricsSection { impl Default for MetricsSection {
fn default() -> Self { fn default() -> Self {
Self { Self {
endpoint_addr: "127.0.0.1:9999".parse().unwrap(), endpoint_addr: "0.0.0.0:9999".parse().unwrap(),
} }
} }
} }