From 8e3fbba26d68f4946cd7fb6a92eda95fc6852787 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Mon, 17 Apr 2023 15:58:05 +0200 Subject: [PATCH] fix!: remove getPrivateKey method The getPublicKey method can be used to fetch the public key of a peer that uses an RSA peer id. This method is redundant as it can be accomplished by using content routing to look up the value for the `/pk` key. E.g ```js const peerKey = uint8ArrayConcat([ uint8ArrayFromString('/pk/'), peer.multihash.digest ]) const key = await node.contentRouting.get(peerKey) ``` BREAKING CHANGE: the getPublicKey method has been removed --- packages/interface-libp2p/src/index.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/interface-libp2p/src/index.ts b/packages/interface-libp2p/src/index.ts index 9d6bffcc6..da8f05b54 100644 --- a/packages/interface-libp2p/src/index.ts +++ b/packages/interface-libp2p/src/index.ts @@ -469,10 +469,4 @@ export interface Libp2p extends Startable, EventEmitter { * ``` */ fetch: (peer: PeerId | Multiaddr, key: string, options?: AbortOptions) => Promise - - /** - * Returns the public key for the passed PeerId. If the PeerId is of the 'RSA' type - * this may mean searching the DHT if the key is not present in the KeyStore. - */ - getPublicKey: (peer: PeerId, options?: AbortOptions) => Promise }