Skip to main content

peer_id_to_public_key

Function peer_id_to_public_key 

Source
pub async fn peer_id_to_public_key(
    peer_id: &PeerId,
) -> Result<OffchainPublicKey>
Expand description

PeerId -> OffchainPublicKey is a CPU-intensive blocking operation.

This helper uses a cached static object to speed up the lookup and avoid blocking the async runtime on repeated conversions for the same PeerIds.