You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This adds support for resolving PeerIDs as CIDs in /ipns/ paths.
See libp2p/specs#216 for full context.
License: MIT
Signed-off-by: Marcin Rataj <[email protected]>
Copy file name to clipboardexpand all lines: src/core/ipns/resolver.js
+2-1
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ const ipns = require('ipns')
4
4
constcrypto=require('libp2p-crypto')
5
5
constPeerId=require('peer-id')
6
6
consterrcode=require('err-code')
7
+
constCID=require('cids')
7
8
8
9
constdebug=require('debug')
9
10
constlog=debug('ipfs:ipns:resolver')
@@ -74,7 +75,7 @@ class IpnsResolver {
74
75
75
76
// resolve ipns entries from the provided routing
76
77
async_resolveName(name){
77
-
constpeerId=PeerId.createFromB58String(name)
78
+
constpeerId=PeerId.createFromBytes(newCID(name).multihash)// TODO: change to `PeerId.createFromCID` when https://github.com/libp2p/js-peer-id/pull/105 lands and js-ipfs switched to async peer-id lib
0 commit comments