*Use createClient factory

This commit is contained in:
Derrick Hammer 2023-03-19 15:20:53 -04:00
parent 788781c31c
commit 623f800418
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
import { addHandler, handleMessage } from "libkmodule";
import type { ActiveQuery } from "libkmodule";
import { SwarmClient } from "@lumeweb/kernel-swarm-client";
import { createClient, SwarmClient } from "@lumeweb/kernel-swarm-client";
import { RpcNetwork, RpcQueryOptions } from "@lumeweb/rpc-client";
import type { RPCRequest, RPCResponse } from "@lumeweb/interface-relay";
@ -88,7 +88,7 @@ async function handleReady(aq: ActiveQuery) {
aq.respond();
}
async function createNetwork(def = true): Promise<number> {
const dhtInstance = new RpcNetwork(new SwarmClient(def));
const dhtInstance = new RpcNetwork(createClient(def));
const id = nextId();
networkInstances.set(id, dhtInstance);