diff options
Diffstat (limited to 'examples/fullmesh.rs')
-rw-r--r-- | examples/fullmesh.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/fullmesh.rs b/examples/fullmesh.rs index 5addcea..88784c1 100644 --- a/examples/fullmesh.rs +++ b/examples/fullmesh.rs @@ -25,6 +25,9 @@ pub struct Opt { #[structopt(long = "listen-addr", short = "l", default_value = "127.0.0.1:1980")] listen_addr: String, + + #[structopt(long = "public-addr", short = "a")] + public_addr: Option<String>, } #[tokio::main] @@ -63,7 +66,8 @@ async fn main() { info!("Node public key: {}", hex::encode(&privkey.public_key())); let listen_addr = opt.listen_addr.parse().unwrap(); - let netapp = NetApp::new(listen_addr, netid, privkey); + let public_addr = opt.public_addr.map(|x| x.parse().unwrap()); + let netapp = NetApp::new(listen_addr, public_addr, netid, privkey); let mut bootstrap_peers = vec![]; for peer in opt.bootstrap_peers.iter() { |