probe fixes
testing probe locally
This commit is contained in:
@@ -186,7 +186,7 @@ impl Probe {
|
||||
) -> anyhow::Result<ProbeResult> {
|
||||
let tickets_materials = self.credentials_args.decode_attached_ticket_materials()?;
|
||||
|
||||
let tested_entry = self.tested_node.is_same_as_entry();
|
||||
let tested_entry = !only_wireguard;
|
||||
let (mixnet_entry_gateway_id, node_info) = self.lookup_gateway(&directory).await?;
|
||||
|
||||
let storage = Ephemeral::default();
|
||||
@@ -232,7 +232,7 @@ impl Probe {
|
||||
only_wireguard: bool,
|
||||
min_mixnet_performance: Option<u8>,
|
||||
) -> anyhow::Result<ProbeResult> {
|
||||
let tested_entry = self.tested_node.is_same_as_entry();
|
||||
let tested_entry = !only_wireguard;
|
||||
let (mixnet_entry_gateway_id, node_info) = self.lookup_gateway(&directory).await?;
|
||||
|
||||
if config_dir.is_file() {
|
||||
|
||||
@@ -199,6 +199,16 @@ impl NymApiDirectory {
|
||||
.map(|(id, _)| *id)
|
||||
}
|
||||
|
||||
pub fn random_entry_gateway(&self) -> anyhow::Result<NodeIdentity> {
|
||||
info!("Selecting random entry gateway");
|
||||
self.nodes
|
||||
.iter()
|
||||
.filter(|(_, n)| n.described.description.declared_role.entry)
|
||||
.choose(&mut rand::thread_rng())
|
||||
.ok_or(anyhow!("no entry gateways available"))
|
||||
.map(|(id, _)| *id)
|
||||
}
|
||||
|
||||
pub fn get_nym_node(&self, identity: NodeIdentity) -> anyhow::Result<DirectoryNode> {
|
||||
self.nodes
|
||||
.get(&identity)
|
||||
|
||||
@@ -126,8 +126,14 @@ pub(crate) async fn run() -> anyhow::Result<ProbeResult> {
|
||||
|
||||
let entry = if let Some(gateway) = &args.entry_gateway {
|
||||
NodeIdentity::from_base58_string(gateway)?
|
||||
} else if let Some(node) = args.node {
|
||||
if directory.entry_gateway(&node).is_ok() {
|
||||
node
|
||||
} else {
|
||||
directory.random_entry_gateway()?
|
||||
}
|
||||
} else {
|
||||
directory.random_exit_with_ipr()?
|
||||
directory.random_entry_gateway()?
|
||||
};
|
||||
|
||||
let test_point = if let Some(node) = args.node {
|
||||
|
||||
Reference in New Issue
Block a user