pub async fn connect_random(
network: NetworkType,
cert_path: &str,
key_path: &str,
) -> Result<Peer>
Expand description
Connects to a random peer on the specified network (Rust API version).
The function performs DNS lookups using the network’s introducers, picks a random address from the returned list, and attempts to establish a connection. It will try every resolved address until a connection succeeds.