aboutsummaryrefslogtreecommitdiff
path: root/examples/basalt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/basalt.rs')
-rw-r--r--examples/basalt.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/basalt.rs b/examples/basalt.rs
index eaf056b..e1ac2e4 100644
--- a/examples/basalt.rs
+++ b/examples/basalt.rs
@@ -31,6 +31,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>,
+
#[structopt(long = "view-size", short = "v", default_value = "100")]
view_size: usize,
@@ -83,7 +86,8 @@ async fn main() {
info!("KYEV PK {}", 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() {