@cartesi/cli 1.4.0 → 2.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/baseCommand.d.ts +2 -0
  2. package/dist/baseCommand.d.ts.map +1 -1
  3. package/dist/baseCommand.js +10 -5
  4. package/dist/builder/directory.d.ts +3 -0
  5. package/dist/builder/directory.d.ts.map +1 -0
  6. package/dist/builder/directory.js +37 -0
  7. package/dist/builder/docker.d.ts +10 -0
  8. package/dist/builder/docker.d.ts.map +1 -0
  9. package/dist/builder/docker.js +103 -0
  10. package/dist/builder/empty.d.ts +3 -0
  11. package/dist/builder/empty.d.ts.map +1 -0
  12. package/dist/builder/empty.js +21 -0
  13. package/dist/builder/index.d.ts +6 -0
  14. package/dist/builder/index.d.ts.map +1 -0
  15. package/dist/builder/index.js +5 -0
  16. package/dist/builder/none.d.ts +3 -0
  17. package/dist/builder/none.d.ts.map +1 -0
  18. package/dist/builder/none.js +11 -0
  19. package/dist/builder/tar.d.ts +3 -0
  20. package/dist/builder/tar.d.ts.map +1 -0
  21. package/dist/builder/tar.js +30 -0
  22. package/dist/commands/build.d.ts +3 -15
  23. package/dist/commands/build.d.ts.map +1 -1
  24. package/dist/commands/build.js +53 -194
  25. package/dist/commands/shell.d.ts +2 -1
  26. package/dist/commands/shell.d.ts.map +1 -1
  27. package/dist/commands/shell.js +41 -41
  28. package/dist/config.d.ts +102 -0
  29. package/dist/config.d.ts.map +1 -0
  30. package/dist/config.js +378 -0
  31. package/dist/contracts.d.ts +492 -1038
  32. package/dist/contracts.d.ts.map +1 -1
  33. package/dist/contracts.js +223 -498
  34. package/dist/exec/cartesi-machine.d.ts +9 -0
  35. package/dist/exec/cartesi-machine.d.ts.map +1 -0
  36. package/dist/exec/cartesi-machine.js +20 -0
  37. package/dist/exec/crane.d.ts +15 -0
  38. package/dist/exec/crane.d.ts.map +1 -0
  39. package/dist/exec/crane.js +17 -0
  40. package/dist/exec/genext2fs.d.ts +28 -0
  41. package/dist/exec/genext2fs.d.ts.map +1 -0
  42. package/dist/exec/genext2fs.js +44 -0
  43. package/dist/exec/index.d.ts +5 -0
  44. package/dist/exec/index.d.ts.map +1 -0
  45. package/dist/exec/index.js +4 -0
  46. package/dist/exec/mksquashfs.d.ts +21 -0
  47. package/dist/exec/mksquashfs.d.ts.map +1 -0
  48. package/dist/exec/mksquashfs.js +45 -0
  49. package/dist/exec/util.d.ts +36 -0
  50. package/dist/exec/util.d.ts.map +1 -0
  51. package/dist/exec/util.js +78 -0
  52. package/dist/machine.d.ts +6 -0
  53. package/dist/machine.d.ts.map +1 -0
  54. package/dist/machine.js +80 -0
  55. package/dist/node/docker-compose-anvil.yaml +4 -3
  56. package/dist/node/docker-compose-bundler.yaml +1 -1
  57. package/dist/node/docker-compose-paymaster.yaml +1 -1
  58. package/oclif.manifest.json +32 -95
  59. package/package.json +5 -5
  60. package/dist/commands/send/dapp-address.d.ts +0 -9
  61. package/dist/commands/send/dapp-address.d.ts.map +0 -1
  62. package/dist/commands/send/dapp-address.js +0 -20
@@ -35,27 +35,25 @@
35
35
  "build": {
36
36
  "aliases": [],
37
37
  "args": {},
38
- "description": "Build application starting from a Dockerfile and ending with a snapshot of the corresponding Cartesi Machine already booted and yielded for the first time. This snapshot can be used to start a Cartesi node for the application using `run`. The process can also start from a Docker image built by the developer using `docker build` using the option `--from-image`",
38
+ "description": "Build application by building Cartesi machine drives, configuring a machine and booting it",
39
39
  "examples": [
40
- "<%= config.bin %> <%= command.id %>",
41
- "<%= config.bin %> <%= command.id %> --from-image my-app"
40
+ "<%= config.bin %> <%= command.id %>"
42
41
  ],
43
42
  "flags": {
44
- "from-image": {
45
- "description": "if the build process of the application Dockerfile needs more control the developer can build the image using the `docker build` command, and then start the build process of the Cartesi machine starting from that image.",
46
- "name": "from-image",
47
- "summary": "skip docker build and start from this image.",
43
+ "config": {
44
+ "char": "c",
45
+ "name": "config",
46
+ "summary": "path to the configuration file",
47
+ "default": "cartesi.toml",
48
48
  "hasDynamicHelp": false,
49
49
  "multiple": false,
50
50
  "type": "option"
51
51
  },
52
- "target": {
53
- "description": "if the application Dockerfile uses a multi-stage strategy, and stage of the image to be exported as a Cartesi machine is not the last stage, use this parameter to specify the target stage.",
54
- "name": "target",
55
- "summary": "target of docker multi-stage build.",
56
- "hasDynamicHelp": false,
57
- "multiple": false,
58
- "type": "option"
52
+ "drives-only": {
53
+ "name": "drives-only",
54
+ "summary": "only build drives",
55
+ "allowNo": false,
56
+ "type": "boolean"
59
57
  }
60
58
  },
61
59
  "hasDynamicHelp": false,
@@ -326,9 +324,28 @@
326
324
  "<%= config.bin %> <%= command.id %>"
327
325
  ],
328
326
  "flags": {
327
+ "command": {
328
+ "description": "shell command to run",
329
+ "name": "command",
330
+ "summary": "shell to run",
331
+ "default": "/bin/sh",
332
+ "hasDynamicHelp": false,
333
+ "multiple": false,
334
+ "type": "option"
335
+ },
336
+ "config": {
337
+ "char": "c",
338
+ "name": "config",
339
+ "summary": "path to the configuration file",
340
+ "default": "cartesi.toml",
341
+ "hasDynamicHelp": false,
342
+ "multiple": false,
343
+ "type": "option"
344
+ },
329
345
  "run-as-root": {
330
346
  "description": "run as root user",
331
347
  "name": "run-as-root",
348
+ "summary": "run the cartesi machine as the root user",
332
349
  "allowNo": false,
333
350
  "type": "boolean"
334
351
  }
@@ -437,86 +454,6 @@
437
454
  "index.js"
438
455
  ]
439
456
  },
440
- "send:dapp-address": {
441
- "aliases": [],
442
- "args": {},
443
- "description": "Sends an input to the application with its own address.",
444
- "examples": [
445
- "<%= config.bin %> <%= command.id %>"
446
- ],
447
- "flags": {
448
- "dapp": {
449
- "description": "the address of the DApp, defaults to the deployed DApp address if application is running.",
450
- "name": "dapp",
451
- "summary": "dapp address.",
452
- "hasDynamicHelp": false,
453
- "multiple": false,
454
- "type": "option"
455
- },
456
- "chain-id": {
457
- "char": "c",
458
- "description": "The EIP-155 chain ID.",
459
- "env": "CHAIN",
460
- "helpGroup": "Ethereum",
461
- "name": "chain-id",
462
- "hasDynamicHelp": false,
463
- "multiple": false,
464
- "options": [
465
- "31337",
466
- "421614",
467
- "84532",
468
- "11155420",
469
- "11155111",
470
- "42161",
471
- "8453",
472
- "1",
473
- "10"
474
- ],
475
- "type": "option"
476
- },
477
- "rpc-url": {
478
- "char": "r",
479
- "description": "The RPC endpoint.",
480
- "env": "ETH_RPC_URL",
481
- "helpGroup": "Ethereum",
482
- "name": "rpc-url",
483
- "hasDynamicHelp": false,
484
- "multiple": false,
485
- "type": "option"
486
- },
487
- "mnemonic-passphrase": {
488
- "description": "Use a BIP39 passphrase for the mnemonic.",
489
- "helpGroup": "Wallet",
490
- "name": "mnemonic-passphrase",
491
- "hasDynamicHelp": false,
492
- "multiple": false,
493
- "type": "option"
494
- },
495
- "mnemonic-index": {
496
- "description": "Use the private key from the given mnemonic index.",
497
- "helpGroup": "Wallet",
498
- "name": "mnemonic-index",
499
- "default": 0,
500
- "hasDynamicHelp": false,
501
- "multiple": false,
502
- "type": "option"
503
- }
504
- },
505
- "hasDynamicHelp": false,
506
- "hiddenAliases": [],
507
- "id": "send:dapp-address",
508
- "pluginAlias": "@cartesi/cli",
509
- "pluginName": "@cartesi/cli",
510
- "pluginType": "core",
511
- "summary": "Send DApp address input to the application.",
512
- "isESM": true,
513
- "relativePath": [
514
- "dist",
515
- "commands",
516
- "send",
517
- "dapp-address.js"
518
- ]
519
- },
520
457
  "send:erc20": {
521
458
  "aliases": [],
522
459
  "args": {},
@@ -935,5 +872,5 @@
935
872
  ]
936
873
  }
937
874
  },
938
- "version": "1.4.0"
875
+ "version": "2.0.0-alpha.0"
939
876
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cartesi/cli",
3
- "version": "1.4.0",
3
+ "version": "2.0.0-alpha.0",
4
4
  "description": "Cartesi CLI",
5
5
  "author": "Danilo Tuler <tuler@pobox.com>",
6
6
  "bin": {
@@ -37,6 +37,7 @@
37
37
  "ora": "^8.1.0",
38
38
  "progress-stream": "^2.0.0",
39
39
  "semver": "^7.6.3",
40
+ "smol-toml": "^1.3.0",
40
41
  "tmp": "^0.2.3",
41
42
  "viem": "^2.21.27"
42
43
  },
@@ -64,8 +65,8 @@
64
65
  "tslib": "^2.8.0",
65
66
  "typescript": "^5.6.3",
66
67
  "vitest": "^2.1.3",
68
+ "@cartesi/devnet": "2.0.0-alpha.0",
67
69
  "@cartesi/eslint-config": "0.0.0",
68
- "@cartesi/devnet": "1.8.0",
69
70
  "tsconfig": "0.0.0"
70
71
  },
71
72
  "oclif": {
@@ -93,11 +94,10 @@
93
94
  "clean": "rimraf dist",
94
95
  "codegen": "run-p codegen:wagmi",
95
96
  "codegen:wagmi": "wagmi generate",
96
- "compile": "tsc -b",
97
+ "compile": "tsc -p tsconfig.build.json",
97
98
  "copy-files": "copyfiles -u 1 \"src/**/*.yaml\" \"src/**/*.env\" \"src/**/*.txt\" dist",
98
99
  "lint": "eslint \"src/**/*.ts*\"",
99
100
  "posttest": "pnpm lint",
100
- "test": "vitest",
101
- "test:coverage": "vitest --coverage.enabled true"
101
+ "test": "vitest"
102
102
  }
103
103
  }
@@ -1,9 +0,0 @@
1
- import { Address, PublicClient, WalletClient } from "viem";
2
- import { SendBaseCommand } from "./index.js";
3
- export default class SendAddress extends SendBaseCommand<typeof SendAddress> {
4
- static summary: string;
5
- static description: string;
6
- static examples: string[];
7
- send(publicClient: PublicClient, walletClient: WalletClient): Promise<Address>;
8
- }
9
- //# sourceMappingURL=dapp-address.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dapp-address.d.ts","sourceRoot":"","sources":["../../../src/commands/send/dapp-address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAM3D,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,eAAe,CAAC,OAAO,WAAW,CAAC;IACxE,MAAM,CAAC,OAAO,SAAiD;IAE/D,MAAM,CAAC,WAAW,SAC4C;IAE9D,MAAM,CAAC,QAAQ,WAA2C;IAE7C,IAAI,CACb,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,GAC3B,OAAO,CAAC,OAAO,CAAC;CActB"}
@@ -1,20 +0,0 @@
1
- import { dAppAddressRelayAbi, dAppAddressRelayAddress, } from "../../contracts.js";
2
- import { SendBaseCommand } from "./index.js";
3
- class SendAddress extends SendBaseCommand {
4
- async send(publicClient, walletClient) {
5
- // get dapp address from local node, or ask
6
- const address = await super.getApplicationAddress();
7
- const { request } = await publicClient.simulateContract({
8
- address: dAppAddressRelayAddress,
9
- abi: dAppAddressRelayAbi,
10
- functionName: "relayDAppAddress",
11
- args: [address],
12
- account: walletClient.account,
13
- });
14
- return walletClient.writeContract(request);
15
- }
16
- }
17
- SendAddress.summary = "Send DApp address input to the application.";
18
- SendAddress.description = "Sends an input to the application with its own address.";
19
- SendAddress.examples = ["<%= config.bin %> <%= command.id %>"];
20
- export default SendAddress;