2022-12-05 17:00:24 +11:00
|
|
|
import type { Stream } from "@libp2p/interface-connection";
|
2023-02-09 13:21:03 +11:00
|
|
|
import type { Libp2p } from "@libp2p/interface-libp2p";
|
2022-12-05 17:00:24 +11:00
|
|
|
import type { PeerId } from "@libp2p/interface-peer-id";
|
|
|
|
|
import type { Multiaddr } from "@multiformats/multiaddr";
|
|
|
|
|
|
2023-05-23 16:06:46 +05:30
|
|
|
import type { IFilter, IFilterV2 } from "./filter.js";
|
2022-12-06 12:36:29 +11:00
|
|
|
import type { ILightPush } from "./light_push.js";
|
2022-12-05 17:00:24 +11:00
|
|
|
import { Protocols } 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-05-23 16:06:46 +05:30
|
|
|
filter?: IFilter | IFilterV2;
|
2022-12-06 12:36:29 +11:00
|
|
|
lightPush?: ILightPush;
|
2022-12-05 17:00:24 +11:00
|
|
|
|
|
|
|
|
dial(peer: PeerId | Multiaddr, protocols?: Protocols[]): Promise<Stream>;
|
|
|
|
|
|
|
|
|
|
start(): Promise<void>;
|
|
|
|
|
|
|
|
|
|
stop(): Promise<void>;
|
|
|
|
|
|
|
|
|
|
isStarted(): boolean;
|
|
|
|
|
}
|
|
|
|
|
|
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-05-23 16:06:46 +05:30
|
|
|
filter: IFilter | IFilterV2;
|
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-05-23 16:06:46 +05:30
|
|
|
filter: IFilter | IFilterV2;
|
2022-12-06 12:36:29 +11:00
|
|
|
lightPush: ILightPush;
|
2022-12-05 17:00:24 +11:00
|
|
|
}
|