Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(orchestrator): add default_args for parachain #1952

Merged
merged 2 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/src/network-definition-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ The network config can be provided both in `json` or `toml` format and each sect
- `*id`: (Number) The id to assign to this parachain. Must be unique.
- `add_to_genesis`: (Boolean, default true) flag to add parachain to genesis or register in runtime.
- `cumulus_based`: (Boolean, default true) flag to use `cumulus` command generation.
- `default_args`: (Array of strings) An array of arguments to use as default to pass to the `command` side. _NOTE_: this args will be passed to the collator side and shouldn't include _args_ to the full node.
- `genesis_wasm_path`: (String) Path to the wasm file to use.
- `genesis_wasm_generator`: (String) Command to generate the wasm file.
- `genesis_state_path`: (String) Path to the state file to use.
Expand Down
4 changes: 2 additions & 2 deletions javascript/packages/cli/src/actions/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function convertSimpleParachain(
invulnerable: true,
};

return { id: +id, collators: [collator] };
return { id: +id, collators: [collator], default_args: [] };
}

function convertParachain(
Expand All @@ -133,7 +133,7 @@ function convertParachain(
}),
);

return { id: +id, chain, collators };
return { id: +id, chain, collators, default_args: [] };
}

function convertHrmpChannels(
Expand Down
3 changes: 2 additions & 1 deletion javascript/packages/orchestrator/src/configGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ export async function generateNetworkSpec(
name: getUniqueName(parachain.id.toString()),
para,
cumulusBased: isCumulusBased,
defaultArgs: parachain.default_args || [],
addToGenesis:
parachain.add_to_genesis === undefined
? true
Expand Down Expand Up @@ -553,7 +554,7 @@ async function getCollatorNodeFromConfig(
cumulusBased: boolean,
group?: string,
): Promise<Node> {
let args: string[] = [];
let args: string[] = sanitizeArgs(parachain.default_args || []);

const env = collatorConfig.env
? DEFAULT_ENV.concat(collatorConfig.env)
Expand Down
1 change: 1 addition & 0 deletions javascript/packages/orchestrator/src/configTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export interface ParachainConfig extends CommonParachainConfig {
collator?: NodeConfig;
collators?: NodeConfig[];
collator_groups?: NodeGroupConfig[];
default_args: string[];
}

export interface NodeGroupConfig extends NodeCommonTypes {
Expand Down
1 change: 1 addition & 0 deletions javascript/packages/orchestrator/src/sharedTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export interface Parachain extends CommonParachainConfig {
wasmPath?: string;
statePath?: string;
collators: Node[];
defaultArgs: string[];
}

export interface Node extends NodeCommonTypes, Ports {
Expand Down
1 change: 1 addition & 0 deletions javascript/packages/utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export interface ParachainConfig {
collators?: NodeConfig[];
collator_groups?: NodeGroupConfig[];
genesis?: JSON | ObjectJSON;
default_args: string[];
}

export interface HrmpChannelsConfig {
Expand Down
Loading