@cartesi/cli 2.0.0-alpha.2 → 2.0.0-alpha.20

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 (170) hide show
  1. package/dist/base.d.ts +28 -0
  2. package/dist/base.d.ts.map +1 -0
  3. package/dist/base.js +109 -0
  4. package/dist/builder/directory.d.ts +2 -2
  5. package/dist/builder/directory.d.ts.map +1 -1
  6. package/dist/builder/directory.js +5 -3
  7. package/dist/builder/docker.d.ts +2 -2
  8. package/dist/builder/docker.d.ts.map +1 -1
  9. package/dist/builder/docker.js +39 -37
  10. package/dist/builder/empty.d.ts +1 -1
  11. package/dist/builder/empty.d.ts.map +1 -1
  12. package/dist/builder/empty.js +1 -1
  13. package/dist/builder/none.d.ts +1 -1
  14. package/dist/builder/none.d.ts.map +1 -1
  15. package/dist/builder/none.js +1 -1
  16. package/dist/builder/tar.d.ts +1 -1
  17. package/dist/builder/tar.d.ts.map +1 -1
  18. package/dist/builder/tar.js +1 -1
  19. package/dist/commands/address-book.d.ts +5 -8
  20. package/dist/commands/address-book.d.ts.map +1 -1
  21. package/dist/commands/address-book.js +18 -14
  22. package/dist/commands/build.d.ts +7 -11
  23. package/dist/commands/build.d.ts.map +1 -1
  24. package/dist/commands/build.js +82 -58
  25. package/dist/commands/clean.d.ts +2 -7
  26. package/dist/commands/clean.d.ts.map +1 -1
  27. package/dist/commands/clean.js +9 -10
  28. package/dist/commands/create.d.ts +6 -15
  29. package/dist/commands/create.d.ts.map +1 -1
  30. package/dist/commands/create.js +25 -54
  31. package/dist/commands/deploy/build.d.ts +2 -14
  32. package/dist/commands/deploy/build.d.ts.map +1 -1
  33. package/dist/commands/deploy/build.js +8 -61
  34. package/dist/commands/deploy.d.ts +3 -0
  35. package/dist/commands/deploy.d.ts.map +1 -0
  36. package/dist/commands/deploy.js +12 -0
  37. package/dist/commands/deposit/erc1155.d.ts +18 -0
  38. package/dist/commands/deposit/erc1155.d.ts.map +1 -0
  39. package/dist/commands/deposit/erc1155.js +254 -0
  40. package/dist/commands/deposit/erc20.d.ts +10 -0
  41. package/dist/commands/deposit/erc20.d.ts.map +1 -0
  42. package/dist/commands/deposit/erc20.js +125 -0
  43. package/dist/commands/deposit/erc721.d.ts +10 -0
  44. package/dist/commands/deposit/erc721.d.ts.map +1 -0
  45. package/dist/commands/deposit/erc721.js +143 -0
  46. package/dist/commands/deposit/ether.d.ts +10 -0
  47. package/dist/commands/deposit/ether.d.ts.map +1 -0
  48. package/dist/commands/deposit/ether.js +65 -0
  49. package/dist/commands/deposit.d.ts +9 -0
  50. package/dist/commands/deposit.d.ts.map +1 -0
  51. package/dist/commands/deposit.js +37 -0
  52. package/dist/commands/doctor.d.ts +2 -12
  53. package/dist/commands/doctor.d.ts.map +1 -1
  54. package/dist/commands/doctor.js +90 -91
  55. package/dist/commands/hash.d.ts +4 -9
  56. package/dist/commands/hash.d.ts.map +1 -1
  57. package/dist/commands/hash.js +14 -14
  58. package/dist/commands/logs.d.ts +9 -0
  59. package/dist/commands/logs.d.ts.map +1 -0
  60. package/dist/commands/logs.js +34 -0
  61. package/dist/commands/run.d.ts +14 -20
  62. package/dist/commands/run.d.ts.map +1 -1
  63. package/dist/commands/run.js +193 -182
  64. package/dist/commands/send.d.ts +10 -0
  65. package/dist/commands/send.d.ts.map +1 -0
  66. package/dist/commands/send.js +130 -0
  67. package/dist/commands/shell.d.ts +6 -14
  68. package/dist/commands/shell.d.ts.map +1 -1
  69. package/dist/commands/shell.js +34 -51
  70. package/dist/commands/status.d.ts +6 -0
  71. package/dist/commands/status.d.ts.map +1 -0
  72. package/dist/commands/status.js +50 -0
  73. package/dist/compose/default.env +36 -0
  74. package/dist/compose/docker-compose-anvil.yaml +39 -0
  75. package/dist/compose/docker-compose-bundler.yaml +71 -0
  76. package/dist/{node → compose}/docker-compose-database.yaml +4 -2
  77. package/dist/compose/docker-compose-explorer.yaml +96 -0
  78. package/dist/compose/docker-compose-graphql.yaml +38 -0
  79. package/dist/compose/docker-compose-node-cpus.yaml +6 -0
  80. package/dist/compose/docker-compose-node-memory.yaml +6 -0
  81. package/dist/compose/docker-compose-node.yaml +50 -0
  82. package/dist/compose/docker-compose-passkey-server.yaml +37 -0
  83. package/dist/compose/docker-compose-paymaster.yaml +40 -0
  84. package/dist/compose/docker-compose-proxy.yaml +24 -0
  85. package/dist/config.d.ts +30 -9
  86. package/dist/config.d.ts.map +1 -1
  87. package/dist/config.js +93 -53
  88. package/dist/contracts.d.ts +1695 -1636
  89. package/dist/contracts.d.ts.map +1 -1
  90. package/dist/contracts.js +632 -592
  91. package/dist/exec/cartesi-machine.d.ts +2 -2
  92. package/dist/exec/cartesi-machine.d.ts.map +1 -1
  93. package/dist/exec/cartesi-machine.js +3 -5
  94. package/dist/exec/genext2fs.d.ts +6 -3
  95. package/dist/exec/genext2fs.d.ts.map +1 -1
  96. package/dist/exec/genext2fs.js +5 -5
  97. package/dist/exec/index.d.ts +0 -1
  98. package/dist/exec/index.d.ts.map +1 -1
  99. package/dist/exec/index.js +0 -1
  100. package/dist/exec/mksquashfs.d.ts +2 -2
  101. package/dist/exec/mksquashfs.d.ts.map +1 -1
  102. package/dist/exec/mksquashfs.js +4 -2
  103. package/dist/exec/rollups.d.ts +105 -0
  104. package/dist/exec/rollups.d.ts.map +1 -0
  105. package/dist/exec/rollups.js +383 -0
  106. package/dist/exec/util.d.ts +1 -16
  107. package/dist/exec/util.d.ts.map +1 -1
  108. package/dist/exec/util.js +3 -50
  109. package/dist/index.d.ts +2 -1
  110. package/dist/index.d.ts.map +1 -1
  111. package/dist/index.js +57 -1
  112. package/dist/machine.d.ts +8 -2
  113. package/dist/machine.d.ts.map +1 -1
  114. package/dist/machine.js +26 -16
  115. package/dist/prompts.d.ts +13 -2
  116. package/dist/prompts.d.ts.map +1 -1
  117. package/dist/prompts.js +60 -26
  118. package/dist/template.d.ts +3 -0
  119. package/dist/template.d.ts.map +1 -0
  120. package/dist/template.js +16 -0
  121. package/dist/wallet.d.ts +9222 -21
  122. package/dist/wallet.d.ts.map +1 -1
  123. package/dist/wallet.js +35 -198
  124. package/package.json +39 -57
  125. package/bin/dev.cmd +0 -3
  126. package/bin/dev.js +0 -25
  127. package/bin/run.cmd +0 -3
  128. package/bin/run.js +0 -8
  129. package/dist/baseCommand.d.ts +0 -22
  130. package/dist/baseCommand.d.ts.map +0 -1
  131. package/dist/baseCommand.js +0 -92
  132. package/dist/commands/deploy/index.d.ts +0 -12
  133. package/dist/commands/deploy/index.d.ts.map +0 -1
  134. package/dist/commands/deploy/index.js +0 -78
  135. package/dist/commands/send/erc20.d.ts +0 -14
  136. package/dist/commands/send/erc20.d.ts.map +0 -1
  137. package/dist/commands/send/erc20.js +0 -70
  138. package/dist/commands/send/erc721.d.ts +0 -14
  139. package/dist/commands/send/erc721.d.ts.map +0 -1
  140. package/dist/commands/send/erc721.js +0 -73
  141. package/dist/commands/send/ether.d.ts +0 -13
  142. package/dist/commands/send/ether.d.ts.map +0 -1
  143. package/dist/commands/send/ether.js +0 -32
  144. package/dist/commands/send/generic.d.ts +0 -15
  145. package/dist/commands/send/generic.d.ts.map +0 -1
  146. package/dist/commands/send/generic.js +0 -119
  147. package/dist/commands/send/index.d.ts +0 -28
  148. package/dist/commands/send/index.d.ts.map +0 -1
  149. package/dist/commands/send/index.js +0 -102
  150. package/dist/exec/crane.d.ts +0 -15
  151. package/dist/exec/crane.d.ts.map +0 -1
  152. package/dist/exec/crane.js +0 -17
  153. package/dist/flags.d.ts +0 -17
  154. package/dist/flags.d.ts.map +0 -1
  155. package/dist/flags.js +0 -28
  156. package/dist/node/DockerfileDeploy.txt +0 -4
  157. package/dist/node/default.env +0 -27
  158. package/dist/node/docker-compose-anvil.yaml +0 -50
  159. package/dist/node/docker-compose-bundler.yaml +0 -57
  160. package/dist/node/docker-compose-envfile.yaml +0 -4
  161. package/dist/node/docker-compose-explorer.yaml +0 -88
  162. package/dist/node/docker-compose-host.yaml +0 -30
  163. package/dist/node/docker-compose-paymaster.yaml +0 -33
  164. package/dist/node/docker-compose-prompt.yaml +0 -17
  165. package/dist/node/docker-compose-proxy.yaml +0 -48
  166. package/dist/node/docker-compose-snapshot-volume.yaml +0 -8
  167. package/dist/node/docker-compose-validator-cpus.yaml +0 -6
  168. package/dist/node/docker-compose-validator-memory.yaml +0 -6
  169. package/dist/node/docker-compose-validator.yaml +0 -59
  170. package/oclif.manifest.json +0 -876
@@ -1,5 +1,5 @@
1
- import { Range, SemVer } from "semver";
2
- import { DockerFallbackOptions, ExecaOptionsDockerFallback } from "./util.js";
1
+ import { Range, type SemVer } from "semver";
2
+ import { type DockerFallbackOptions, type ExecaOptionsDockerFallback } from "./util.js";
3
3
  export declare const requiredVersion: Range;
4
4
  export declare const boot: (args: readonly string[], options: ExecaOptionsDockerFallback) => Promise<import("execa").Result<import("execa").Options & {
5
5
  image?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"cartesi-machine.d.ts","sourceRoot":"","sources":["../../src/exec/cartesi-machine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACH,qBAAqB,EAErB,0BAA0B,EAC7B,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,eAAe,OAAuB,CAAC;AAEpD,eAAO,MAAM,IAAI,SACP,SAAS,MAAM,EAAE,WACd,0BAA0B;;;GAGtC,CAAC;AAEF,eAAO,MAAM,OAAO,aACN,qBAAqB,KAChC,OAAO,CAAC,MAAM,GAAG,IAAI,CAgBvB,CAAC"}
1
+ {"version":3,"file":"cartesi-machine.d.ts","sourceRoot":"","sources":["../../src/exec/cartesi-machine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,EAEH,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAClC,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,eAAe,OAAuB,CAAC;AAEpD,eAAO,MAAM,IAAI,GACb,MAAM,SAAS,MAAM,EAAE,EACvB,SAAS,0BAA0B;;;GACmB,CAAC;AAE3D,eAAO,MAAM,OAAO,GAChB,UAAU,qBAAqB,KAChC,OAAO,CAAC,MAAM,GAAG,IAAI,CAgBvB,CAAC"}
@@ -1,9 +1,7 @@
1
1
  import { parse, Range } from "semver";
2
2
  import { execaDockerFallback, } from "./util.js";
3
- export const requiredVersion = new Range("^0.18.1");
4
- export const boot = async (args, options) => {
5
- return execaDockerFallback("cartesi-machine", args, options);
6
- };
3
+ export const requiredVersion = new Range("^0.19.0");
4
+ export const boot = (args, options) => execaDockerFallback("cartesi-machine", args, options);
7
5
  export const version = async (options) => {
8
6
  const { image } = options || {};
9
7
  try {
@@ -14,7 +12,7 @@ export const version = async (options) => {
14
12
  }
15
13
  return null;
16
14
  }
17
- catch (e) {
15
+ catch {
18
16
  return null;
19
17
  }
20
18
  };
@@ -1,11 +1,14 @@
1
- import { Range, SemVer } from "semver";
2
- import { DockerFallbackOptions } from "./util.js";
1
+ import { Range, type SemVer } from "semver";
2
+ import { type DockerFallbackOptions } from "./util.js";
3
3
  export declare const requiredVersion: Range;
4
4
  export declare const empty: (options: {
5
5
  cwd?: string;
6
6
  size: number;
7
7
  output: string;
8
- } & DockerFallbackOptions) => Promise<void>;
8
+ } & DockerFallbackOptions) => Promise<import("execa").Result<import("execa").Options & {
9
+ image?: string;
10
+ forceDocker?: false;
11
+ }>>;
9
12
  export declare const fromDirectory: (options: {
10
13
  cwd?: string;
11
14
  extraSize: number;
@@ -1 +1 @@
1
- {"version":3,"file":"genext2fs.d.ts","sourceRoot":"","sources":["../../src/exec/genext2fs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAuB,MAAM,WAAW,CAAC;AAIvE,eAAO,MAAM,eAAe,EAAE,KAA2B,CAAC;AAU1D,eAAO,MAAM,KAAK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GAChB,SAAS;IACL,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAClB,GAAG,qBAAqB;;;GAS5B,CAAC;AAEF,eAAO,MAAM,OAAO,GAChB,UAAU,qBAAqB,KAChC,OAAO,CAAC,MAAM,GAAG,IAAI,CAevB,CAAC"}
@@ -9,10 +9,10 @@ const baseArgs = (options) => [
9
9
  "--readjustment",
10
10
  `+${options.extraBlocks}`,
11
11
  ];
12
- export const empty = async (options) => {
12
+ export const empty = (options) => {
13
13
  const { size, output } = options;
14
14
  const blocks = Math.ceil(size / BLOCK_SIZE); // size in blocks
15
- await execaDockerFallback("xgenext2fs", [
15
+ return execaDockerFallback("xgenext2fs", [
16
16
  "--block-size",
17
17
  BLOCK_SIZE.toString(),
18
18
  "--faketime",
@@ -21,12 +21,12 @@ export const empty = async (options) => {
21
21
  output,
22
22
  ], options);
23
23
  };
24
- export const fromDirectory = async (options) => {
24
+ export const fromDirectory = (options) => {
25
25
  const { cwd, extraSize, image, input, output } = options;
26
26
  const extraBlocks = Math.ceil(extraSize / BLOCK_SIZE);
27
27
  return execaDockerFallback("xgenext2fs", [...baseArgs({ extraBlocks }), "--root", input, output], { cwd, image });
28
28
  };
29
- export const fromTar = async (options) => {
29
+ export const fromTar = (options) => {
30
30
  const { cwd, extraSize, image, input, output } = options;
31
31
  const extraBlocks = Math.ceil(extraSize / BLOCK_SIZE);
32
32
  return execaDockerFallback("xgenext2fs", [...baseArgs({ extraBlocks }), "--tarball", input, output], { cwd, image });
@@ -36,7 +36,7 @@ export const version = async (options) => {
36
36
  if (typeof stdout === "string") {
37
37
  const regex = /(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?/;
38
38
  const m = stdout.match(regex);
39
- if (m && m[0]) {
39
+ if (m?.[0]) {
40
40
  return parse(m[0]);
41
41
  }
42
42
  }
@@ -1,5 +1,4 @@
1
1
  export * as cartesiMachine from "./cartesi-machine.js";
2
- export * as crane from "./crane.js";
3
2
  export * as genext2fs from "./genext2fs.js";
4
3
  export * as mksquashfs from "./mksquashfs.js";
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exec/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/exec/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC"}
@@ -1,4 +1,3 @@
1
1
  export * as cartesiMachine from "./cartesi-machine.js";
2
- export * as crane from "./crane.js";
3
2
  export * as genext2fs from "./genext2fs.js";
4
3
  export * as mksquashfs from "./mksquashfs.js";
@@ -1,5 +1,5 @@
1
- import { Range, SemVer } from "semver";
2
- import { DockerFallbackOptions } from "./util.js";
1
+ import { Range, type SemVer } from "semver";
2
+ import { type DockerFallbackOptions } from "./util.js";
3
3
  export declare const requiredVersion: Range;
4
4
  export declare const fromDirectory: (options: {
5
5
  cwd?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"mksquashfs.d.ts","sourceRoot":"","sources":["../../src/exec/mksquashfs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAA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 +1,12 @@
1
- import { parse, Range } from "semver";
1
+ import { Range, parse } from "semver";
2
2
  import { execaDockerFallback } from "./util.js";
3
3
  const COMPRESSION = "lzo"; // make customizable? default is gzip
4
4
  export const requiredVersion = new Range("^4.5.1");
5
5
  const baseArgs = () => [
6
6
  "-all-time",
7
7
  "0",
8
+ "-mkfs-time",
9
+ "0",
8
10
  "-all-root", // XXX: should we use this?
9
11
  "-noappend",
10
12
  "-comp",
@@ -32,7 +34,7 @@ export const version = async (options) => {
32
34
  if (typeof stdout === "string") {
33
35
  const regex = /(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?/gm;
34
36
  const m = stdout.match(regex);
35
- if (m && m[0]) {
37
+ if (m?.[0]) {
36
38
  return parse(m[0]);
37
39
  }
38
40
  }
@@ -0,0 +1,105 @@
1
+ import { type Address, type Hash, type Hex } from "viem";
2
+ export type RollupsDeployment = {
3
+ name: string;
4
+ address: Address;
5
+ consensus: Address;
6
+ templateHash: Hash;
7
+ epochLength: number;
8
+ state: "ENABLED" | "DISABLED";
9
+ };
10
+ type ComposeParams = {
11
+ projectName: string;
12
+ };
13
+ export declare const getDeployments: (options: ComposeParams) => Promise<RollupsDeployment[]>;
14
+ export declare const getApplicationDeployment: (options: ComposeParams) => Promise<RollupsDeployment | undefined>;
15
+ export declare const getApplicationAddress: (options: {
16
+ projectName?: string;
17
+ }) => Promise<Address | undefined>;
18
+ export declare const AVAILABLE_SERVICES: string[];
19
+ export declare const startEnvironment: (options: {
20
+ blockTime: number;
21
+ cpus?: number;
22
+ defaultBlock: string;
23
+ dryRun: boolean;
24
+ memory?: number;
25
+ port: number;
26
+ projectName: string;
27
+ runtimeVersion: string;
28
+ services: string[];
29
+ verbose: boolean;
30
+ }) => Promise<{
31
+ address: string;
32
+ config: string;
33
+ } | {
34
+ address: string;
35
+ config?: undefined;
36
+ }>;
37
+ /**
38
+ * Wait for the environment to be healthy
39
+ * @param options
40
+ */
41
+ export declare const waitHealthyEnvironment: (options: {
42
+ name?: string;
43
+ port: number;
44
+ projectName: string;
45
+ services: string[];
46
+ }) => Promise<void>;
47
+ /**
48
+ * Publish machine snapshot to rollups node by copying it to the rollups node container
49
+ * @param options
50
+ * @returns path to the snapshot in the rollups node
51
+ */
52
+ export declare const publishMachine: (options: {
53
+ projectName: string;
54
+ templateHash: Hash;
55
+ }) => Promise<string>;
56
+ /**
57
+ * Stop an environment by removing the containers and volumes
58
+ * @param options
59
+ * @returns
60
+ */
61
+ export declare const stopEnvironment: (options: {
62
+ projectName: string;
63
+ }) => Promise<import("execa").Result<{}>>;
64
+ /**
65
+ * Deploy application to rollups node
66
+ * @param options
67
+ * @returns address of the application
68
+ */
69
+ export declare const deployAuthority: (options: {
70
+ epochLength: number;
71
+ projectName: string;
72
+ }) => Promise<Address>;
73
+ /**
74
+ * Deploy application to rollups node
75
+ * @param options
76
+ * @returns address of the application
77
+ */
78
+ export declare const deployApplication: (options: {
79
+ consensus?: Address;
80
+ epochLength: number;
81
+ name: string;
82
+ projectName: string;
83
+ salt?: Hex;
84
+ snapshotPath: string;
85
+ }) => Promise<RollupsDeployment>;
86
+ /**
87
+ * Remove application from rollups node
88
+ * @param options
89
+ * @returns
90
+ */
91
+ export declare const removeApplication: (options: {
92
+ application: string | Address;
93
+ force: boolean;
94
+ projectName: string;
95
+ }) => Promise<import("execa").Result<{}>>;
96
+ /**
97
+ * Get the host and port of the docker compose project entrypoint
98
+ * @param options
99
+ * @returns port of the proxy service
100
+ */
101
+ export declare const getProjectPort: (options: {
102
+ projectName: string;
103
+ }) => Promise<string>;
104
+ export {};
105
+ //# sourceMappingURL=rollups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollups.d.ts","sourceRoot":"","s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C,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB,kBA4BA,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAU,SAAS;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,IAAI,CAAC;CACtB,KAAG,OAAO,CAAC,MAAM,CAajB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAU,SAAS;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,wCASrE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAU,SAAS;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACvB,KAAG,OAAO,CAAC,OAAO,CAmBlB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAU,SAAS;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;CACxB,KAAG,OAAO,CAAC,iBAAiB,CAmC5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAU,SAAS;IAC7C,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACvB,wCAkCA,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAU,SAAS;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,oBAWpE,CAAC"}
@@ -0,0 +1,383 @@
1
+ import chalk from "chalk";
2
+ import { execa } from "execa";
3
+ import { Listr } from "listr2";
4
+ import path from "node:path";
5
+ import pRetry from "p-retry";
6
+ import { getAddress, hexToNumber, } from "viem";
7
+ import { getContextPath, getMachineHash, getProjectName, getServiceHealth, } from "../base.js";
8
+ import { DEFAULT_SDK_IMAGE } from "../config.js";
9
+ const parseDeployment = (deployment) => ({
10
+ address: deployment.iapplication_address,
11
+ consensus: deployment.iconsensus_address,
12
+ epochLength: hexToNumber(deployment.epoch_length),
13
+ name: deployment.name,
14
+ state: deployment.state,
15
+ templateHash: deployment.template_hash,
16
+ });
17
+ export const getDeployments = async (options) => {
18
+ try {
19
+ const { stdout } = await execa("docker", [
20
+ "compose",
21
+ "--project-name",
22
+ options.projectName,
23
+ "exec",
24
+ "rollups-node",
25
+ "cartesi-rollups-cli",
26
+ "app",
27
+ "list",
28
+ ]);
29
+ return JSON.parse(stdout).map(parseDeployment);
30
+ }
31
+ catch {
32
+ return [];
33
+ }
34
+ };
35
+ export const getApplicationDeployment = async (options) => {
36
+ const machineHash = getMachineHash();
37
+ if (!machineHash) {
38
+ return undefined;
39
+ }
40
+ const deployments = await getDeployments(options);
41
+ return deployments.find((deployment) => deployment.templateHash === machineHash);
42
+ };
43
+ export const getApplicationAddress = async (options) => {
44
+ const projectName = getProjectName(options ?? {});
45
+ const deployment = await getApplicationDeployment({ projectName });
46
+ return deployment?.address;
47
+ };
48
+ const host = "http://127.0.0.1";
49
+ // services configuration
50
+ const baseServices = [
51
+ {
52
+ name: "anvil",
53
+ file: "docker-compose-anvil.yaml",
54
+ healthySemaphore: "anvil",
55
+ healthyTitle: (port) => `${chalk.cyan("anvil")} service ready at ${chalk.cyan(`${host}:${port}/anvil`)}`,
56
+ waitTitle: `${chalk.cyan("anvil")} service starting...`,
57
+ errorTitle: `${chalk.red("anvil")} service failed`,
58
+ },
59
+ {
60
+ name: "proxy",
61
+ file: "docker-compose-proxy.yaml",
62
+ },
63
+ {
64
+ name: "database",
65
+ file: "docker-compose-database.yaml",
66
+ },
67
+ {
68
+ name: "rpc",
69
+ file: "docker-compose-node.yaml",
70
+ healthySemaphore: "rollups-node",
71
+ healthyTitle: (port) => `${chalk.cyan("rpc")} service ready at ${chalk.cyan(`${host}:${port}/rpc`)}`,
72
+ waitTitle: `${chalk.cyan("rpc")} service starting...`,
73
+ errorTitle: `${chalk.red("rpc")} service failed`,
74
+ },
75
+ {
76
+ name: "inspect",
77
+ file: "docker-compose-node.yaml",
78
+ healthySemaphore: "rollups-node",
79
+ healthyTitle: (port, name) => `${chalk.cyan("inspect")} service ready at ${chalk.cyan(`${host}:${port}/inspect/${name ?? "<application_address>"}`)}`,
80
+ waitTitle: `${chalk.cyan("inspect")} service starting...`,
81
+ errorTitle: `${chalk.red("inspect")} service failed`,
82
+ },
83
+ ];
84
+ const availableServices = [
85
+ {
86
+ name: "bundler",
87
+ file: "docker-compose-bundler.yaml",
88
+ healthySemaphore: "bundler",
89
+ healthyTitle: (port) => `${chalk.cyan("bundler")} service ready at ${chalk.cyan(`${host}:${port}/bundler/rpc`)}`,
90
+ waitTitle: `${chalk.cyan("bundler")} service starting...`,
91
+ errorTitle: `${chalk.red("bundler")} service failed`,
92
+ },
93
+ {
94
+ name: "explorer",
95
+ file: "docker-compose-explorer.yaml",
96
+ healthySemaphore: "explorer_api",
97
+ healthyTitle: (port) => `${chalk.cyan("explorer")} service ready at ${chalk.cyan(`${host}:${port}/explorer`)}`,
98
+ waitTitle: `${chalk.cyan("explorer")} service starting...`,
99
+ errorTitle: `${chalk.red("explorer")} service failed`,
100
+ },
101
+ {
102
+ name: "graphql",
103
+ file: "docker-compose-graphql.yaml",
104
+ healthySemaphore: "graphql",
105
+ healthyTitle: (port) => `${chalk.cyan("graphql")} service ready at ${chalk.cyan(`${host}:${port}/graphql`)}`,
106
+ waitTitle: `${chalk.cyan("graphql")} service starting...`,
107
+ errorTitle: `${chalk.red("graphql")} service failed`,
108
+ },
109
+ {
110
+ name: "paymaster",
111
+ file: "docker-compose-paymaster.yaml",
112
+ healthySemaphore: "paymaster",
113
+ healthyTitle: (port) => `${chalk.cyan("paymaster")} service ready at ${chalk.cyan(`${host}:${port}/paymaster`)}`,
114
+ waitTitle: `${chalk.cyan("paymaster")} service starting...`,
115
+ errorTitle: `${chalk.red("paymaster")} service failed`,
116
+ },
117
+ {
118
+ name: "passkey",
119
+ file: "docker-compose-passkey-server.yaml",
120
+ healthySemaphore: "passkey-server",
121
+ healthyTitle: (port) => `${chalk.cyan("passkey")} service ready at ${chalk.cyan(`${host}:${port}/passkey`)}`,
122
+ waitTitle: `${chalk.cyan("passkey")} service starting...`,
123
+ errorTitle: `${chalk.red("passkey")} service failed`,
124
+ },
125
+ ];
126
+ export const AVAILABLE_SERVICES = availableServices.map(({ name }) => name);
127
+ const serviceMonitorTask = (options) => {
128
+ const { errorTitle, healthyTitle, service, waitTitle } = options;
129
+ return {
130
+ task: async (_ctx, task) => {
131
+ await pRetry(async () => {
132
+ const health = await getServiceHealth(options);
133
+ if (health !== "healthy") {
134
+ throw new Error(errorTitle ??
135
+ `Service ${chalk.cyan(service)} is not healthy`);
136
+ }
137
+ }, { retries: 100, minTimeout: 500, factor: 1.1 });
138
+ task.title =
139
+ healthyTitle ?? `Service ${chalk.cyan(service)} is ready`;
140
+ },
141
+ title: waitTitle ?? `Starting ${chalk.cyan(service)}...`,
142
+ };
143
+ };
144
+ export const startEnvironment = async (options) => {
145
+ const { blockTime, cpus, defaultBlock, dryRun, memory, port, projectName, runtimeVersion, services, verbose, } = options;
146
+ const address = `${host}:${port}`;
147
+ // path of the tool instalation
148
+ const binPath = path.join(path.dirname(new URL(import.meta.url).pathname), "..");
149
+ // setup the environment variable used in docker compose
150
+ const env = {
151
+ CARTESI_BIN_PATH: binPath,
152
+ CARTESI_BLOCK_TIME: blockTime.toString(),
153
+ CARTESI_BLOCKCHAIN_DEFAULT_BLOCK: defaultBlock,
154
+ CARTESI_LISTEN_PORT: port.toString(),
155
+ CARTESI_LOG_LEVEL: verbose ? "debug" : "info",
156
+ CARTESI_ROLLUPS_NODE_CPUS: cpus?.toString(),
157
+ CARTESI_ROLLUPS_NODE_MEMORY: memory?.toString(),
158
+ CARTESI_SDK_IMAGE: `${DEFAULT_SDK_IMAGE}:${runtimeVersion}`,
159
+ CARTESI_SDK_VERSION: runtimeVersion,
160
+ };
161
+ // build a list of unique compose files
162
+ const composeFiles = [...new Set(baseServices.map(({ file }) => file))];
163
+ // cpu and memory limits, mostly for testing and debuggingpurposes
164
+ if (cpus) {
165
+ composeFiles.push("docker-compose-node-cpus.yaml");
166
+ }
167
+ if (memory) {
168
+ composeFiles.push("docker-compose-node-memory.yaml");
169
+ }
170
+ // select subset of optional services
171
+ const optionalServices = services.length === 1 && services[0] === "all"
172
+ ? availableServices
173
+ : availableServices.filter(({ name }) => services.includes(name));
174
+ // add to compose files list
175
+ composeFiles.push(...optionalServices.map(({ file }) => file));
176
+ // create the "--file <file>" list
177
+ const files = composeFiles.flatMap((f) => [
178
+ "--file",
179
+ path.join(binPath, "compose", f),
180
+ ]);
181
+ const composeArgs = [
182
+ "compose",
183
+ ...files,
184
+ "--project-directory",
185
+ ".",
186
+ "--project-name",
187
+ projectName,
188
+ ];
189
+ // run in detached mode (background)
190
+ const upArgs = ["--detach"];
191
+ // if only dry run, just return the config
192
+ if (dryRun) {
193
+ // parse, resolve and render compose file in canonical format
194
+ const { stdout: config } = await execa("docker", [...composeArgs, "config", "--format", "yaml"], { env });
195
+ return { address, config };
196
+ }
197
+ // pull images first
198
+ const pullArgs = ["--policy", "missing"];
199
+ await execa("docker", [...composeArgs, "pull", ...pullArgs], {
200
+ env,
201
+ stdio: "inherit",
202
+ });
203
+ // run compose
204
+ await execa("docker", [...composeArgs, "up", ...upArgs], {
205
+ env,
206
+ });
207
+ return { address };
208
+ };
209
+ /**
210
+ * Wait for the environment to be healthy
211
+ * @param options
212
+ */
213
+ export const waitHealthyEnvironment = async (options) => {
214
+ const { name, port, projectName, services } = options;
215
+ // select subset of optional services
216
+ const optionalServices = services.length === 1 && services[0] === "all"
217
+ ? availableServices
218
+ : availableServices.filter(({ name }) => services.includes(name));
219
+ // create tasks to monitor services startup
220
+ const monitorTasks = [...baseServices, ...optionalServices]
221
+ .filter(({ healthySemaphore }) => !!healthySemaphore) // only services with a healthy semaphore
222
+ .map((service) => {
223
+ const healthyTitle = typeof service.healthyTitle === "function"
224
+ ? service.healthyTitle(port, name)
225
+ : service.healthyTitle;
226
+ return serviceMonitorTask({
227
+ projectName,
228
+ service: service.healthySemaphore,
229
+ errorTitle: service.errorTitle,
230
+ waitTitle: service.waitTitle,
231
+ healthyTitle,
232
+ });
233
+ });
234
+ const tasks = new Listr(monitorTasks, { concurrent: true });
235
+ await tasks.run();
236
+ };
237
+ /**
238
+ * Publish machine snapshot to rollups node by copying it to the rollups node container
239
+ * @param options
240
+ * @returns path to the snapshot in the rollups node
241
+ */
242
+ export const publishMachine = async (options) => {
243
+ const { projectName, templateHash } = options;
244
+ const snapshotPath = getContextPath("image");
245
+ const containerSnapshotPath = `/var/lib/cartesi-rollups-node/snapshots/${templateHash}/`;
246
+ await execa("docker", [
247
+ "compose",
248
+ "--project-name",
249
+ projectName,
250
+ "cp",
251
+ snapshotPath,
252
+ `rollups-node:${containerSnapshotPath}`,
253
+ ]);
254
+ return containerSnapshotPath;
255
+ };
256
+ /**
257
+ * Stop an environment by removing the containers and volumes
258
+ * @param options
259
+ * @returns
260
+ */
261
+ export const stopEnvironment = async (options) => {
262
+ const { projectName } = options;
263
+ return execa("docker", [
264
+ "compose",
265
+ "--project-name",
266
+ projectName,
267
+ "down",
268
+ "--volumes",
269
+ ]);
270
+ };
271
+ /**
272
+ * Deploy application to rollups node
273
+ * @param options
274
+ * @returns address of the application
275
+ */
276
+ export const deployAuthority = async (options) => {
277
+ const { epochLength, projectName } = options;
278
+ // deploy application
279
+ const { stdout } = await execa("docker", [
280
+ "compose",
281
+ "--project-name",
282
+ projectName,
283
+ "exec",
284
+ "rollups-node",
285
+ "cartesi-rollups-cli",
286
+ "deploy",
287
+ "authority",
288
+ "--epoch-length",
289
+ epochLength.toString(),
290
+ "--json",
291
+ ]);
292
+ return getAddress(JSON.parse(stdout).address);
293
+ };
294
+ /**
295
+ * Deploy application to rollups node
296
+ * @param options
297
+ * @returns address of the application
298
+ */
299
+ export const deployApplication = async (options) => {
300
+ const { consensus, epochLength, name, projectName, salt, snapshotPath } = options;
301
+ // app deploy args
302
+ const deployArgs = [name, snapshotPath];
303
+ if (consensus) {
304
+ deployArgs.push("--consensus", consensus);
305
+ }
306
+ else {
307
+ deployArgs.push("--epoch-length", epochLength.toString());
308
+ }
309
+ if (salt) {
310
+ deployArgs.push("--salt", salt);
311
+ }
312
+ deployArgs.push("--json");
313
+ // deploy application
314
+ const { stdout } = await execa("docker", [
315
+ "compose",
316
+ "--project-name",
317
+ projectName,
318
+ "exec",
319
+ "rollups-node",
320
+ "cartesi-rollups-cli",
321
+ "deploy",
322
+ "application",
323
+ ...deployArgs,
324
+ ]);
325
+ const deployment = stdout ? parseDeployment(JSON.parse(stdout)) : undefined;
326
+ if (deployment) {
327
+ return deployment;
328
+ }
329
+ throw new Error("Failed to deploy application");
330
+ };
331
+ /**
332
+ * Remove application from rollups node
333
+ * @param options
334
+ * @returns
335
+ */
336
+ export const removeApplication = async (options) => {
337
+ const { application, force, projectName } = options;
338
+ // disable application first so we can remove it
339
+ await execa("docker", [
340
+ "compose",
341
+ "--project-name",
342
+ projectName,
343
+ "exec",
344
+ "rollups-node",
345
+ "cartesi-rollups-cli",
346
+ "app",
347
+ "status",
348
+ application,
349
+ "disabled",
350
+ ]);
351
+ const removeArgs = [application];
352
+ if (force) {
353
+ removeArgs.push("--force");
354
+ }
355
+ return execa("docker", [
356
+ "compose",
357
+ "--project-name",
358
+ projectName,
359
+ "exec",
360
+ "rollups-node",
361
+ "cartesi-rollups-cli",
362
+ "app",
363
+ "remove",
364
+ ...removeArgs,
365
+ ]);
366
+ };
367
+ /**
368
+ * Get the host and port of the docker compose project entrypoint
369
+ * @param options
370
+ * @returns port of the proxy service
371
+ */
372
+ export const getProjectPort = async (options) => {
373
+ const { projectName } = options;
374
+ const { stdout } = await execa("docker", [
375
+ "compose",
376
+ "--project-name",
377
+ projectName,
378
+ "port",
379
+ "proxy",
380
+ "8088",
381
+ ]);
382
+ return stdout;
383
+ };
@@ -1,5 +1,4 @@
1
- import { SpawnSyncOptions } from "child_process";
2
- import { Options } from "execa";
1
+ import { type Options } from "execa";
3
2
  export type DockerFallbackOptions = {
4
3
  image: string;
5
4
  forceDocker: true;
@@ -19,18 +18,4 @@ export declare const execaDockerFallback: (command: string, args: readonly strin
19
18
  image?: string;
20
19
  forceDocker?: false;
21
20
  }>>;
22
- /**
23
- * Calls spawnSync and falls back to docker run if command (on the host) fails
24
- * @param command command to be executed
25
- * @param args arguments to be passed to the command
26
- * @param options execution options
27
- * @returns return of execa
28
- */
29
- export type SpawnOptionsDockerFallback = SpawnSyncOptions & DockerFallbackOptions;
30
- export declare const spawnSyncDockerFallback: (command: string, args: readonly string[], options: SpawnOptionsDockerFallback) => import("child_process").SpawnSyncReturns<string | Buffer> | {
31
- error: {
32
- code: string;
33
- };
34
- stdout: string;
35
- };
36
21
  //# sourceMappingURL=util.d.ts.map