diff --git a/javascript/packages/orchestrator/src/cmdGenerator.ts b/javascript/packages/orchestrator/src/cmdGenerator.ts index 3d445a94f..7913a21c4 100644 --- a/javascript/packages/orchestrator/src/cmdGenerator.ts +++ b/javascript/packages/orchestrator/src/cmdGenerator.ts @@ -270,7 +270,7 @@ export async function genCmd( const parachainIdArgIndex = args.findIndex((arg) => arg.includes("--parachain-id"), ); - args.splice(parachainIdArgIndex, 1); + if (parachainIdArgIndex >= 0) args.splice(parachainIdArgIndex, 1); args.push(`--parachain-id ${parachainId}`); } diff --git a/javascript/packages/orchestrator/src/configGenerator.ts b/javascript/packages/orchestrator/src/configGenerator.ts index 82adc0594..7f5145f79 100644 --- a/javascript/packages/orchestrator/src/configGenerator.ts +++ b/javascript/packages/orchestrator/src/configGenerator.ts @@ -529,11 +529,21 @@ async function getCollatorNodeFromConfig( const ports = await getPorts(provider, collatorConfig); const externalPorts = await getExternalPorts(provider, ports, collatorConfig); + // IFF the collator have explicit set the validator field we use that value, + // if not we set by default cumulus collators as `validators`, this implies that we will + // run those with this flag `--collator`. + const isValidator = + collatorConfig.validator !== undefined + ? collatorConfig.validator + : cumulusBased + ? true + : false; + const node: Node = { name: collatorName, key: getSha256(collatorName), accounts: accountsForNode, - validator: collatorConfig.validator !== false ? true : false, // --collator and --force-authoring by default + validator: isValidator, invulnerable: collatorConfig.invulnerable, balance: collatorConfig.balance, image: collatorConfig.image || DEFAULT_COLLATOR_IMAGE,