Skip to content

Commit f2eecb1

Browse files
authored
Allow passing arguments directly to Ethereum node (#21)
* Allow passing arguments directly to Ethereum node - Fixes #19 * Problem: Error when --nodeArguments are missing Make sure to pass no arguments when nodeArguments value is falsy.
1 parent 16c5d63 commit f2eecb1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cli.js

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function getOptions(program) {
1515
allocate: program.allocate,
1616
chainId: program.chainid,
1717
execute: program.execute,
18+
nodeArguments: program.nodeArguments
1819
};
1920
}
2021

@@ -46,6 +47,10 @@ program
4647
.option(
4748
"-e, --execute <command>",
4849
"Start ethnode, execute command, and exit ethnode (useful for testing)."
50+
)
51+
.option(
52+
"--node-arguments <args>",
53+
"Arguments that are passed directly to ethnode's underlying Ethereum node."
4954
);
5055

5156
program.version(packageJson.version);

main.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ async function provide(
157157

158158
async function run(
159159
client,
160-
{ download, workdir, logging, allocate, chainId, execute }
160+
{ download, workdir, logging, allocate, chainId, execute, nodeArguments }
161161
) {
162162
const loggingOptions = logging
163163
? client === "geth"
@@ -269,6 +269,8 @@ async function run(
269269
throw `Client "${client}" is not supported`;
270270
}
271271

272+
if (nodeArguments) args.push(nodeArguments);
273+
272274
if (logging === "debug") {
273275
console.log("running:", paths.binary, args.join(" "));
274276
}

0 commit comments

Comments
 (0)