mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 19:17:58 +00:00
Adding optional public addresses for proxying (#5807)
* Adding optional public addresses for use in network configurations to allow for proxies in front of a node. * Apply suggestions from code review Co-Authored-By: Cecile Tonglet <cecile.tonglet@cecton.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Cecile Tonglet <cecile.tonglet@cecton.com> Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
@@ -41,6 +41,11 @@ pub struct NetworkParams {
|
||||
#[structopt(long = "reserved-only")]
|
||||
pub reserved_only: bool,
|
||||
|
||||
/// The public address that other nodes will use to connect to it.
|
||||
/// This can be used if there's a proxy in front of this node.
|
||||
#[structopt(long, value_name = "PUBLIC_ADDR")]
|
||||
pub public_addr: Vec<Multiaddr>,
|
||||
|
||||
/// Listen on this multiaddress.
|
||||
#[structopt(long = "listen-addr", value_name = "LISTEN_ADDR")]
|
||||
pub listen_addr: Vec<Multiaddr>,
|
||||
@@ -125,6 +130,8 @@ impl NetworkParams {
|
||||
self.listen_addr.clone()
|
||||
};
|
||||
|
||||
let public_addresses = self.public_addr.clone();
|
||||
|
||||
let mut boot_nodes = chain_spec.boot_nodes().to_vec();
|
||||
boot_nodes.extend(self.bootnodes.clone());
|
||||
|
||||
@@ -138,7 +145,7 @@ impl NetworkParams {
|
||||
NonReservedPeerMode::Accept
|
||||
},
|
||||
listen_addresses,
|
||||
public_addresses: Vec::new(),
|
||||
public_addresses,
|
||||
notifications_protocols: Vec::new(),
|
||||
node_key,
|
||||
node_name: node_name.to_string(),
|
||||
|
||||
Reference in New Issue
Block a user