@cartesi/cli 2.0.0-alpha.0 → 2.0.0-alpha.11

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 (153) hide show
  1. package/dist/base.d.ts +18 -0
  2. package/dist/base.d.ts.map +1 -0
  3. package/dist/base.js +103 -0
  4. package/dist/builder/directory.d.ts.map +1 -1
  5. package/dist/builder/docker.d.ts.map +1 -1
  6. package/dist/builder/docker.js +10 -1
  7. package/dist/builder/empty.d.ts.map +1 -1
  8. package/dist/builder/none.d.ts.map +1 -1
  9. package/dist/builder/tar.d.ts.map +1 -1
  10. package/dist/commands/address-book.d.ts +4 -8
  11. package/dist/commands/address-book.d.ts.map +1 -1
  12. package/dist/commands/address-book.js +15 -14
  13. package/dist/commands/build.d.ts +5 -11
  14. package/dist/commands/build.d.ts.map +1 -1
  15. package/dist/commands/build.js +16 -28
  16. package/dist/commands/clean.d.ts +2 -7
  17. package/dist/commands/clean.d.ts.map +1 -1
  18. package/dist/commands/clean.js +9 -10
  19. package/dist/commands/create.d.ts +2 -15
  20. package/dist/commands/create.d.ts.map +1 -1
  21. package/dist/commands/create.js +7 -64
  22. package/dist/commands/deploy/build.d.ts +2 -14
  23. package/dist/commands/deploy/build.d.ts.map +1 -1
  24. package/dist/commands/deploy/build.js +8 -61
  25. package/dist/commands/deploy.d.ts +3 -0
  26. package/dist/commands/deploy.d.ts.map +1 -0
  27. package/dist/commands/deploy.js +12 -0
  28. package/dist/commands/doctor.d.ts +2 -12
  29. package/dist/commands/doctor.d.ts.map +1 -1
  30. package/dist/commands/doctor.js +96 -91
  31. package/dist/commands/hash.d.ts +4 -9
  32. package/dist/commands/hash.d.ts.map +1 -1
  33. package/dist/commands/hash.js +14 -14
  34. package/dist/commands/rollups/create.d.ts +7 -0
  35. package/dist/commands/rollups/create.d.ts.map +1 -0
  36. package/dist/commands/rollups/create.js +36 -0
  37. package/dist/commands/rollups/deploy.d.ts +16 -0
  38. package/dist/commands/rollups/deploy.d.ts.map +1 -0
  39. package/dist/commands/rollups/deploy.js +237 -0
  40. package/dist/commands/rollups/logs.d.ts +11 -0
  41. package/dist/commands/rollups/logs.d.ts.map +1 -0
  42. package/dist/commands/rollups/logs.js +32 -0
  43. package/dist/commands/rollups/start.d.ts +14 -0
  44. package/dist/commands/rollups/start.d.ts.map +1 -0
  45. package/dist/commands/rollups/start.js +211 -0
  46. package/dist/commands/rollups/status.d.ts +7 -0
  47. package/dist/commands/rollups/status.d.ts.map +1 -0
  48. package/dist/commands/rollups/status.js +46 -0
  49. package/dist/commands/rollups/stop.d.ts +5 -0
  50. package/dist/commands/rollups/stop.d.ts.map +1 -0
  51. package/dist/commands/rollups/stop.js +26 -0
  52. package/dist/commands/rollups.d.ts +6 -0
  53. package/dist/commands/rollups.d.ts.map +1 -0
  54. package/dist/commands/rollups.js +21 -0
  55. package/dist/commands/run.d.ts +2 -20
  56. package/dist/commands/run.d.ts.map +1 -1
  57. package/dist/commands/run.js +9 -190
  58. package/dist/commands/send/erc20.d.ts +11 -13
  59. package/dist/commands/send/erc20.d.ts.map +1 -1
  60. package/dist/commands/send/erc20.js +57 -52
  61. package/dist/commands/send/erc721.d.ts +11 -13
  62. package/dist/commands/send/erc721.d.ts.map +1 -1
  63. package/dist/commands/send/erc721.js +51 -46
  64. package/dist/commands/send/ether.d.ts +11 -12
  65. package/dist/commands/send/ether.d.ts.map +1 -1
  66. package/dist/commands/send/ether.js +25 -21
  67. package/dist/commands/send/generic.d.ts +12 -14
  68. package/dist/commands/send/generic.d.ts.map +1 -1
  69. package/dist/commands/send/generic.js +92 -97
  70. package/dist/commands/send.d.ts +21 -0
  71. package/dist/commands/send.d.ts.map +1 -0
  72. package/dist/commands/send.js +67 -0
  73. package/dist/commands/shell.d.ts +6 -14
  74. package/dist/commands/shell.d.ts.map +1 -1
  75. package/dist/commands/shell.js +21 -43
  76. package/dist/compose/rollups/default.env +34 -0
  77. package/dist/compose/rollups/docker-compose-anvil.yaml +17 -0
  78. package/dist/{node → compose/rollups}/docker-compose-bundler.yaml +12 -26
  79. package/dist/{node → compose/rollups}/docker-compose-database.yaml +4 -2
  80. package/dist/compose/rollups/docker-compose-espresso.yaml +68 -0
  81. package/dist/compose/rollups/docker-compose-explorer.yaml +57 -0
  82. package/dist/compose/rollups/docker-compose-graphql.yaml +23 -0
  83. package/dist/compose/rollups/docker-compose-node-cpus.yaml +6 -0
  84. package/dist/compose/rollups/docker-compose-node-memory.yaml +6 -0
  85. package/dist/compose/rollups/docker-compose-node.yaml +26 -0
  86. package/dist/compose/rollups/docker-compose-paymaster.yaml +18 -0
  87. package/dist/compose/rollups/docker-compose-proxy.yaml +24 -0
  88. package/dist/compose/rollups/proxy/anvil.yaml +17 -0
  89. package/dist/compose/rollups/proxy/bundler.yaml +17 -0
  90. package/dist/compose/rollups/proxy/espresso.yaml +17 -0
  91. package/dist/compose/rollups/proxy/explorer-api.yaml +17 -0
  92. package/dist/compose/rollups/proxy/explorer.yaml +10 -0
  93. package/dist/compose/rollups/proxy/graphql.yaml +10 -0
  94. package/dist/compose/rollups/proxy/paymaster.yaml +17 -0
  95. package/dist/compose/rollups/proxy/rollups-node.yaml +17 -0
  96. package/dist/config.d.ts +2 -1
  97. package/dist/config.d.ts.map +1 -1
  98. package/dist/config.js +7 -17
  99. package/dist/contracts.d.ts +1695 -1636
  100. package/dist/contracts.d.ts.map +1 -1
  101. package/dist/contracts.js +632 -592
  102. package/dist/exec/cartesi-machine.d.ts.map +1 -1
  103. package/dist/exec/crane.d.ts +1 -1
  104. package/dist/exec/crane.d.ts.map +1 -1
  105. package/dist/exec/genext2fs.d.ts.map +1 -1
  106. package/dist/exec/mksquashfs.d.ts.map +1 -1
  107. package/dist/exec/rollups.d.ts +16 -0
  108. package/dist/exec/rollups.d.ts.map +1 -0
  109. package/dist/exec/rollups.js +39 -0
  110. package/dist/exec/util.d.ts +1 -1
  111. package/dist/exec/util.d.ts.map +1 -1
  112. package/dist/exec/util.js +2 -0
  113. package/dist/index.d.ts +2 -1
  114. package/dist/index.d.ts.map +1 -1
  115. package/dist/index.js +53 -1
  116. package/dist/machine.d.ts.map +1 -1
  117. package/dist/prompts.d.ts.map +1 -1
  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.map +1 -1
  122. package/dist/wallet.js +47 -6
  123. package/package.json +30 -47
  124. package/bin/dev.cmd +0 -3
  125. package/bin/dev.js +0 -25
  126. package/bin/run.cmd +0 -3
  127. package/bin/run.js +0 -8
  128. package/dist/baseCommand.d.ts +0 -22
  129. package/dist/baseCommand.d.ts.map +0 -1
  130. package/dist/baseCommand.js +0 -92
  131. package/dist/commands/deploy/index.d.ts +0 -12
  132. package/dist/commands/deploy/index.d.ts.map +0 -1
  133. package/dist/commands/deploy/index.js +0 -78
  134. package/dist/commands/send/index.d.ts +0 -28
  135. package/dist/commands/send/index.d.ts.map +0 -1
  136. package/dist/commands/send/index.js +0 -102
  137. package/dist/flags.d.ts +0 -17
  138. package/dist/flags.d.ts.map +0 -1
  139. package/dist/flags.js +0 -28
  140. package/dist/node/DockerfileDeploy.txt +0 -4
  141. package/dist/node/default.env +0 -27
  142. package/dist/node/docker-compose-anvil.yaml +0 -50
  143. package/dist/node/docker-compose-envfile.yaml +0 -4
  144. package/dist/node/docker-compose-explorer.yaml +0 -88
  145. package/dist/node/docker-compose-host.yaml +0 -30
  146. package/dist/node/docker-compose-paymaster.yaml +0 -33
  147. package/dist/node/docker-compose-prompt.yaml +0 -17
  148. package/dist/node/docker-compose-proxy.yaml +0 -48
  149. package/dist/node/docker-compose-snapshot-volume.yaml +0 -8
  150. package/dist/node/docker-compose-validator-cpus.yaml +0 -6
  151. package/dist/node/docker-compose-validator-memory.yaml +0 -6
  152. package/dist/node/docker-compose-validator.yaml +0 -59
  153. package/oclif.manifest.json +0 -876
@@ -1,12 +0,0 @@
1
- import { BaseCommand } from "../../baseCommand.js";
2
- export default class Deploy extends BaseCommand<typeof Deploy> {
3
- static summary: string;
4
- static description: string;
5
- static examples: string[];
6
- static flags: {
7
- hosting: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
- webapp: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<import("url").URL, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
9
- };
10
- run(): Promise<void>;
11
- }
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/deploy/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC1D,MAAM,CAAC,OAAO,SAA2C;IAEzD,MAAM,CAAC,WAAW,SACoD;IAEtE,MAAM,CAAC,QAAQ,WAA2C;IAE1D,MAAM,CAAC,KAAK;;;MAWV;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiEpC"}
@@ -1,78 +0,0 @@
1
- import confirm from "@inquirer/confirm";
2
- import select from "@inquirer/select";
3
- import { Flags } from "@oclif/core";
4
- import chalk from "chalk";
5
- import open, { apps } from "open";
6
- import { BaseCommand } from "../../baseCommand.js";
7
- class Deploy extends BaseCommand {
8
- async run() {
9
- const { flags } = await this.parse(Deploy);
10
- // print machine hash
11
- const templateHash = this.getMachineHash();
12
- if (!templateHash) {
13
- this.error(`Cartesi machine snapshot not found, run '${this.config.bin} build'`);
14
- }
15
- this.logPrompt({
16
- title: "Cartesi machine templateHash",
17
- value: templateHash,
18
- });
19
- // ask for deployment type
20
- const hosting = flags.hosting ||
21
- (await select({
22
- message: "Select hosting type",
23
- choices: [
24
- {
25
- name: "Self-hosting",
26
- description: `Select this option if you want to run the node for your application.
27
- You will need the following infrastructure:
28
-
29
- - a cloud server for the application node
30
- - a postgres database
31
- - a web3 node provider
32
- - a funded wallet
33
- `,
34
- value: "self-hosted",
35
- },
36
- {
37
- name: "Use third-party provider",
38
- description: "Select this option to use a third-party service provider to run a node for your application.",
39
- value: "third-party",
40
- disabled: "(coming soon)",
41
- },
42
- ],
43
- }));
44
- let queryString = "";
45
- switch (hosting) {
46
- case "self-hosted": {
47
- // build docker image
48
- await this.config.runCommand("deploy:build");
49
- queryString = `?templateHash=${templateHash}`;
50
- break;
51
- }
52
- case "third-party": {
53
- this.error("Third-party provider deployment not supported yet");
54
- }
55
- }
56
- // prompt user to open webapp for onchain deployment
57
- const deployUrl = `${flags.webapp}${queryString}`;
58
- if (await confirm({ message: `Open ${chalk.cyan(deployUrl)}?` })) {
59
- open(deployUrl, { app: { name: apps.chrome } });
60
- }
61
- return;
62
- }
63
- }
64
- Deploy.summary = "Deploy application to a live network.";
65
- Deploy.description = "Package and deploy the application to a supported live network.";
66
- Deploy.examples = ["<%= config.bin %> <%= command.id %>"];
67
- Deploy.flags = {
68
- hosting: Flags.string({
69
- options: ["self-hosted", "third-party"],
70
- summary: "hosting type",
71
- description: "Select wheather the user will host an application node himself, or use a third-party node provider",
72
- }),
73
- webapp: Flags.url({
74
- description: "address of deploy webapp",
75
- required: true,
76
- }),
77
- };
78
- export default Deploy;
@@ -1,28 +0,0 @@
1
- import { Command, Interfaces } from "@oclif/core";
2
- import { Address, PublicClient, WalletClient } from "viem";
3
- import { BaseCommand } from "../../baseCommand.js";
4
- export type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof SendBaseCommand)["baseFlags"] & T["flags"]>;
5
- export type Args<T extends typeof Command> = Interfaces.InferredArgs<T["args"]>;
6
- export declare abstract class SendBaseCommand<T extends typeof Command> extends BaseCommand<typeof SendBaseCommand> {
7
- static baseFlags: {
8
- dapp: Interfaces.OptionFlag<`0x${string}` | undefined, Interfaces.CustomOptions>;
9
- "chain-id": Interfaces.OptionFlag<number | undefined, Interfaces.CustomOptions>;
10
- "rpc-url": Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
11
- "mnemonic-passphrase": Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
12
- "mnemonic-index": Interfaces.OptionFlag<number, Interfaces.CustomOptions>;
13
- };
14
- protected flags: Flags<T>;
15
- protected args: Args<T>;
16
- private connect;
17
- protected getApplicationAddress(): Promise<Address>;
18
- init(): Promise<void>;
19
- protected abstract send(publicClient: PublicClient, walletClient: WalletClient): Promise<Address>;
20
- run(): Promise<void>;
21
- }
22
- export default class Send extends Command {
23
- static summary: string;
24
- static description: string;
25
- static examples: string[];
26
- run(): Promise<void>;
27
- }
28
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/send/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,UAAU,EAA0B,MAAM,aAAa,CAAC;AAE1E,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAa,MAAM,MAAM,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAInD,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,OAAO,OAAO,IAAI,UAAU,CAAC,aAAa,CAClE,CAAC,OAAO,eAAe,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CACrD,CAAC;AACF,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,OAAO,OAAO,IAAI,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAGhF,8BAAsB,eAAe,CACjC,CAAC,SAAS,OAAO,OAAO,CAC1B,SAAQ,WAAW,CAAC,OAAO,eAAe,CAAC;IACzC,MAAM,CAAC,SAAS;;;;;;MA8Bd;IAEF,SAAS,CAAC,KAAK,EAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3B,SAAS,CAAC,IAAI,EAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAEX,OAAO;cAeL,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC;IAmB5C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAYlC,SAAS,CAAC,QAAQ,CAAC,IAAI,CACnB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,GAC3B,OAAO,CAAC,OAAO,CAAC;IAEN,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAOpC;AAED,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACrC,MAAM,CAAC,OAAO,SAAoC;IAElD,MAAM,CAAC,WAAW,SAC2D;IAE7E,MAAM,CAAC,QAAQ,WAA2C;IAE7C,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAmBpC"}
@@ -1,102 +0,0 @@
1
- import input from "@inquirer/input";
2
- import select from "@inquirer/select";
3
- import { Command, Flags as StandardFlags } from "@oclif/core";
4
- import ora from "ora";
5
- import { isAddress } from "viem";
6
- import { BaseCommand } from "../../baseCommand.js";
7
- import * as CustomFlags from "../../flags.js";
8
- import createClients, { supportedChains } from "../../wallet.js";
9
- // base command for sending input to the application
10
- export class SendBaseCommand extends BaseCommand {
11
- async connect() {
12
- // create viem clients
13
- return createClients({
14
- chain: supportedChains({ includeDevnet: true }).find((c) => c.id == this.flags["chain-id"]),
15
- rpcUrl: this.flags["rpc-url"],
16
- mnemonicPassphrase: this.flags["mnemonic-passphrase"],
17
- mnemonicIndex: this.flags["mnemonic-index"],
18
- });
19
- }
20
- async getApplicationAddress() {
21
- if (this.flags.dapp) {
22
- // honor the flag
23
- return this.flags.dapp;
24
- }
25
- // get the running container dapp address
26
- const nodeAddress = await super.getApplicationAddress();
27
- // query for the address
28
- const applicationAddress = await input({
29
- message: "Application address",
30
- validate: (value) => isAddress(value) || "Invalid address",
31
- default: nodeAddress,
32
- });
33
- return applicationAddress;
34
- }
35
- async init() {
36
- await super.init();
37
- const { args, flags } = await this.parse({
38
- flags: this.ctor.flags,
39
- baseFlags: super.ctor.baseFlags,
40
- args: this.ctor.args,
41
- strict: this.ctor.strict,
42
- });
43
- this.flags = flags;
44
- this.args = args;
45
- }
46
- async run() {
47
- const { publicClient, walletClient } = await this.connect();
48
- const hash = await this.send(publicClient, walletClient);
49
- const progress = ora("Sending input...").start();
50
- await publicClient.waitForTransactionReceipt({ hash });
51
- progress.succeed(`Input sent: ${hash}`);
52
- }
53
- }
54
- SendBaseCommand.baseFlags = {
55
- dapp: CustomFlags.address({
56
- summary: "dapp address.",
57
- description: "the address of the DApp, defaults to the deployed DApp address if application is running.",
58
- }),
59
- "chain-id": StandardFlags.integer({
60
- description: "The EIP-155 chain ID.",
61
- char: "c",
62
- env: "CHAIN",
63
- helpGroup: "Ethereum",
64
- options: supportedChains({ includeDevnet: true }).map((c) => c.id.toString()),
65
- }),
66
- "rpc-url": StandardFlags.string({
67
- description: "The RPC endpoint.",
68
- char: "r",
69
- env: "ETH_RPC_URL",
70
- helpGroup: "Ethereum",
71
- }),
72
- "mnemonic-passphrase": StandardFlags.string({
73
- description: "Use a BIP39 passphrase for the mnemonic.",
74
- helpGroup: "Wallet",
75
- }),
76
- "mnemonic-index": StandardFlags.integer({
77
- description: "Use the private key from the given mnemonic index.",
78
- helpGroup: "Wallet",
79
- default: 0,
80
- }),
81
- };
82
- class Send extends Command {
83
- async run() {
84
- // get all send sub-commands
85
- const sendCommands = this.config.commands.filter((command) => command.id.startsWith("send:"));
86
- // select the send sub-command
87
- const commandId = await select({
88
- message: "Select send sub-command",
89
- choices: sendCommands.map((command) => ({
90
- value: command.id,
91
- name: command.summary,
92
- description: command.description,
93
- })),
94
- });
95
- // invoke the sub-command
96
- await this.config.runCommand(commandId, this.argv);
97
- }
98
- }
99
- Send.summary = "Send input to the application.";
100
- Send.description = "Sends different kinds of input to the application in interactive mode.";
101
- Send.examples = ["<%= config.bin %> <%= command.id %>"];
102
- export default Send;
package/dist/flags.d.ts DELETED
@@ -1,17 +0,0 @@
1
- export declare const address: import("@oclif/core/lib/interfaces").FlagDefinition<`0x${string}`, import("@oclif/core/lib/interfaces").CustomOptions, {
2
- multiple: false;
3
- requiredOrDefaulted: false;
4
- }>;
5
- export declare const bigint: import("@oclif/core/lib/interfaces").FlagDefinition<bigint, import("@oclif/core/lib/interfaces").CustomOptions, {
6
- multiple: false;
7
- requiredOrDefaulted: false;
8
- }>;
9
- export declare const number: import("@oclif/core/lib/interfaces").FlagDefinition<`${number}`, import("@oclif/core/lib/interfaces").CustomOptions, {
10
- multiple: false;
11
- requiredOrDefaulted: false;
12
- }>;
13
- export declare const hex: import("@oclif/core/lib/interfaces").FlagDefinition<`0x${string}`, import("@oclif/core/lib/interfaces").CustomOptions, {
14
- multiple: false;
15
- requiredOrDefaulted: false;
16
- }>;
17
- //# sourceMappingURL=flags.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO;;;EAOlB,CAAC;AAGH,eAAO,MAAM,MAAM;;;EAEjB,CAAC;AAGH,eAAO,MAAM,MAAM;;;EAEjB,CAAC;AAGH,eAAO,MAAM,GAAG;;;EAOd,CAAC"}
package/dist/flags.js DELETED
@@ -1,28 +0,0 @@
1
- import { Flags } from "@oclif/core";
2
- import { isAddress, isHex } from "viem";
3
- // custom flag for Address, does validation
4
- export const address = Flags.custom({
5
- parse: async (input) => {
6
- if (isAddress(input)) {
7
- return input;
8
- }
9
- throw new Error("Invalid address");
10
- },
11
- });
12
- // custom flag for bigint
13
- export const bigint = Flags.custom({
14
- parse: async (input) => BigInt(input),
15
- });
16
- // custom flag for string number
17
- export const number = Flags.custom({
18
- parse: async (input) => input,
19
- });
20
- // custom flag for hex string
21
- export const hex = Flags.custom({
22
- parse: async (input) => {
23
- if (isHex(input)) {
24
- return input;
25
- }
26
- throw new Error("Invalid hex string");
27
- },
28
- });
@@ -1,4 +0,0 @@
1
- FROM cartesi/rollups-node:1.5.1
2
- ENV CARTESI_SNAPSHOT_DIR=/usr/share/rollups-node/snapshot
3
- ENV CARTESI_HTTP_ADDRESS=0.0.0.0
4
- COPY --chown=cartesi:cartesi . ${CARTESI_SNAPSHOT_DIR}
@@ -1,27 +0,0 @@
1
- # cartesi/rollups-node
2
- CARTESI_LOG_LEVEL="${CARTESI_LOG_LEVEL:-error}"
3
- CARTESI_HTTP_ADDRESS="${CARTESI_HTTP_ADDRESS:-0.0.0.0}"
4
- CARTESI_HTTP_PORT="${CARTESI_HTTP_PORT:-10000}"
5
- CARTESI_FEATURE_HOST_MODE="${CARTESI_FEATURE_HOST_MODE:-false}"
6
- CARTESI_FEATURE_READER_MODE_ENABLED="${CARTESI_FEATURE_READER_MODE_ENABLED:-false}"
7
- CARTESI_FEATURE_DISABLE_CLAIMER="${CARTESI_FEATURE_DISABLE_CLAIMER:-false}"
8
- CARTESI_FEATURE_DISABLE_MACHINE_HASH_CHECK="${CARTESI_FEATURE_DISABLE_MACHINE_HASH_CHECK:-true}"
9
- CARTESI_EPOCH_LENGTH="${CARTESI_EPOCH_LENGTH:-720}"
10
- CARTESI_BLOCKCHAIN_ID="${CARTESI_BLOCKCHAIN_ID:-31337}"
11
- CARTESI_BLOCKCHAIN_HTTP_ENDPOINT="${CARTESI_BLOCKCHAIN_HTTP_ENDPOINT:-http://anvil:8545}"
12
- CARTESI_BLOCKCHAIN_WS_ENDPOINT="${CARTESI_BLOCKCHAIN_WS_ENDPOINT:-ws://anvil:8545}"
13
- CARTESI_BLOCKCHAIN_IS_LEGACY="${CARTESI_BLOCKCHAIN_IS_LEGACY:-false}"
14
- CARTESI_BLOCKCHAIN_FINALITY_OFFSET="${CARTESI_BLOCKCHAIN_FINALITY_OFFSET:-0}"
15
- CARTESI_BLOCKCHAIN_BLOCK_TIMEOUT="${CARTESI_BLOCKCHAIN_BLOCK_TIMEOUT:-60}"
16
- CARTESI_CONTRACTS_APPLICATION_ADDRESS="${CARTESI_CONTRACTS_APPLICATION_ADDRESS:-0xab7528bb862fb57e8a2bcd567a2e929a0be56a5e}"
17
- CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER="${CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER:-22}"
18
- CARTESI_CONTRACTS_HISTORY_ADDRESS="${CARTESI_CONTRACTS_HISTORY_ADDRESS:-0x325272217ae6815b494bf38ced004c5eb8a7cda7}"
19
- CARTESI_CONTRACTS_AUTHORITY_ADDRESS="${CARTESI_CONTRACTS_AUTHORITY_ADDRESS:-0x58c93f83fb3304730c95aad2e360cdb88b782010}"
20
- CARTESI_CONTRACTS_INPUT_BOX_ADDRESS="${CARTESI_CONTRACTS_INPUT_BOX_ADDRESS:-0x59b22D57D4f067708AB0c00552767405926dc768}"
21
- CARTESI_SNAPSHOT_DIR="${CARTESI_SNAPSHOT_DIR:-/usr/share/cartesi/snapshot}"
22
- CARTESI_AUTH_MNEMONIC="${CARTESI_AUTH_MNEMONIC:-test test test test test test test test test test test junk}"
23
- CARTESI_POSTGRES_ENDPOINT="${CARTESI_POSTGRES_ENDPOINT:-postgres://postgres:password@database:5432/postgres}"
24
- CARTESI_EXPERIMENTAL_SERVER_MANAGER_BYPASS_LOG="${CARTESI_EXPERIMENTAL_SERVER_MANAGER_BYPASS_LOG:-false}"
25
-
26
- # server-manager
27
- SM_DEADLINE_MACHINE="${SM_DEADLINE_MACHINE:-30000}"
@@ -1,50 +0,0 @@
1
- services:
2
- anvil:
3
- image: cartesi/sdk:0.12.0-alpha.0
4
- command:
5
- [
6
- "devnet",
7
- "--block-time",
8
- "${BLOCK_TIME:-5}",
9
- "${ANVIL_VERBOSITY:---silent}",
10
- ]
11
- healthcheck:
12
- test: ["CMD", "eth_isready"]
13
- interval: 10s
14
- timeout: 1s
15
- retries: 5
16
- environment:
17
- ANVIL_IP_ADDR: 0.0.0.0
18
- ports:
19
- - 8545:8545
20
-
21
- dapp_deployer:
22
- image: cartesi/sdk:0.12.0-alpha.0
23
- restart: on-failure
24
- depends_on:
25
- anvil:
26
- condition: service_started
27
- command:
28
- [
29
- "cast",
30
- "send",
31
- "--rpc-url",
32
- "http://anvil:8545",
33
- "--private-key",
34
- "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80",
35
- "0x4C11C7F82D6D56a726f9B53dd99af031AFd86BB6",
36
- "deployContracts(address,address,bytes32,bytes32)",
37
- "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
38
- "720",
39
- "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
40
- "0x0000000000000000000000000000000000000000000000000000000000000000",
41
- "0x0000000000000000000000000000000000000000000000000000000000000000",
42
- ]
43
-
44
- prompt:
45
- image: debian:bookworm-slim
46
- environment:
47
- PROMPT_TXT_01_ANVIL: "Anvil running at http://localhost:8545"
48
-
49
- volumes:
50
- blockchain-data: {}
@@ -1,4 +0,0 @@
1
- services:
2
- validator:
3
- env_file:
4
- - ./.cartesi.env
@@ -1,88 +0,0 @@
1
- services:
2
- database_creator:
3
- image: postgres:15-alpine
4
- command: ["createdb", "squid"]
5
- depends_on:
6
- database:
7
- condition: service_healthy
8
- environment:
9
- PGHOST: ${PGHOST:-database}
10
- PGPORT: ${PGPORT:-5432}
11
- PGUSER: ${PGUSER:-postgres}
12
- PGPASSWORD: ${PGPASSWORD:-password}
13
- PGDATABASE: ${PGDATABASE:-postgres}
14
-
15
- explorer_api:
16
- image: cartesi/rollups-explorer-api:0.5.0
17
- environment:
18
- DB_NAME: ${PGDATABASE:-squid}
19
- DB_PORT: ${PGPORT:-5432}
20
- DB_HOST: ${PGHOST:-database}
21
- DB_PASS: ${PGPASSWORD:-password}
22
- GQL_PORT: 4350
23
- expose:
24
- - 4350
25
- command: ["sqd", "serve:prod"]
26
- depends_on:
27
- database_creator:
28
- condition: service_completed_successfully
29
-
30
- squid_processor:
31
- image: cartesi/rollups-explorer-api:0.5.0
32
- environment:
33
- CHAIN_ID: ${CHAIN_ID:-31337}
34
- RPC_URL_31337: ${RPC_URL:-http://anvil:8545}
35
- BLOCK_CONFIRMATIONS_31337: 0
36
- DB_NAME: ${PGDATABASE:-squid}
37
- DB_PORT: ${PGPORT:-5432}
38
- DB_HOST: ${PGHOST:-database}
39
- DB_PASS: ${PGPASSWORD:-password}
40
- command: ["sqd", "process:prod"]
41
- depends_on:
42
- database_creator:
43
- condition: service_completed_successfully
44
-
45
- explorer:
46
- image: cartesi/rollups-explorer:0.12.0
47
- expose:
48
- - 3000
49
- depends_on:
50
- database_creator:
51
- condition: service_completed_successfully
52
-
53
- prompt:
54
- image: debian:bookworm-slim
55
- environment:
56
- PROMPT_TXT_04_EXPLORER: "Explorer running at http://localhost:${CARTESI_LISTEN_PORT}/explorer/"
57
-
58
- traefik-config-generator:
59
- environment:
60
- TRAEFIK_CONFIG_EXPLORER_API: |
61
- http:
62
- routers:
63
- explorer-api:
64
- rule: "PathPrefix(`/explorer-api`)"
65
- middlewares:
66
- - "remove-explorer-api-prefix"
67
- service: explorer-api
68
- middlewares:
69
- remove-explorer-api-prefix:
70
- replacePathRegex:
71
- regex: "^/explorer-api/(.*)"
72
- replacement: "/$1"
73
- services:
74
- explorer-api:
75
- loadBalancer:
76
- servers:
77
- - url: "http://explorer_api:4350"
78
- TRAEFIK_CONFIG_EXPLORER: |
79
- http:
80
- routers:
81
- explorer:
82
- rule: "PathPrefix(`/explorer`)"
83
- service: explorer
84
- services:
85
- explorer:
86
- loadBalancer:
87
- servers:
88
- - url: "http://explorer:3000"
@@ -1,30 +0,0 @@
1
- services:
2
- validator:
3
- environment:
4
- CARTESI_FEATURE_HOST_MODE: true
5
- command: ["cartesi-rollups-node"]
6
-
7
- traefik-config-generator:
8
- environment:
9
- TRAEFIK_CONFIG_HOST_RUNNER: |
10
- http:
11
- routers:
12
- host-runner:
13
- rule: "PathPrefix(`/host-runner`)"
14
- middlewares:
15
- - "replace-host-runner-prefix"
16
- service: host-runner
17
- middlewares:
18
- replace-host-runner-prefix:
19
- replacePathRegex:
20
- regex: "^/host-runner/(.*)"
21
- replacement: "/rollup/$1"
22
- services:
23
- host-runner:
24
- loadBalancer:
25
- servers:
26
- - url: "http://validator:10000"
27
-
28
- prompt:
29
- environment:
30
- PROMPT_TXT_05_HOST_RUNNER: "Host Runner running at http://localhost:${CARTESI_LISTEN_PORT}/host-runner"
@@ -1,33 +0,0 @@
1
- services:
2
- mock-verifying-paymaster:
3
- image: cartesi/sdk:0.12.0-alpha.0
4
- command: "mock-verifying-paymaster"
5
- environment:
6
- - ALTO_RPC=http://alto:4337
7
- - ANVIL_RPC=http://anvil:8545
8
-
9
- prompt:
10
- image: debian:bookworm-slim
11
- environment:
12
- PROMPT_TXT_07_PAYMASTER: "Paymaster running at http://localhost:${CARTESI_LISTEN_PORT}/paymaster/"
13
-
14
- traefik-config-generator:
15
- environment:
16
- TRAEFIK_CONFIG_PAYMASTER: |
17
- http:
18
- routers:
19
- paymaster:
20
- rule: "PathPrefix(`/paymaster`)"
21
- middlewares:
22
- - "remove-paymaster-prefix"
23
- service: paymaster
24
- middlewares:
25
- remove-paymaster-prefix:
26
- replacePathRegex:
27
- regex: "^/paymaster/(.*)"
28
- replacement: "/$1"
29
- services:
30
- paymaster:
31
- loadBalancer:
32
- servers:
33
- - url: "http://mock-verifying-paymaster:3000"
@@ -1,17 +0,0 @@
1
- services:
2
- prompt:
3
- image: debian:bookworm-slim
4
- environment:
5
- PROMPT_TXT_10_EXIT: "Press Ctrl+C to stop the node"
6
- command:
7
- - /bin/bash
8
- - -c
9
- - |
10
- for txt_file in $${!PROMPT_TXT_*}
11
- do
12
- declare -n txt_content=$$txt_file
13
- _txt_file=$${txt_file:11}
14
- echo "$$txt_content"
15
- done
16
- trap exit INT TERM; sleep infinity & wait
17
- working_dir: /prompt
@@ -1,48 +0,0 @@
1
- services:
2
- traefik-config-generator:
3
- image: debian:bookworm-slim
4
- command:
5
- - /bin/bash
6
- - -c
7
- - |
8
- for cfg_file in $${!TRAEFIK_CONFIG_*}
9
- do
10
- declare -n cfg_content=$$cfg_file
11
- _cfg_file=$${cfg_file:15}
12
- echo "$$cfg_content" > /etc/traefik/conf.d/$${_cfg_file,,}.yaml
13
- done
14
- volumes:
15
- - traefik-conf:/etc/traefik/conf.d
16
-
17
- proxy:
18
- image: traefik:v2.10
19
- depends_on:
20
- traefik-config-generator:
21
- condition: service_completed_successfully
22
- healthcheck:
23
- test: ["CMD", "traefik", "healthcheck", "--ping"]
24
- interval: 5s
25
- timeout: 1s
26
- retries: 5
27
- command:
28
- [
29
- "--ping=true",
30
- "--entryPoints.web.address=:8088",
31
- "--entryPoints.traefik.address=:8080",
32
- "--metrics.prometheus=true",
33
- "--metrics.prometheus.addServicesLabels=true",
34
- "--providers.file.directory=/etc/traefik/conf.d",
35
- "--providers.file.watch=true",
36
- ]
37
- ports:
38
- - ${CARTESI_LISTEN_PORT:-8080}:8088
39
- volumes:
40
- - traefik-conf:/etc/traefik/conf.d
41
-
42
- prompt:
43
- depends_on:
44
- proxy:
45
- condition: service_healthy
46
-
47
- volumes:
48
- traefik-conf: {}
@@ -1,8 +0,0 @@
1
- services:
2
- dapp_deployer:
3
- volumes:
4
- - ./.cartesi/image:/usr/share/cartesi/snapshot:ro
5
-
6
- validator:
7
- volumes:
8
- - ./.cartesi/image:/tmp/snapshot:ro
@@ -1,6 +0,0 @@
1
- services:
2
- validator:
3
- deploy:
4
- resources:
5
- limits:
6
- cpus: "${CARTESI_VALIDATOR_CPUS}"
@@ -1,6 +0,0 @@
1
- services:
2
- validator:
3
- deploy:
4
- resources:
5
- limits:
6
- memory: "${CARTESI_VALIDATOR_MEMORY}M"