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.
Copy file name to clipboardexpand all lines: README.md
+3-4
Original file line number
Diff line number
Diff line change
@@ -314,10 +314,9 @@ Instead of a boolean, you may provide an object with custom initialization optio
314
314
```js
315
315
// Generating a Peer ID:
316
316
constPeerId=require('peer-id')
317
-
PeerId.create({ bits:2048 }, (err, peerId) => {
318
-
// Generates a new Peer ID, complete with public/private keypair
319
-
// See https://github.com/libp2p/js-peer-id
320
-
})
317
+
// Generates a new Peer ID, complete with public/private keypair
318
+
// See https://github.com/libp2p/js-peer-id
319
+
constpeerId=awaitPeerId.create({ bits:2048 })
321
320
```
322
321
-`pass` (string) A passphrase to encrypt keys. You should generally use the [top-level `pass` option](#optionspass) instead of the `init.pass`option (this one will take its value from the top-level option if not set).
323
322
-`profiles` (Array) Apply profile settings to config.
Copy file name to clipboardexpand all lines: src/core/ipns/resolver.js
+1-3
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,6 @@ 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')
8
-
9
7
constdebug=require('debug')
10
8
constlog=debug('ipfs:ipns:resolver')
11
9
log.error=debug('ipfs:ipns:resolver:error')
@@ -75,7 +73,7 @@ class IpnsResolver {
75
73
76
74
// resolve ipns entries from the provided routing
77
75
async_resolveName(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