mirror of https://github.com/waku-org/js-waku.git
Define type for WakuRelay create options
This commit is contained in:
parent
f17a008278
commit
d8629b7fbc
|
@ -36,7 +36,8 @@ interface GossipOptions {
|
|||
doPX: boolean;
|
||||
msgIdFn: MessageIdFunction;
|
||||
messageCache: MessageCache;
|
||||
globalSignaturePolicy: string;
|
||||
// This option is always overridden
|
||||
// globalSignaturePolicy: string;
|
||||
scoreParams: Partial<PeerScoreParams>;
|
||||
scoreThresholds: Partial<PeerScoreThresholds>;
|
||||
directPeers: AddrInfo[];
|
||||
|
@ -48,6 +49,8 @@ interface GossipOptions {
|
|||
Dlazy: number;
|
||||
}
|
||||
|
||||
export type WakuRelayOptions = GossipOptions;
|
||||
|
||||
/**
|
||||
* Implements the [Waku v2 Relay protocol]{@link https://rfc.vac.dev/spec/11/}.
|
||||
* Must be passed as a `pubsub` module to a {Libp2p} instance.
|
||||
|
@ -70,7 +73,7 @@ export class WakuRelay extends Gossipsub implements Pubsub {
|
|||
* @param {Libp2p} libp2p
|
||||
* @param {Partial<GossipOptions>} [options]
|
||||
*/
|
||||
constructor(libp2p: Libp2p, options?: Partial<GossipOptions>) {
|
||||
constructor(libp2p: Libp2p, options?: Partial<WakuRelayOptions>) {
|
||||
super(
|
||||
libp2p,
|
||||
Object.assign(options, {
|
||||
|
|
Loading…
Reference in New Issue