aboutsummaryrefslogtreecommitdiff
path: root/examples/basalt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/basalt.rs')
-rw-r--r--examples/basalt.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/examples/basalt.rs b/examples/basalt.rs
index 85fbb58..752583d 100644
--- a/examples/basalt.rs
+++ b/examples/basalt.rs
@@ -1,5 +1,4 @@
use std::io::Write;
-use std::net::SocketAddr;
use std::sync::Arc;
use std::time::Duration;
@@ -17,6 +16,7 @@ use tokio::sync::watch;
use netapp::endpoint::*;
use netapp::peering::basalt::*;
use netapp::proto::*;
+use netapp::util::parse_peer_addr;
use netapp::{NetApp, NodeID};
#[derive(StructOpt, Debug)]
@@ -98,12 +98,7 @@ async fn main() {
let mut bootstrap_peers = vec![];
for peer in opt.bootstrap_peers.iter() {
- if let Some(delim) = peer.find('@') {
- let (key, ip) = peer.split_at(delim);
- let pubkey = ed25519::PublicKey::from_slice(&hex::decode(&key).unwrap()).unwrap();
- let ip = ip[1..].parse::<SocketAddr>().unwrap();
- bootstrap_peers.push((pubkey, ip));
- }
+ bootstrap_peers.push(parse_peer_addr(peer).expect("Invalid peer address"));
}
let basalt_params = BasaltParams {