Commit 71f1bb5e authored by Amaury Martiny's avatar Amaury Martiny

Add additional flags in runParity

parent 9263ec47
......@@ -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<Null>`
#### `runParity(additionalFlags: Array<String>, onParityError: Function): Promise<Null>`
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<String>` | 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<Null>`
......
......@@ -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));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment