probe fixes

testing probe locally
This commit is contained in:
benedettadavico
2025-11-17 11:40:27 +01:00
parent 96e3ff2af9
commit f960bfa91b
3 changed files with 19 additions and 3 deletions
+2 -2
View File
@@ -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() {
+10
View 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)
+7 -1
View File
@@ -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 {