2024-01-15 16:12:01 -08:00
|
|
|
import type { PeerId, Stream } from "@libp2p/interface";
|
2022-12-05 17:00:24 +11:00
|
|
|
import type { Multiaddr } from "@multiformats/multiaddr";
|
|
|
|
|
|
2023-07-31 13:54:39 +05:30
|
|
|
import { IConnectionManager } from "./connection_manager.js";
|
2023-07-26 11:30:48 +05:30
|
|
|
import type { IFilter } from "./filter.js";
|
2023-07-25 02:17:52 +02:00
|
|
|
import type { Libp2p } from "./libp2p.js";
|
2022-12-06 12:36:29 +11:00
|
|
|
import type { ILightPush } from "./light_push.js";
|
2024-01-19 20:42:52 +05:30
|
|
|
import { Protocols, ShardingParams } from "./protocols.js";
|
2022-12-06 12:36:29 +11:00
|
|
|
import type { IRelay } from "./relay.js";
|
|
|
|
|
import type { IStore } 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;
|
|
|
|
|
store?: IStore;
|
2023-07-26 11:30:48 +05:30
|
|
|
filter?: IFilter;
|
2022-12-06 12:36:29 +11:00
|
|
|
lightPush?: ILightPush;
|
2022-12-05 17:00:24 +11:00
|
|
|
|
2024-01-19 20:42:52 +05:30
|
|
|
shardInfo?: ShardingParams;
|
|
|
|
|
|
2023-07-31 13:54:39 +05:30
|
|
|
connectionManager: IConnectionManager;
|
|
|
|
|
|
2022-12-05 17:00:24 +11:00
|
|
|
dial(peer: PeerId | Multiaddr, protocols?: Protocols[]): Promise<Stream>;
|
|
|
|
|
|
|
|
|
|
start(): Promise<void>;
|
|
|
|
|
|
|
|
|
|
stop(): Promise<void>;
|
|
|
|
|
|
|
|
|
|
isStarted(): boolean;
|
2023-11-27 03:44:49 -08:00
|
|
|
|
|
|
|
|
isConnected(): boolean;
|
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;
|
2022-12-06 12:36:29 +11:00
|
|
|
store: IStore;
|
2023-07-26 11:30:48 +05:30
|
|
|
filter: IFilter;
|
2022-12-06 12:36:29 +11: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;
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-06 13:18:32 +11:00
|
|
|
export interface FullNode extends Waku {
|
2022-12-06 12:36:29 +11:00
|
|
|
relay: IRelay;
|
|
|
|
|
store: IStore;
|
2023-07-26 11:30:48 +05:30
|
|
|
filter: IFilter;
|
2022-12-06 12:36:29 +11:00
|
|
|
lightPush: ILightPush;
|
2022-12-05 17:00:24 +11:00
|
|
|
}
|