test: enable passing arguments to service node

This commit is contained in:
fryorcraken.eth 2022-08-24 07:43:04 +10:00
parent 5f4e14e56c
commit f0eb925838
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 5 additions and 0 deletions

View File

@ -27,6 +27,8 @@ const WAKU_SERVICE_NODE_DIR =
const WAKU_SERVICE_NODE_BIN = const WAKU_SERVICE_NODE_BIN =
process.env.WAKU_SERVICE_NODE_BIN ?? process.env.WAKU_SERVICE_NODE_BIN ??
WAKU_SERVICE_NODE_DIR + "/build/wakunode2"; WAKU_SERVICE_NODE_DIR + "/build/wakunode2";
const WAKU_SERVICE_NODE_PARAMS =
process.env.WAKU_SERVICE_NODE_PARAMS ?? undefined;
const NODE_READY_LOG_LINE = "Node setup complete"; const NODE_READY_LOG_LINE = "Node setup complete";
const LOG_DIR = "./log"; const LOG_DIR = "./log";
@ -144,6 +146,9 @@ export class Nwaku {
); );
const argsArray = argsToArray(mergedArgs); const argsArray = argsToArray(mergedArgs);
if (WAKU_SERVICE_NODE_PARAMS) {
argsArray.push(WAKU_SERVICE_NODE_PARAMS);
}
dbg(`nwaku args: ${argsArray.join(" ")}`); dbg(`nwaku args: ${argsArray.join(" ")}`);
this.process = spawn(WAKU_SERVICE_NODE_BIN, argsArray, { this.process = spawn(WAKU_SERVICE_NODE_BIN, argsArray, {
cwd: WAKU_SERVICE_NODE_DIR, cwd: WAKU_SERVICE_NODE_DIR,