disable noise pipes

This commit is contained in:
Marin Petrunić 2020-03-04 09:02:59 +01:00
parent 049c2e6491
commit b1b045fff0
No known key found for this signature in database
GPG Key ID: 834D07135E110DA5
2 changed files with 4 additions and 5 deletions

View File

@ -25,7 +25,7 @@ import {NOISE, Noise} from "libp2p-noise"
//custom noise configuration, pass it instead of NOISE instance
const noise = new Noise(privateKey, Buffer.alloc(), false);
const noise = new Noise(privateKey, Buffer.alloc(x));
const libp2p = new Libp2p({
modules: {
@ -35,7 +35,6 @@ const libp2p = new Libp2p({
```
Where parameters for Noise constructor are:
- *private key* - required parameter (32 bytes libp2p peer private key)
- *static Noise key* - (optional) existing private Noise static key
- *early data* - (optional) an early data payload to be sent in handshake messages

View File

@ -42,11 +42,11 @@ export class Noise implements INoiseConnection {
*
* @param staticNoiseKey x25519 private key, reuse for faster handshakes
* @param earlyData
* @param useNoisePipes enable IK handshake if initiator static key is known
*/
constructor(staticNoiseKey?: bytes, earlyData?: bytes, useNoisePipes = true) {
constructor(staticNoiseKey?: bytes, earlyData?: bytes) {
this.earlyData = earlyData || Buffer.alloc(0);
this.useNoisePipes = useNoisePipes;
//disabled until properly specked
this.useNoisePipes = false;
if (staticNoiseKey) {
const publicKey = x25519.publicKeyCreate(staticNoiseKey);