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

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.