Skip to content

Commit bd8d050

Browse files
committed
slight rfk, fix refresh time
1 parent 9892359 commit bd8d050

File tree

3 files changed

+28
-48
lines changed

3 files changed

+28
-48
lines changed

compute/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ async fn wait_for_termination(cancellation: CancellationToken) -> Result<()> {
158158
Ok(())
159159
}
160160

161+
// #[deprecated]
161162
/// Very CRUDE fix due to launcher log level bug
162163
///
163164
/// TODO: remove me later when the launcher is fixed

compute/src/utils/available_nodes/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mod statics;
99
use crate::DriaNetworkType;
1010

1111
/// Number of seconds between refreshing the available nodes.
12-
const DEFAULT_REFRESH_INTERVAL_SECS: u64 = 5;
12+
const DEFAULT_REFRESH_INTERVAL_SECS: u64 = 25;
1313

1414
/// Available nodes within the hybrid P2P network.
1515
///

compute/src/utils/available_nodes/statics.rs

Lines changed: 26 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,46 @@
11
use crate::DriaNetworkType;
22
use dkn_p2p::libp2p::{Multiaddr, PeerId};
33

4-
/// Static bootstrap nodes for the Kademlia DHT bootstrap step.
5-
const STATIC_BOOTSTRAP_NODES: ([&str; 4], [&str; 0]) = (
6-
// community
7-
[
8-
"/ip4/44.206.245.139/tcp/4001/p2p/16Uiu2HAm4q3LZU2T9kgjKK4ysy6KZYKLq8KiXQyae4RHdF7uqSt4",
9-
"/ip4/18.234.39.91/tcp/4001/p2p/16Uiu2HAmJqegPzwuGKWzmb5m3RdSUJ7NhEGWB5jNCd3ca9zdQ9dU",
10-
"/ip4/54.242.44.217/tcp/4001/p2p/16Uiu2HAmR2sAoh9F8jT9AZup9y79Mi6NEFVUbwRvahqtWamfabkz",
11-
"/ip4/52.201.242.227/tcp/4001/p2p/16Uiu2HAmFEUCy1s1gjyHfc8jey4Wd9i5bSDnyFDbWTnbrF2J3KFb",
12-
],
13-
// pro
14-
[],
15-
);
16-
17-
/// Static relay nodes for the `P2pCircuit`.
18-
const STATIC_RELAY_NODES: ([&str; 4], [&str; 0]) = (
19-
// community
20-
[
21-
"/ip4/34.201.33.141/tcp/4001/p2p/16Uiu2HAkuXiV2CQkC9eJgU6cMnJ9SMARa85FZ6miTkvn5fuHNufa",
22-
"/ip4/18.232.93.227/tcp/4001/p2p/16Uiu2HAmHeGKhWkXTweHJTA97qwP81ww1W2ntGaebeZ25ikDhd4z",
23-
"/ip4/54.157.219.194/tcp/4001/p2p/16Uiu2HAm7A5QVSy5FwrXAJdNNsdfNAcaYahEavyjnFouaEi22dcq",
24-
"/ip4/54.88.171.104/tcp/4001/p2p/16Uiu2HAm5WP1J6bZC3aHxd7XCUumMt9txAystmbZSaMS2omHepXa",
25-
],
26-
// pro
27-
[],
28-
);
29-
30-
/// Static RPC Peer IDs for the Admin RPC.
31-
const STATIC_RPC_PEER_IDS: ([&str; 0], [&str; 0]) = (
32-
// community
33-
[],
34-
// pro
35-
[],
36-
);
37-
384
impl DriaNetworkType {
39-
// TODO: kind of smelly code here
5+
/// Static bootstrap nodes for Kademlia.
406
pub fn get_static_bootstrap_nodes(&self) -> Vec<Multiaddr> {
417
match self {
42-
DriaNetworkType::Community => STATIC_BOOTSTRAP_NODES.0.iter(),
43-
DriaNetworkType::Pro => STATIC_BOOTSTRAP_NODES.1.iter(),
8+
DriaNetworkType::Community => [
9+
"/ip4/44.206.245.139/tcp/4001/p2p/16Uiu2HAm4q3LZU2T9kgjKK4ysy6KZYKLq8KiXQyae4RHdF7uqSt4",
10+
"/ip4/18.234.39.91/tcp/4001/p2p/16Uiu2HAmJqegPzwuGKWzmb5m3RdSUJ7NhEGWB5jNCd3ca9zdQ9dU",
11+
"/ip4/54.242.44.217/tcp/4001/p2p/16Uiu2HAmR2sAoh9F8jT9AZup9y79Mi6NEFVUbwRvahqtWamfabkz",
12+
"/ip4/52.201.242.227/tcp/4001/p2p/16Uiu2HAmFEUCy1s1gjyHfc8jey4Wd9i5bSDnyFDbWTnbrF2J3KFb",
13+
].iter(),
14+
DriaNetworkType::Pro => [].iter(),
4415
}
45-
.filter_map(|s| s.parse().ok())
16+
.map(|s| s.parse().expect("could not parse static bootstrap address"))
4617
.collect()
4718
}
4819

20+
/// Static relay nodes for the `P2pCircuit`.
4921
pub fn get_static_relay_nodes(&self) -> Vec<Multiaddr> {
5022
match self {
51-
DriaNetworkType::Community => STATIC_RELAY_NODES.0.iter(),
52-
DriaNetworkType::Pro => STATIC_RELAY_NODES.1.iter(),
23+
DriaNetworkType::Community => [
24+
"/ip4/34.201.33.141/tcp/4001/p2p/16Uiu2HAkuXiV2CQkC9eJgU6cMnJ9SMARa85FZ6miTkvn5fuHNufa",
25+
"/ip4/18.232.93.227/tcp/4001/p2p/16Uiu2HAmHeGKhWkXTweHJTA97qwP81ww1W2ntGaebeZ25ikDhd4z",
26+
"/ip4/54.157.219.194/tcp/4001/p2p/16Uiu2HAm7A5QVSy5FwrXAJdNNsdfNAcaYahEavyjnFouaEi22dcq",
27+
"/ip4/54.88.171.104/tcp/4001/p2p/16Uiu2HAm5WP1J6bZC3aHxd7XCUumMt9txAystmbZSaMS2omHepXa",
28+
].iter(),
29+
DriaNetworkType::Pro => [].iter(),
5330
}
54-
.filter_map(|s| s.parse().ok())
31+
.map(|s| s.parse().expect("could not parse static relay address"))
5532
.collect()
5633
}
5734

35+
/// Static RPC Peer IDs for the Admin RPC.
5836
pub fn get_static_rpc_peer_ids(&self) -> Vec<PeerId> {
59-
match self {
60-
DriaNetworkType::Community => STATIC_RPC_PEER_IDS.0.iter(),
61-
DriaNetworkType::Pro => STATIC_RPC_PEER_IDS.1.iter(),
62-
}
63-
.filter_map(|s| s.parse().ok())
64-
.collect()
37+
// match self {
38+
// DriaNetworkType::Community => [].iter(),
39+
// DriaNetworkType::Pro => [].iter(),
40+
// }
41+
// .filter_map(|s| s.parse().ok())
42+
// .collect()
43+
vec![]
6544
}
6645
}
6746

0 commit comments

Comments
 (0)