Skip to content

Commit

Permalink
feat(cli): use cartesi as compose project name
Browse files Browse the repository at this point in the history
  • Loading branch information
endersonmaia committed May 28, 2024
1 parent 65fb9fd commit ed35df5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 24 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-gorillas-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

use cartesi as compose project name
29 changes: 5 additions & 24 deletions apps/cli/src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,6 @@ export default class Run extends BaseCommand<typeof Run> {

public async run(): Promise<void> {
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(
Expand Down Expand Up @@ -83,8 +68,11 @@ export default class Run extends BaseCommand<typeof Run> {
CARTESI_LISTEN_PORT: listenPort.toString(),
};

// cartesi
const composeFiles = ["docker-compose-cartesi.yaml"];

// validator
const composeFiles = ["docker-compose-validator.yaml"];
composeFiles.push("docker-compose-validator.yaml");

// prompt
composeFiles.push("docker-compose-prompt.yaml");
Expand Down Expand Up @@ -119,14 +107,7 @@ export default class Run extends BaseCommand<typeof Run> {
.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 = [];

Expand Down
1 change: 1 addition & 0 deletions apps/cli/src/node/docker-compose-cartesi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: cartesi

0 comments on commit ed35df5

Please sign in to comment.