*Need to wrap DhtNode in a hyperswarm instance

This commit is contained in:
Derrick Hammer 2023-02-01 05:00:51 -05:00
parent 17ca564f43
commit af76d85983
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 8 additions and 5 deletions

View File

@ -68,10 +68,13 @@ export default class HyperswarmWeb extends EventEmitter {
continue; continue;
} }
this._activeRelay = new DhtNode( this._activeRelay = new Hyperswarm({
dht: new DhtNode(
new Stream(true, new WebSocket(connection)), new Stream(true, new WebSocket(connection)),
this._options this._options
); ),
keyPair: this._options.keyPair,
});
this._activeRelay.on("close", () => { this._activeRelay.on("close", () => {
this._activeRelay = undefined; this._activeRelay = undefined;
@ -83,7 +86,7 @@ export default class HyperswarmWeb extends EventEmitter {
} }
this._processQueuedActions(); this._processQueuedActions();
await this._activeRelay.ready(); await this._activeRelay.dht.ready();
} }
private async isServerAvailable(connection: string): Promise<boolean> { private async isServerAvailable(connection: string): Promise<boolean> {