fedimint_core::net::api_announcement

Function override_api_urls

Source
pub async fn override_api_urls<P>(
    db: &Database,
    cfg_api_urls: impl IntoIterator<Item = (PeerId, SafeUrl)>,
    db_key_prefix: &P,
    key_to_peer_id: impl Fn(&P::Record) -> PeerId,
) -> BTreeMap<PeerId, SafeUrl>
Expand description

Override api URLs used by the client.

Takes a list of peer IDs and their API URLs, and overrides the URLs with the ones stored in the respective database. This function is generic so it can be used with both the client and server databases.