diff --git a/core/lib/protobuf_config/src/consensus.rs b/core/lib/protobuf_config/src/consensus.rs index a5b552dffc4..5551be1b55e 100644 --- a/core/lib/protobuf_config/src/consensus.rs +++ b/core/lib/protobuf_config/src/consensus.rs @@ -171,6 +171,9 @@ impl ProtoRepr for proto::Config { .context("gossip_static_outbound")?, genesis_spec: read_optional_repr(&self.genesis_spec), rpc: read_optional_repr(&self.rpc_config), + debug_page_addr: required(&self.debug_page_addr) + .and_then(|x| Ok(x.parse()?)) + .context("debug_page_addr")?, }) } @@ -195,6 +198,7 @@ impl ProtoRepr for proto::Config { .collect(), genesis_spec: this.genesis_spec.as_ref().map(ProtoRepr::build), rpc_config: this.rpc.as_ref().map(ProtoRepr::build), + debug_page_addr: Some(this.debug_page_addr.to_string()), } } } diff --git a/core/lib/protobuf_config/src/proto/core/consensus.proto b/core/lib/protobuf_config/src/proto/core/consensus.proto index 6cabc45fc12..92527df739a 100644 --- a/core/lib/protobuf_config/src/proto/core/consensus.proto +++ b/core/lib/protobuf_config/src/proto/core/consensus.proto @@ -103,5 +103,9 @@ message Config { // RPC rate limits configuration. // If missing, defaults are used. optional RpcConfig rpc_config = 9; // optional + + // IP:port to expose the debug page. + // Use `127.0.0.1:` to only allow local access to the page. + optional string debug_page_addr = 11; // required; IpAddr } diff --git a/core/node/consensus/src/testonly.rs b/core/node/consensus/src/testonly.rs index 72eeb2cc7fb..cfe38942bfe 100644 --- a/core/node/consensus/src/testonly.rs +++ b/core/node/consensus/src/testonly.rs @@ -156,7 +156,10 @@ fn make_config( config::ConsensusConfig { server_addr: *cfg.server_addr, public_addr: config::Host(cfg.public_addr.0.clone()), - debug_page_addr: std::net::SocketAddr::V4(()), + debug_page_addr: std::net::SocketAddr::new( + std::net::IpAddr::V4(std::net::Ipv4Addr::new(127, 0, 0, 1)), + 8080, + ), max_payload_size: usize::MAX, max_batch_size: usize::MAX, gossip_dynamic_inbound_limit: cfg.gossip.dynamic_inbound_limit,