mirror of https://github.com/waku-org/js-waku.git
fix: usage of libp2p and undefined options
This commit is contained in:
parent
52d74a74b5
commit
d609b9c47b
|
@ -91,7 +91,7 @@ export async function createWaku(options?: CreateOptions): Promise<Waku> {
|
||||||
|
|
||||||
// TODO: Use options
|
// TODO: Use options
|
||||||
const libp2pOpts = {
|
const libp2pOpts = {
|
||||||
transports: new WebSockets({ filter: filterAll }),
|
transports: [new WebSockets({ filter: filterAll })],
|
||||||
streamMuxers: [new Mplex()],
|
streamMuxers: [new Mplex()],
|
||||||
pubsub: new WakuRelay(),
|
pubsub: new WakuRelay(),
|
||||||
connectionEncryption: [new Noise()],
|
connectionEncryption: [new Noise()],
|
||||||
|
|
|
@ -44,13 +44,12 @@ export class WakuRelay extends GossipSub {
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(options?: Partial<CreateOptions & GossipsubOpts>) {
|
constructor(options?: Partial<CreateOptions & GossipsubOpts>) {
|
||||||
super(
|
options = Object.assign(options ?? {}, {
|
||||||
Object.assign(options, {
|
// Ensure that no signature is included nor expected in the messages.
|
||||||
// Ensure that no signature is included nor expected in the messages.
|
globalSignaturePolicy: SignaturePolicy.StrictNoSign,
|
||||||
globalSignaturePolicy: SignaturePolicy.StrictNoSign,
|
fallbackToFloodsub: false,
|
||||||
fallbackToFloodsub: false,
|
});
|
||||||
})
|
super(options);
|
||||||
);
|
|
||||||
this.multicodecs = constants.RelayCodecs;
|
this.multicodecs = constants.RelayCodecs;
|
||||||
|
|
||||||
this.observers = {};
|
this.observers = {};
|
||||||
|
|
Loading…
Reference in New Issue