From af76d8598312e214870cffa8c9bd4f93de2d3db7 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 1 Feb 2023 05:00:51 -0500 Subject: [PATCH] *Need to wrap DhtNode in a hyperswarm instance --- src/index.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index 4dd8335..0b89a7c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -68,10 +68,13 @@ export default class HyperswarmWeb extends EventEmitter { continue; } - this._activeRelay = new DhtNode( - new Stream(true, new WebSocket(connection)), - this._options - ); + this._activeRelay = new Hyperswarm({ + dht: new DhtNode( + new Stream(true, new WebSocket(connection)), + this._options + ), + keyPair: this._options.keyPair, + }); this._activeRelay.on("close", () => { this._activeRelay = undefined; @@ -83,7 +86,7 @@ export default class HyperswarmWeb extends EventEmitter { } this._processQueuedActions(); - await this._activeRelay.ready(); + await this._activeRelay.dht.ready(); } private async isServerAvailable(connection: string): Promise {