diff --git a/src/index.ts b/src/index.ts index 1de305c..bcb4a36 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,9 @@ +import { S5Node } from "#node.js"; +import type { S5NodeConfig } from "#node.js"; + export * from "./types.js"; -export * from "./service/p2p.js"; -export * from "./service/registry.js"; +export type { S5NodeConfig }; + +export function createNode(config: S5NodeConfig) { + return new S5Node(config); +} diff --git a/src/node.ts b/src/node.ts index 1e94177..396aa4e 100644 --- a/src/node.ts +++ b/src/node.ts @@ -26,7 +26,7 @@ const DEFAULT_LOGGER = { }, }; -interface S5NodeConfig { +export interface S5NodeConfig { p2p?: { network: string; peers?: {