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>where
P: DatabaseLookup + DatabaseKeyPrefix + MaybeSend + MaybeSync,
P::Record: DatabaseRecord<Value = SignedApiAnnouncement> + DatabaseKey + MaybeSend + MaybeSync,
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.