mirror of
https://github.com/waku-org/js-waku.git
synced 2025-02-23 01:28:16 +00:00
refactor nwaku.ts to support filterv2
This commit is contained in:
parent
60ffa8fddf
commit
02bcd4ec24
@ -47,6 +47,7 @@ export interface Args {
|
|||||||
logLevel?: LogLevel;
|
logLevel?: LogLevel;
|
||||||
lightpush?: boolean;
|
lightpush?: boolean;
|
||||||
filter?: boolean;
|
filter?: boolean;
|
||||||
|
useFilterV2?: boolean;
|
||||||
store?: boolean;
|
store?: boolean;
|
||||||
peerExchange?: boolean;
|
peerExchange?: boolean;
|
||||||
discv5Discovery?: boolean;
|
discv5Discovery?: boolean;
|
||||||
@ -183,6 +184,18 @@ export class Nwaku {
|
|||||||
const rpcAddress = "--rpc-address=0.0.0.0";
|
const rpcAddress = "--rpc-address=0.0.0.0";
|
||||||
argsArray.push(natExtIp, rpcAddress);
|
argsArray.push(natExtIp, rpcAddress);
|
||||||
|
|
||||||
|
if (isGoWaku) {
|
||||||
|
if (mergedArgs.useFilterV2) {
|
||||||
|
argsArray.push(
|
||||||
|
"--use-filterv2",
|
||||||
|
"--light-client",
|
||||||
|
"--min-relay-peers-to-publish=0"
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
throw new Error("FilterV2 is only supported by go-waku currently");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (WAKU_SERVICE_NODE_PARAMS) {
|
if (WAKU_SERVICE_NODE_PARAMS) {
|
||||||
argsArray.push(WAKU_SERVICE_NODE_PARAMS);
|
argsArray.push(WAKU_SERVICE_NODE_PARAMS);
|
||||||
}
|
}
|
||||||
@ -522,7 +535,7 @@ export function defaultArgs(): Args {
|
|||||||
relay: false,
|
relay: false,
|
||||||
rpcAdmin: true,
|
rpcAdmin: true,
|
||||||
websocketSupport: true,
|
websocketSupport: true,
|
||||||
logLevel: LogLevel.Trace,
|
// logLevel: LogLevel.Trace,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user