pub async fn try_get_valid_nym_node_api_client(
base_host: &str,
node_id: u32,
custom_port: Option<u16>,
user_agent: impl Into<UserAgent>,
) -> Result<Client, Error>Expand description
Probe a nym-node’s HTTP API and return a connected crate::api::Client.
base_host is a hostname (e.g. nymtech.net) or IP address (e.g. 127.0.0.1).
The function tries the following addresses in order, returning the first one whose
/health endpoint reports an “up” status:
http://<host>:<custom_port>(only whencustom_portisSome)http://<host>:8080— the standard nym-node API porthttps://<host>— node behind an HTTPS reverse proxy (port 443)http://<host>— node behind an HTTP reverse proxy (port 80)
This function is intended for infrastructure binaries (nym-api, network monitor, etc.), not regular clients, which is why hickory DNS is explicitly disabled.