Преглед изворни кода

darkfid2, faucetd: using Url for net settings

ghassmo пре 4 година
родитељ
комит
475b31c5fb
3 измењених фајлова са 15 додато и 15 уклоњено
  1. 9 9
      bin/darkfid2/src/main.rs
  2. 5 5
      bin/faucetd/src/main.rs
  3. 1 1
      bin/tau/taud/src/main.rs

+ 9 - 9
bin/darkfid2/src/main.rs

@@ -1,4 +1,4 @@
-use std::{net::SocketAddr, str::FromStr};
+use std::str::FromStr;
 
 
 use async_executor::Executor;
 use async_executor::Executor;
 use async_std::sync::{Arc, Mutex};
 use async_std::sync::{Arc, Mutex};
@@ -86,11 +86,11 @@ struct Args {
 
 
     #[structopt(long)]
     #[structopt(long)]
     /// P2P accept address for the consensus protocol
     /// P2P accept address for the consensus protocol
-    consensus_p2p_accept: Option<SocketAddr>,
+    consensus_p2p_accept: Option<Url>,
 
 
     #[structopt(long)]
     #[structopt(long)]
     /// P2P external address for the consensus protocol
     /// P2P external address for the consensus protocol
-    consensus_p2p_external: Option<SocketAddr>,
+    consensus_p2p_external: Option<Url>,
 
 
     #[structopt(long, default_value = "8")]
     #[structopt(long, default_value = "8")]
     /// Connection slots for the consensus protocol
     /// Connection slots for the consensus protocol
@@ -98,19 +98,19 @@ struct Args {
 
 
     #[structopt(long)]
     #[structopt(long)]
     /// Connect to peer for the consensus protocol (repeatable flag)
     /// Connect to peer for the consensus protocol (repeatable flag)
-    consensus_p2p_peer: Vec<SocketAddr>,
+    consensus_p2p_peer: Vec<Url>,
 
 
     #[structopt(long)]
     #[structopt(long)]
     /// Connect to seed for the consensus protocol (repeatable flag)
     /// Connect to seed for the consensus protocol (repeatable flag)
-    consensus_p2p_seed: Vec<SocketAddr>,
+    consensus_p2p_seed: Vec<Url>,
 
 
     #[structopt(long)]
     #[structopt(long)]
     /// P2P accept address for the syncing protocol
     /// P2P accept address for the syncing protocol
-    sync_p2p_accept: Option<SocketAddr>,
+    sync_p2p_accept: Option<Url>,
 
 
     #[structopt(long)]
     #[structopt(long)]
     /// P2P external address for the syncing protocol
     /// P2P external address for the syncing protocol
-    sync_p2p_external: Option<SocketAddr>,
+    sync_p2p_external: Option<Url>,
 
 
     #[structopt(long, default_value = "8")]
     #[structopt(long, default_value = "8")]
     /// Connection slots for the syncing protocol
     /// Connection slots for the syncing protocol
@@ -118,11 +118,11 @@ struct Args {
 
 
     #[structopt(long)]
     #[structopt(long)]
     /// Connect to peer for the syncing protocol (repeatable flag)
     /// Connect to peer for the syncing protocol (repeatable flag)
-    sync_p2p_peer: Vec<SocketAddr>,
+    sync_p2p_peer: Vec<Url>,
 
 
     #[structopt(long)]
     #[structopt(long)]
     /// Connect to seed for the syncing protocol (repeatable flag)
     /// Connect to seed for the syncing protocol (repeatable flag)
-    sync_p2p_seed: Vec<SocketAddr>,
+    sync_p2p_seed: Vec<Url>,
 
 
     #[structopt(long)]
     #[structopt(long)]
     /// Whitelisted cashier address (repeatable flag)
     /// Whitelisted cashier address (repeatable flag)

+ 5 - 5
bin/faucetd/src/main.rs

@@ -1,4 +1,4 @@
-use std::{collections::HashMap, net::SocketAddr, str::FromStr};
+use std::{collections::HashMap, str::FromStr};
 
 
 use async_executor::Executor;
 use async_executor::Executor;
 use async_std::sync::{Arc, Mutex};
 use async_std::sync::{Arc, Mutex};
@@ -82,11 +82,11 @@ struct Args {
 
 
     #[structopt(long)]
     #[structopt(long)]
     /// P2P accept address for the syncing protocol
     /// P2P accept address for the syncing protocol
-    sync_p2p_accept: Option<SocketAddr>,
+    sync_p2p_accept: Option<Url>,
 
 
     #[structopt(long)]
     #[structopt(long)]
     /// P2P external address for the syncing protocol
     /// P2P external address for the syncing protocol
-    sync_p2p_external: Option<SocketAddr>,
+    sync_p2p_external: Option<Url>,
 
 
     #[structopt(long, default_value = "8")]
     #[structopt(long, default_value = "8")]
     /// Connection slots for the syncing protocol
     /// Connection slots for the syncing protocol
@@ -94,11 +94,11 @@ struct Args {
 
 
     #[structopt(long)]
     #[structopt(long)]
     /// Connect to seed for the syncing protocol (repeatable flag)
     /// Connect to seed for the syncing protocol (repeatable flag)
-    sync_p2p_seed: Vec<SocketAddr>,
+    sync_p2p_seed: Vec<Url>,
 
 
     #[structopt(long)]
     #[structopt(long)]
     /// Connect to peer for the syncing protocol (repeatable flag)
     /// Connect to peer for the syncing protocol (repeatable flag)
-    sync_p2p_peer: Vec<SocketAddr>,
+    sync_p2p_peer: Vec<Url>,
 
 
     #[structopt(long)]
     #[structopt(long)]
     /// Whitelisted cashier address (repeatable flag)
     /// Whitelisted cashier address (repeatable flag)

+ 1 - 1
bin/tau/taud/src/main.rs

@@ -147,7 +147,7 @@ async fn realmain(settings: Args, executor: Arc<Executor<'_>>) -> Result<()> {
     //Raft
     //Raft
     //
     //
     let datastore_raft = datastore_path.join("tau.db");
     let datastore_raft = datastore_path.join("tau.db");
-    let mut raft = Raft::<EncryptedTask>::new(net_settings.inbound, datastore_raft)?;
+    let mut raft = Raft::<EncryptedTask>::new(net_settings.inbound.clone(), datastore_raft)?;
 
 
     let raft_sender = raft.get_broadcast();
     let raft_sender = raft.get_broadcast();
     let commits = raft.get_commits();
     let commits = raft.get_commits();