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
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -250,6 +250,14 @@ Instead of a boolean, you may provide an object with custom initialization optio
250
250
-`emptyRepo` (boolean) Whether to remove built-in assets, like the instructional tour and empty mutable file system, from the repo. (Default: `false`)
251
251
-`bits` (number) Number of bits to use in the generated key pair. (Default: `2048`)
252
252
-`privateKey` (string/PeerId) A pre-generated private key to use. Can be either a base64 string or a [PeerId](https://github.com/libp2p/js-peer-id) instance. **NOTE: This overrides `bits`.**
253
+
```js
254
+
// Generating a Peer ID:
255
+
constPeerId=require('peer-id')
256
+
PeerId.create({ bits:2048 }, (err, peerId) => {
257
+
// Generates a new Peer ID, complete with public/private keypair
258
+
// See https://github.com/libp2p/js-peer-id
259
+
})
260
+
```
253
261
-`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).
0 commit comments