aboutsummaryrefslogtreecommitdiff
path: root/examples/fullmesh.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-10-13 12:33:14 +0200
committerAlex Auvolat <alex@adnab.me>2021-10-13 12:33:14 +0200
commit8dede69dee20b812ad1dcab5b374c60232409f4f (patch)
tree0b9ae54f27b4fb7bd6cfd09e1d78a70facf01a33 /examples/fullmesh.rs
parentd9bd1182f7b980df8e631ae8eeca444f5d997909 (diff)
downloadnetapp-8dede69dee20b812ad1dcab5b374c60232409f4f.tar.gz
netapp-8dede69dee20b812ad1dcab5b374c60232409f4f.zip
Fix netapp protocol & adapt basalt to new api
Diffstat (limited to 'examples/fullmesh.rs')
-rw-r--r--examples/fullmesh.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/examples/fullmesh.rs b/examples/fullmesh.rs
index acc0a7b..f40591a 100644
--- a/examples/fullmesh.rs
+++ b/examples/fullmesh.rs
@@ -66,7 +66,7 @@ async fn main() {
info!("Node private key: {}", hex::encode(&privkey));
info!("Node public key: {}", hex::encode(&privkey.public_key()));
- let netapp = NetApp::new(netid, privkey);
+ let netapp = NetApp::new(netid.clone(), privkey.clone());
let mut bootstrap_peers = vec![];
for peer in opt.bootstrap_peers.iter() {
@@ -81,6 +81,12 @@ async fn main() {
let peering = FullMeshPeeringStrategy::new(netapp.clone(), bootstrap_peers);
let listen_addr = opt.listen_addr.parse().unwrap();
+
+ info!("Add more peers to this mesh by running: fullmesh -n {} -l 127.0.0.1:$((1000 + $RANDOM)) -b {}@{}",
+ hex::encode(&netid),
+ hex::encode(&privkey.public_key()),
+ listen_addr);
+
let public_addr = opt.public_addr.map(|x| x.parse().unwrap());
tokio::join!(netapp.listen(listen_addr, public_addr), peering.run(),);
}