Skip to content

Commit 9ace59d

Browse files
committed
small rfks
1 parent 3162a2c commit 9ace59d

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

compute/src/node/diagnostic.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl DriaComputeNode {
1818

1919
/// Peer refresh simply reports the peer count to the user.
2020
pub(crate) async fn handle_diagnostic_refresh(&self) {
21-
let mut diagnostics = vec!["Diagnostics:".to_string()];
21+
let mut diagnostics = vec![format!("Diagnostics (v{}):", DRIA_COMPUTE_NODE_VERSION)];
2222

2323
// print peer counts
2424
match self.p2p.peer_counts().await {
@@ -55,9 +55,6 @@ impl DriaComputeNode {
5555
.join(", ")
5656
));
5757

58-
// print version
59-
diagnostics.push(format!("Version: v{}", DRIA_COMPUTE_NODE_VERSION));
60-
6158
log::info!("{}", diagnostics.join("\n "));
6259

6360
// check liveness of the node w.r.t last ping-pong time

p2p/src/network.rs

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ impl DriaNetworkType {
4545
pub fn get_static_bootstrap_nodes(&self) -> Vec<Multiaddr> {
4646
match self {
4747
DriaNetworkType::Community => [
48+
// "/ip4/18.205.158.27/tcp/4001/p2p/16Uiu2HAmB2GFG8oYa7DuivXYEsMUPiiKQ6yq9haQHRHHjJrn7FHo",
4849
"/ip4/44.206.245.139/tcp/4001/p2p/16Uiu2HAm4q3LZU2T9kgjKK4ysy6KZYKLq8KiXQyae4RHdF7uqSt4",
4950
"/ip4/18.234.39.91/tcp/4001/p2p/16Uiu2HAmJqegPzwuGKWzmb5m3RdSUJ7NhEGWB5jNCd3ca9zdQ9dU",
5051
"/ip4/54.242.44.217/tcp/4001/p2p/16Uiu2HAmR2sAoh9F8jT9AZup9y79Mi6NEFVUbwRvahqtWamfabkz",
@@ -62,6 +63,7 @@ impl DriaNetworkType {
6263
pub fn get_static_relay_nodes(&self) -> Vec<Multiaddr> {
6364
match self {
6465
DriaNetworkType::Community => [
66+
// "/ip4/3.88.84.50/tcp/4001/p2p/16Uiu2HAmN35mw5MMf3SCUt3TpEU6WnBvjYJQ4ZZeKHRHEkSc4RPq",
6567
"/ip4/34.201.33.141/tcp/4001/p2p/16Uiu2HAkuXiV2CQkC9eJgU6cMnJ9SMARa85FZ6miTkvn5fuHNufa",
6668
"/ip4/18.232.93.227/tcp/4001/p2p/16Uiu2HAmHeGKhWkXTweHJTA97qwP81ww1W2ntGaebeZ25ikDhd4z",
6769
"/ip4/54.157.219.194/tcp/4001/p2p/16Uiu2HAm7A5QVSy5FwrXAJdNNsdfNAcaYahEavyjnFouaEi22dcq",
@@ -74,15 +76,30 @@ impl DriaNetworkType {
7476
.collect()
7577
}
7678

79+
/// Static RPC Peer IDs.
80+
#[inline(always)]
81+
pub fn get_static_rpc_nodes(&self) -> Vec<Multiaddr> {
82+
match self {
83+
DriaNetworkType::Community => [
84+
// "/ip4/104.28.54.97/tcp/4001/p2p/16Uiu2HAmEcBQRQy4CVCnQ144rnvagKa1fS5uAguwq9S2DRiRmAWE",
85+
]
86+
.iter(),
87+
DriaNetworkType::Pro => [].iter(),
88+
DriaNetworkType::Test => [].iter(),
89+
}
90+
.map(|s: &&str| s.parse().expect("could not parse static rpc address"))
91+
.collect()
92+
}
93+
7794
/// Static RPC Peer IDs.
7895
#[inline(always)]
7996
pub fn get_static_rpc_peer_ids(&self) -> Vec<PeerId> {
80-
// match self {
81-
// DriaNetworkType::Community => [].iter(),
82-
// DriaNetworkType::Pro => [].iter(),
83-
// }
84-
// .filter_map(|s| s.parse().ok())
85-
// .collect()
86-
vec![]
97+
match self {
98+
DriaNetworkType::Community => [].iter(),
99+
DriaNetworkType::Pro => [].iter(),
100+
DriaNetworkType::Test => [].iter(),
101+
}
102+
.map(|s: &&str| s.parse().expect("could not parse static rpc peer ids"))
103+
.collect()
87104
}
88105
}

p2p/src/nodes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ impl DriaNodes {
8484
.extend(self.network.get_static_bootstrap_nodes());
8585
self.relay_nodes
8686
.extend(self.network.get_static_relay_nodes());
87+
self.rpc_nodes.extend(self.network.get_static_rpc_nodes());
8788
self.rpc_peerids
8889
.extend(self.network.get_static_rpc_peer_ids());
8990

0 commit comments

Comments
 (0)