diff --git a/packages/parity-electron/README.md b/packages/parity-electron/README.md index 3f6e24e9ca75e364d4f961afb2c4d43924479fbf..f88909a69d72e400f6e4bcfb57ef3d2e25204d4b 100644 --- a/packages/parity-electron/README.md +++ b/packages/parity-electron/README.md @@ -57,13 +57,14 @@ Returns the path to the Parity path inside Electron's `userData` folder, even if Resolves to `true` if Parity is currently running, or to `false` if not. -#### `runParity(onParityError: Function): Promise` +#### `runParity(additionalFlags: Array, onParityError: Function): Promise` Spawns a child process to run Parity. If some `cli` flags are passed into the options in `parityElectron`, then those flags will be passed down to Parity itself. -| Option | Type | Description | -| --------------- | ---------- | ------------------------------------------------------------------ | -| `onParityError` | `Function` | Callback with `error` as argument when Parity encounters an error. | +| Option | Type | Description | +| ----------------- | --------------- | --------------------------------------------------------------------------------------------- | +| `additionalFlasg` | `Array` | Addtional flags to pass to Parity, listed as an array, to be passed to `child_process.spawn`. | +| `onParityError` | `Function` | Callback with `error` as argument when Parity encounters an error. | #### `killParity(): Promise` diff --git a/packages/parity-electron/src/runParity.js b/packages/parity-electron/src/runParity.js index 38c2528cfab3602f93b61bc3298eb063d203765e..cd2f277a1f4a3a75ada6ca0ac2c5caee8b268374 100644 --- a/packages/parity-electron/src/runParity.js +++ b/packages/parity-electron/src/runParity.js @@ -26,7 +26,7 @@ const catchableErrors = [ 'IO error: While lock file:' ]; -export const runParity = async onParityError => { +export const runParity = async (additionalFlags, onParityError) => { // Do not run parity with --no-run-parity if (cli.runParity === false) { return; @@ -50,7 +50,7 @@ export const runParity = async onParityError => { let logLastLine; // Always contains last line of the Parity logs // Run an instance of parity with the correct args - const args = [...parityArgv(), '--light']; + const args = [...parityArgv(), ...additionalFlags]; parity = spawn(parityPath, args); logger()('@parity/electron:main')(logCommand(parityPath, args));