peer_discovery

Function peer_discovery 

Source
pub async fn peer_discovery(
    seeds: NonEmptyVec<Url>,
    max_parallel_tasks: BoundedU16<1, { u16::MAX }>,
    timeout: Duration,
) -> Result<Vec<Url>, PeerDiscoveryError>
Expand description

Given a list of seed nodes, search for peer nodes with an active REST API on port 9053.

  • seeds represents a list of ergo node URLs from which to start peer discovery.
  • max_parallel_tasks represents the maximum number of tasks to spawn for ergo node HTTP requests. Note that the actual number of parallel HTTP requests may well be higher than this number.
  • timeout represents the amount of time that is spent search for peers. Once the timeout value is reached, return with the vec of active peers that have been discovered up to that point in time.

IMPORTANT: do not call this function on Chromium, as it will likely mess with the browser’s ability to make HTTP requests. Use peer_discovery_chrome instead. For more information why please refer to the module documentation for crate::api::peer_discovery_internals::chrome.