2024-01-15 16:12:01 -08:00
|
|
|
import type { PeerId, Stream } from "@libp2p/interface";
|
2024-04-28 11:15:17 +02:00
|
|
|
import type { MultiaddrInput } from "@multiformats/multiaddr";
|
2022-12-05 17:00:24 +11:00
|
|
|
|
2023-07-31 13:54:39 +05:30
|
|
|
import { IConnectionManager } from "./connection_manager.js";
|
2024-04-19 17:20:34 +05:30
|
|
|
import type { IFilterSDK } from "./filter.js";
|
2024-07-27 18:27:54 +05:30
|
|
|
import { IHealthManager } from "./health_manager.js";
|
2023-07-25 02:17:52 +02:00
|
|
|
import type { Libp2p } from "./libp2p.js";
|
2024-10-04 10:50:58 +02:00
|
|
|
import type { ILightPush } from "./light_push.js";
|
2024-01-25 20:07:58 -08:00
|
|
|
import { Protocols } from "./protocols.js";
|
2022-12-06 12:36:29 +11:00
|
|
|
import type { IRelay } from "./relay.js";
|
2024-04-01 16:47:47 +05:30
|
|
|
import type { IStoreSDK } from "./store.js";
|
2022-12-05 17:00:24 +11:00
|
|
|
|
|
|
|
|
export interface Waku {
|
|
|
|
|
libp2p: Libp2p;
|
2022-12-06 12:36:29 +11:00
|
|
|
relay?: IRelay;
|
2024-04-01 16:47:47 +05:30
|
|
|
store?: IStoreSDK;
|
2024-04-19 17:20:34 +05:30
|
|
|
filter?: IFilterSDK;
|
2024-10-04 10:50:58 +02:00
|
|
|
lightPush?: ILightPush;
|
2022-12-05 17:00:24 +11:00
|
|
|
|
2023-07-31 13:54:39 +05:30
|
|
|
connectionManager: IConnectionManager;
|
|
|
|
|
|
2024-04-28 11:15:17 +02:00
|
|
|
dial(peer: PeerId | MultiaddrInput, protocols?: Protocols[]): Promise<Stream>;
|
2022-12-05 17:00:24 +11:00
|
|
|
|
|
|
|
|
start(): Promise<void>;
|
|
|
|
|
|
|
|
|
|
stop(): Promise<void>;
|
|
|
|
|
|
|
|
|
|
isStarted(): boolean;
|
2023-11-27 03:44:49 -08:00
|
|
|
|
|
|
|
|
isConnected(): boolean;
|
2024-07-27 18:27:54 +05:30
|
|
|
|
|
|
|
|
health: IHealthManager;
|
2022-12-05 17:00:24 +11:00
|
|
|
}
|
|
|
|
|
|
2022-12-06 13:18:32 +11:00
|
|
|
export interface LightNode extends Waku {
|
2022-12-05 17:00:24 +11:00
|
|
|
relay: undefined;
|
2024-04-01 16:47:47 +05:30
|
|
|
store: IStoreSDK;
|
2024-04-19 17:20:34 +05:30
|
|
|
filter: IFilterSDK;
|
2024-10-04 10:50:58 +02:00
|
|
|
lightPush: ILightPush;
|
2022-12-05 17:00:24 +11:00
|
|
|
}
|
|
|
|
|
|
2022-12-06 13:18:32 +11:00
|
|
|
export interface RelayNode extends Waku {
|
2022-12-06 12:36:29 +11:00
|
|
|
relay: IRelay;
|
2022-12-05 17:00:24 +11:00
|
|
|
store: undefined;
|
|
|
|
|
filter: undefined;
|
|
|
|
|
lightPush: undefined;
|
|
|
|
|
}
|