Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: remove default instance #188

Merged
merged 2 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ Install with `yarn add @chainsafe/libp2p-noise` or `npm i @chainsafe/libp2p-nois
Example of using default noise configuration and passing it to the libp2p config:

```js
import {NOISE, Noise} from "@chainsafe/libp2p-noise"
import {Noise} from "@chainsafe/libp2p-noise"


//custom noise configuration, pass it instead of NOISE instance
//custom noise configuration, pass it instead of `new Noise()`
const noise = new Noise(privateKey, Buffer.alloc(x));

const libp2p = new Libp2p({
modules: {
connEncryption: [NOISE],
connEncryption: [new Noise()],
},
});
```
Expand Down
7 changes: 0 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
import { Noise } from './noise.js'

export * from './crypto.js'
export * from './crypto/stablelib.js'
export * from './noise.js'

/**
* Default configuration, it will generate new noise static key and enable noise pipes (IK handshake).
*/
export const NOISE = new Noise()