fix: usage of libp2p and undefined options

This commit is contained in:
Franck Royer 2022-06-23 16:36:56 +10:00
parent 52d74a74b5
commit d609b9c47b
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 7 additions and 8 deletions

View File

@ -91,7 +91,7 @@ export async function createWaku(options?: CreateOptions): Promise<Waku> {
// TODO: Use options
const libp2pOpts = {
transports: new WebSockets({ filter: filterAll }),
transports: [new WebSockets({ filter: filterAll })],
streamMuxers: [new Mplex()],
pubsub: new WakuRelay(),
connectionEncryption: [new Noise()],

View File

@ -44,13 +44,12 @@ export class WakuRelay extends GossipSub {
};
constructor(options?: Partial<CreateOptions & GossipsubOpts>) {
super(
Object.assign(options, {
// Ensure that no signature is included nor expected in the messages.
globalSignaturePolicy: SignaturePolicy.StrictNoSign,
fallbackToFloodsub: false,
})
);
options = Object.assign(options ?? {}, {
// Ensure that no signature is included nor expected in the messages.
globalSignaturePolicy: SignaturePolicy.StrictNoSign,
fallbackToFloodsub: false,
});
super(options);
this.multicodecs = constants.RelayCodecs;
this.observers = {};