diff --git a/.changeset/wild-gorillas-decide.md b/.changeset/wild-gorillas-decide.md new file mode 100644 index 00000000..ad949ded --- /dev/null +++ b/.changeset/wild-gorillas-decide.md @@ -0,0 +1,5 @@ +--- +"@cartesi/cli": patch +--- + +use cartesi as compose project name diff --git a/apps/cli/src/commands/run.ts b/apps/cli/src/commands/run.ts index 4dd12bb6..be0261e7 100644 --- a/apps/cli/src/commands/run.ts +++ b/apps/cli/src/commands/run.ts @@ -73,21 +73,6 @@ export default class Run extends BaseCommand { public async run(): Promise { const { flags } = await this.parse(Run); - let projectName: string; - - if (flags["no-backend"]) { - projectName = "cartesi-node"; - } else { - // get machine hash - const hash = this.getMachineHash(); - // Check if snapshot exists - if (!hash) { - throw new Error( - `Cartesi machine snapshot not found, run '${this.config.bin} build'`, - ); - } - projectName = hash.substring(2, 10); - } // path of the tool instalation const binPath = path.join( @@ -118,11 +103,18 @@ export default class Run extends BaseCommand { CARTESI_VALIDATOR_MEMORY: flags.memory?.toString(), }; + // cartesi project name + const composeFiles = ["docker-compose-cartesi.yaml"]; + // validator - const composeFiles = ["docker-compose-validator.yaml"]; + composeFiles.push("docker-compose-validator.yaml"); + + // limit cpu if (flags.cpus) { composeFiles.push("docker-compose-validator-cpus.yaml"); } + + // limit memory if (flags.memory) { composeFiles.push("docker-compose-validator-memory.yaml"); } @@ -171,14 +163,7 @@ export default class Run extends BaseCommand { .map((f) => ["--file", path.join(binPath, "node", f)]) .flat(); - const compose_args = [ - "compose", - ...files, - "--project-directory", - ".", - "--project-name", - projectName, - ]; + const compose_args = ["compose", ...files, "--project-directory", "."]; const up_args = []; diff --git a/apps/cli/src/node/docker-compose-cartesi.yaml b/apps/cli/src/node/docker-compose-cartesi.yaml new file mode 100644 index 00000000..241be776 --- /dev/null +++ b/apps/cli/src/node/docker-compose-cartesi.yaml @@ -0,0 +1 @@ +name: cartesi