Skip to content

Commit

Permalink
chore(misc): Change default discovery (#1659)
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 authored Dec 21, 2023
1 parent 8307de4 commit 3d16b89
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ pub enum DiscoveryMode {
Full,

/// Use warp specific discovery
#[default]
Shuttle,

/// Address to a specific discovery point
RzPoint { address: String },

/// Disable discovery
#[default]
Disable,
}

Expand Down
30 changes: 10 additions & 20 deletions common/src/warp_runner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,26 +358,16 @@ impl From<&DiscoveryMode> for Discovery {
addresses: vec![address.parse().expect("Valid multiaddr address")],
},
},
DiscoveryMode::Shuttle => {
#[cfg(not(feature = "production_mode"))]
{
Discovery::Shuttle {
addresses: HashMap::from_iter([(
"12D3KooWJSes8386p2T1sMeZ2DzsNJThKkZWbj4US6uPMpEgBTHu"
.parse()
.expect("Valid id"),
HashSet::from_iter(["/ip4/104.236.194.35/tcp/34053"
.parse()
.expect("valid addr")]),
)]),
}
}
#[cfg(feature = "production_mode")]
{
//TODO: Add a production map
Discovery::None
}
}
DiscoveryMode::Shuttle => Discovery::Shuttle {
addresses: HashMap::from_iter([(
"12D3KooWJSes8386p2T1sMeZ2DzsNJThKkZWbj4US6uPMpEgBTHu"
.parse()
.expect("Valid id"),
HashSet::from_iter(["/ip4/104.236.194.35/tcp/34053"
.parse()
.expect("valid addr")]),
)]),
},
DiscoveryMode::Disable => Discovery::None,
}
}
Expand Down

0 comments on commit 3d16b89

Please sign in to comment.