From 71f1bb5e84fbc94a0a12a4097b75ce2cf85bf90e Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 3 Jul 2018 14:42:29 +0200 Subject: [PATCH] Add additional flags in runParity --- packages/parity-electron/README.md | 9 +++++---- packages/parity-electron/src/runParity.js | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/parity-electron/README.md b/packages/parity-electron/README.md index 3f6e24e9..f88909a6 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 38c2528c..cd2f277a 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)); -- GitLab