Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/salty-hoops-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

fix ram_image default value
6 changes: 2 additions & 4 deletions apps/cli/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export class InvalidStringArrayError extends Error {
*/
const DEFAULT_FORMAT = "ext2";
const DEFAULT_RAM = "128Mi";
const DEFAULT_RAM_IMAGE = "/usr/share/cartesi-machine/images/linux.bin";
export const DEFAULT_SDK_VERSION = "0.12.0-alpha.20";
export const DEFAULT_SDK_IMAGE = "cartesi/sdk";
export const PREFERRED_PORT = 6751;
Expand Down Expand Up @@ -147,7 +146,7 @@ export type MachineConfig = {
maxMCycle?: bigint; // default given by cartesi-machine
noRollup?: boolean; // default given by cartesi-machine
ramLength: string;
ramImage: string;
ramImage?: string; // default given by cartesi-machine
useDockerEnv: boolean; // inject docker image ENV into cartesi-machine ENV
useDockerWorkdir: boolean; // inject docker image WORKDIR into cartesi-machine WORKDIR
user?: string; // default given by cartesi-machine
Expand Down Expand Up @@ -178,7 +177,6 @@ export const defaultMachineConfig = (): MachineConfig => ({
maxMCycle: undefined,
noRollup: undefined,
ramLength: DEFAULT_RAM,
ramImage: DEFAULT_RAM_IMAGE,
useDockerEnv: true,
useDockerWorkdir: true,
user: undefined,
Expand Down Expand Up @@ -372,7 +370,7 @@ const parseMachine = (value: TomlPrimitive): MachineConfig => {
maxMCycle: parseOptionalNumber(toml.max_mcycle),
noRollup: parseBoolean(toml.no_rollup, false),
ramLength: parseString(toml.ram_length, DEFAULT_RAM),
ramImage: parseString(toml.ram_image, DEFAULT_RAM_IMAGE),
ramImage: parseOptionalString(toml.ram_image),
useDockerEnv: parseBoolean(toml.use_docker_env, true),
useDockerWorkdir: parseBoolean(toml.use_docker_workdir, true),
user: parseOptionalString(toml.user),
Expand Down
4 changes: 3 additions & 1 deletion apps/cli/src/machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ export const bootMachine = (
...bootargs,
...envs,
...flashDrives,
`--ram-image=${ramImage}`,
`--ram-length=${ramLength}`,
];
if (ramImage) {
args.push(`--ram-image=${ramImage}`);
}
if (assertRollingTemplate) {
args.push("--assert-rolling-template");
}
Expand Down
Loading