@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
@@ -0,0 +1,67 @@
1
+ import { Command } from "@commander-js/extra-typings";
2
+ import input from "@inquirer/input";
3
+ import select from "@inquirer/select";
4
+ import { isAddress } from "viem";
5
+ import { parseAddress } from "../base.js";
6
+ import { getApplicationAddress } from "../exec/rollups.js";
7
+ import createClients, { supportedChains } from "../wallet.js";
8
+ import { createErc20Command } from "./send/erc20.js";
9
+ import { createErc721Command } from "./send/erc721.js";
10
+ import { createEtherCommand } from "./send/ether.js";
11
+ import { createGenericCommand } from "./send/generic.js";
12
+ export const connect = (options) => {
13
+ const { chainId, rpcUrl, mnemonic, mnemonicIndex } = options;
14
+ // create viem clients
15
+ return createClients({
16
+ chain: supportedChains({ includeDevnet: true }).find((c) => c.id == chainId),
17
+ rpcUrl,
18
+ mnemonicPassphrase: mnemonic,
19
+ mnemonicIndex,
20
+ });
21
+ };
22
+ export const getInputApplicationAddress = async (dapp) => {
23
+ if (dapp && isAddress(dapp)) {
24
+ // honor the flag
25
+ return dapp;
26
+ }
27
+ // get the running container dapp address
28
+ const nodeAddress = await getApplicationAddress();
29
+ // query for the address
30
+ const applicationAddress = await input({
31
+ message: "Application address",
32
+ validate: (value) => isAddress(value) || "Invalid address",
33
+ default: nodeAddress,
34
+ });
35
+ return applicationAddress;
36
+ };
37
+ export const createSendCommand = () => {
38
+ const command = new Command("send")
39
+ .description("Sends different kinds of input to the application in interactive mode.")
40
+ .option("--chain-id <id>", "Chain ID", parseInt, 13370)
41
+ .option("--rpc-url <url>", "RPC URL")
42
+ .option("--mnemonic <phrase>", "Mnemonic passphrase")
43
+ .option("--mnemonic-index <index>", "Mnemonic account index", parseInt, 0)
44
+ .option("--dapp <address>", "Application address", parseAddress, undefined)
45
+ .action(async (options, program) => {
46
+ // Get the registered subcommands from the program
47
+ const commands = program.commands;
48
+ // Create choices for the select prompt based on registered commands
49
+ const choices = commands.map((cmd) => ({
50
+ name: cmd.name(),
51
+ value: cmd,
52
+ description: cmd.description(),
53
+ }));
54
+ // Present the list of subcommands using @inquirer/select
55
+ const subcommand = await select({
56
+ message: "Select the type of input to send",
57
+ choices,
58
+ });
59
+ // Execute the selected subcommand
60
+ subcommand.parseAsync(program.args);
61
+ });
62
+ command.addCommand(createGenericCommand());
63
+ command.addCommand(createErc20Command());
64
+ command.addCommand(createErc721Command());
65
+ command.addCommand(createEtherCommand());
66
+ return command;
67
+ };
@@ -1,15 +1,7 @@
1
- import { BaseCommand } from "../baseCommand.js";
2
- export default class Shell extends BaseCommand<typeof Shell> {
3
- static description: string;
4
- static examples: string[];
5
- static args: {
6
- image: import("@oclif/core/lib/interfaces/parser.js").Arg<string | undefined, Record<string, unknown>>;
7
- };
8
- static flags: {
9
- command: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
- config: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
11
- "run-as-root": import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
12
- };
13
- run(): Promise<void>;
14
- }
1
+ import { Command } from "@commander-js/extra-typings";
2
+ export declare const createShellCommand: () => Command<[string | undefined], {
3
+ command: string;
4
+ config: string;
5
+ runAsRoot: boolean;
6
+ }, {}>;
15
7
  //# sourceMappingURL=shell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/commands/shell.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,WAAW,CAAC,OAAO,KAAK,CAAC;IACxD,MAAM,CAAC,WAAW,SAAqD;IAEvE,MAAM,CAAC,QAAQ,WAA2C;IAE1D,MAAM,CAAC,IAAI;;MAKT;IAEF,MAAM,CAAC,KAAK;;;;MAgBV;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA2CpC"}
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/commands/shell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAOtD,eAAO,MAAM,kBAAkB;;;;MAiD9B,CAAC"}
@@ -1,65 +1,43 @@
1
- import { Args, Flags } from "@oclif/core";
1
+ import { Command } from "@commander-js/extra-typings";
2
2
  import fs from "fs-extra";
3
3
  import path from "path";
4
- import { BaseCommand } from "../baseCommand.js";
4
+ import { getApplicationConfig, getContextPath } from "../base.js";
5
5
  import { bootMachine } from "../machine.js";
6
- class Shell extends BaseCommand {
7
- async run() {
8
- const { flags } = await this.parse(Shell);
6
+ export const createShellCommand = () => {
7
+ return new Command("shell")
8
+ .argument("[image]", "image ID|name")
9
+ .option("--command <command>", "shell command to run", "/bin/sh")
10
+ .option("-c, --config <config>", "path to the configuration file", "cartesi.toml")
11
+ .option("--run-as-root", "run as root user", false)
12
+ .action(async (image, { command, config, runAsRoot }) => {
9
13
  // get application configuration from 'cartesi.toml'
10
- const config = this.getApplicationConfig(flags.config);
14
+ const c = getApplicationConfig(config);
11
15
  // destination directory for image and intermediate files
12
- const destination = path.resolve(this.getContextPath());
16
+ const destination = path.resolve(getContextPath());
13
17
  // check if all drives are built
14
- for (const [name, drive] of Object.entries(config.drives)) {
18
+ for (const [name, drive] of Object.entries(c.drives)) {
15
19
  const filename = `${name}.${drive.format}`;
16
- const pathname = this.getContextPath(filename);
20
+ const pathname = getContextPath(filename);
17
21
  if (!fs.existsSync(pathname)) {
18
- throw new Error(`drive '${name}' not built, run '${this.config.bin} build'`);
22
+ throw new Error(`drive '${name}' not built, run 'build'`);
19
23
  }
20
24
  }
21
25
  // create shell entrypoint
22
26
  const info = {
23
27
  cmd: [],
24
- entrypoint: [this.flags.command],
28
+ entrypoint: [command],
25
29
  env: [],
26
30
  workdir: "/",
27
31
  };
28
32
  // start with interactive mode on
29
- config.machine.interactive = true;
33
+ c.machine.interactive = true;
30
34
  // interactive mode can't have final hash
31
- config.machine.finalHash = false;
35
+ c.machine.finalHash = false;
32
36
  // do not store machine in interactive mode
33
- config.machine.store = undefined;
37
+ c.machine.store = undefined;
34
38
  // run as root if flag is set
35
- config.machine.user = flags["run-as-root"] ? "root" : undefined;
39
+ c.machine.user = runAsRoot ? "root" : undefined;
36
40
  // boot machine
37
- await bootMachine(config, info, destination);
38
- }
39
- }
40
- Shell.description = "Start a shell in cartesi machine of application";
41
- Shell.examples = ["<%= config.bin %> <%= command.id %>"];
42
- Shell.args = {
43
- image: Args.string({
44
- description: "image ID|name",
45
- required: false,
46
- }),
41
+ await bootMachine(c, info, destination);
42
+ });
47
43
  };
48
- Shell.flags = {
49
- command: Flags.string({
50
- default: "/bin/sh",
51
- description: "shell command to run",
52
- summary: "shell to run",
53
- }),
54
- config: Flags.file({
55
- char: "c",
56
- default: "cartesi.toml",
57
- summary: "path to the configuration file",
58
- }),
59
- "run-as-root": Flags.boolean({
60
- default: false,
61
- description: "run as root user",
62
- summary: "run the cartesi machine as the root user",
63
- }),
64
- };
65
- export default Shell;
@@ -0,0 +1,34 @@
1
+ # cartesi/rollups-node
2
+
3
+ #logs
4
+ CARTESI_LOG_LEVEL="${CARTESI_LOG_LEVEL:-info}"
5
+
6
+ # features
7
+ CARTESI_FEATURE_INPUT_READER_ENABLED="${CARTESI_FEATURE_INPUT_READER_ENABLED:-true}"
8
+ CARTESI_FEATURE_CLAIM_SUBMISSION_ENABLED="${CARTESI_FEATURE_CLAIM_SUBMISSION_ENABLED:-true}"
9
+ CARTESI_FEATURE_MACHINE_HASH_CHECK_ENABLED="${CARTESI_FEATURE_MACHINE_HASH_CHECK_ENABLED:-true}"
10
+
11
+ # rollups
12
+ CARTESI_EVM_READER_RETRY_POLICY_MAX_RETRIES="${CARTESI_EVM_READER_RETRY_POLICY_MAX_RETRIES:-3}"
13
+ CARTESI_EVM_READER_RETRY_POLICY_MAX_DELAY="${CARTESI_EVM_READER_RETRY_POLICY_MAX_DELAY:-3}"
14
+ CARTESI_ADVANCER_POLLING_INTERVAL="${CARTESI_ADVANCER_POLLING_INTERVAL:-3}"
15
+ CARTESI_VALIDATOR_POLLING_INTERVAL="${CARTESI_VALIDATOR_POLLING_INTERVAL:-3}"
16
+ CARTESI_CLAIMER_POLLING_INTERVAL="${CARTESI_CLAIMER_POLLING_INTERVAL:-3}"
17
+ CARTESI_MAX_STARTUP_TIME="${CARTESI_MAX_STARTUP_TIME:-15}"
18
+
19
+ # blockchain
20
+ CARTESI_BLOCKCHAIN_ID="${CARTESI_BLOCKCHAIN_ID:-13370}"
21
+ CARTESI_BLOCKCHAIN_HTTP_ENDPOINT="${CARTESI_BLOCKCHAIN_HTTP_ENDPOINT:-http://anvil:8545}"
22
+ CARTESI_BLOCKCHAIN_WS_ENDPOINT="${CARTESI_BLOCKCHAIN_WS_ENDPOINT:-ws://anvil:8545}"
23
+ CARTESI_BLOCKCHAIN_DEFAULT_BLOCK="${CARTESI_BLOCKCHAIN_DEFAULT_BLOCK:-latest}"
24
+
25
+ # contracts
26
+ CARTESI_CONTRACTS_APPLICATION_FACTORY_ADDRESS="${CARTESI_CONTRACTS_APPLICATION_FACTORY_ADDRESS:-0x2210ad1d9B0bD2D470c2bfA4814ab6253BC421A0}"
27
+ CARTESI_CONTRACTS_AUTHORITY_FACTORY_ADDRESS="${CARTESI_CONTRACTS_AUTHORITY_FACTORY_ADDRESS:-0x451f57Ca716046D114Ab9ff23269a2F9F4a1bdaF}"
28
+ CARTESI_CONTRACTS_SELF_HOSTED_APPLICATION_FACTORY_ADDRESS="${CARTESI_CONTRACTS_SELF_HOSTED_APPLICATION_FACTORY_ADDRESS:-0x4a409e1CaB9229711C4e1f68625DdbC75809e721}"
29
+
30
+ # auth
31
+ CARTESI_AUTH_MNEMONIC="${CARTESI_AUTH_MNEMONIC:-test test test test test test test test test test test junk}"
32
+
33
+ # postgres
34
+ CARTESI_DATABASE_CONNECTION="postgres://postgres:password@database:5432/rollupsdb?sslmode=disable"
@@ -0,0 +1,17 @@
1
+ services:
2
+ anvil:
3
+ image: ${CARTESI_SDK_IMAGE}
4
+ command: ["devnet", "--block-time", "${BLOCK_TIME:-5}"]
5
+ healthcheck:
6
+ test: ["CMD", "eth_isready"]
7
+ start_period: 10s
8
+ start_interval: 200ms
9
+ interval: 10s
10
+ timeout: 1s
11
+ retries: 5
12
+ environment:
13
+ ANVIL_IP_ADDR: 0.0.0.0
14
+
15
+ proxy:
16
+ volumes:
17
+ - ./proxy/anvil.yaml:/etc/traefik/conf.d/anvil.yaml
@@ -1,6 +1,6 @@
1
1
  services:
2
- alto:
3
- image: cartesi/sdk:0.12.0-alpha.0
2
+ bundler:
3
+ image: ${CARTESI_SDK_IMAGE}
4
4
  command:
5
5
  - "alto"
6
6
  - "--entrypoints"
@@ -30,28 +30,14 @@ services:
30
30
  - "--polling-interval"
31
31
  - "100"
32
32
  - "--enable-debug-endpoints"
33
- prompt:
34
- image: debian:bookworm-slim
35
- environment:
36
- PROMPT_TXT_06_BUNDLER: "Bundler running at http://localhost:${CARTESI_LISTEN_PORT}/bundler/rpc"
33
+ healthcheck:
34
+ test: ["CMD", "curl", "-fsS", "http://127.0.0.1:4337/health"]
35
+ start_period: 10s
36
+ start_interval: 200ms
37
+ interval: 10s
38
+ timeout: 1s
39
+ retries: 5
37
40
 
38
- traefik-config-generator:
39
- environment:
40
- TRAEFIK_CONFIG_BUNDLER: |
41
- http:
42
- routers:
43
- bundler:
44
- rule: "PathPrefix(`/bundler`)"
45
- middlewares:
46
- - "remove-bundler-prefix"
47
- service: bundler
48
- middlewares:
49
- remove-bundler-prefix:
50
- replacePathRegex:
51
- regex: "^/bundler/(.*)"
52
- replacement: "/$1"
53
- services:
54
- bundler:
55
- loadBalancer:
56
- servers:
57
- - url: "http://alto:4337"
41
+ proxy:
42
+ volumes:
43
+ - ./proxy/bundler.yaml:/etc/traefik/conf.d/bundler.yaml
@@ -1,10 +1,12 @@
1
1
  services:
2
2
  database:
3
- image: postgres:15-alpine
3
+ image: cartesi/rollups-database:${CARTESI_SDK_VERSION}
4
4
  healthcheck:
5
5
  test: ["CMD-SHELL", "pg_isready -U postgres || exit 1"]
6
+ start_period: 10s
7
+ start_interval: 200ms
6
8
  interval: 10s
7
- timeout: 5s
9
+ timeout: 1s
8
10
  retries: 5
9
11
  environment:
10
12
  - POSTGRES_PASSWORD=password
@@ -0,0 +1,68 @@
1
+ services:
2
+ espresso:
3
+ image: ${CARTESI_SDK_IMAGE}
4
+ command: ["espresso-dev-node"]
5
+ deploy:
6
+ resources:
7
+ limits:
8
+ cpus: "4"
9
+ memory: "1G"
10
+ depends_on:
11
+ database:
12
+ condition: service_healthy
13
+ anvil:
14
+ condition: service_healthy
15
+ environment:
16
+ ESPRESSO_SEQUENCER_L1_PROVIDER: ${CARTESI_BLOCKCHAIN_HTTP_ENDPOINT:-http://anvil:8545}
17
+ ESPRESSO_SEQUENCER_API_PORT: 8770
18
+ ESPRESSO_BUILDER_PORT: 8771
19
+ ESPRESSO_PROVER_PORT: 8772
20
+ ESPRESSO_DEV_NODE_PORT: 20000
21
+ ESPRESSO_SEQUENCER_POSTGRES_HOST: database
22
+ ESPRESSO_SEQUENCER_POSTGRES_PORT: 5432
23
+ ESPRESSO_SEQUENCER_POSTGRES_USER: postgres
24
+ ESPRESSO_SEQUENCER_POSTGRES_PASSWORD: password
25
+ ESPRESSO_SEQUENCER_POSTGRES_DATABASE: espresso
26
+ ESPRESSO_SEQUENCER_ETH_MNEMONIC: ${CARTESI_AUTH_MNEMONIC:-test test test test test test test test test test test junk}
27
+ ESPRESSO_SEQUENCER_L1_POLLING_INTERVAL: "1s"
28
+ ESPRESSO_STATE_PROVER_UPDATE_INTERVAL: "1s"
29
+ healthcheck:
30
+ test:
31
+ [
32
+ "CMD",
33
+ "curl",
34
+ "-fsS",
35
+ "http://127.0.0.1:8770/status/block-height",
36
+ ]
37
+ start_period: 10s
38
+ start_interval: 200ms
39
+ interval: 10s
40
+ timeout: 1s
41
+ retries: 5
42
+
43
+ rollups-node:
44
+ environment:
45
+ CARTESI_FEATURE_INPUT_READER_ENABLED: false
46
+
47
+ espresso_reader:
48
+ image: ${CARTESI_SDK_IMAGE}
49
+ command: ["cartesi-rollups-espresso-reader"]
50
+ env_file:
51
+ - ${CARTESI_BIN_PATH}/compose/rollups/default.env
52
+ ports:
53
+ - 8081
54
+ depends_on:
55
+ database:
56
+ condition: service_healthy
57
+ espresso:
58
+ condition: service_healthy
59
+ environment:
60
+ CARTESI_POSTGRES_ENDPOINT: postgres://postgres:password@database:5432/rollupsdb?sslmode=disable
61
+ ESPRESSO_SERVICE_ENDPOINT: ":8081"
62
+ ESPRESSO_BASE_URL: http://espresso:8770
63
+ ESPRESSO_NAMESPACE: 51025
64
+ ESPRESSO_STARTING_BLOCK: 101
65
+
66
+ proxy:
67
+ volumes:
68
+ - ./proxy/espresso.yaml:/etc/traefik/conf.d/espresso.yaml
@@ -0,0 +1,57 @@
1
+ x-explorer_db_env: &explorer_db_env
2
+ DB_NAME: explorer
3
+ DB_PORT: 5432
4
+ DB_HOST: database
5
+ DB_PASS: password
6
+
7
+ services:
8
+ explorer_api:
9
+ image: cartesi/rollups-explorer-api:1.0.0-alpha.3
10
+ environment:
11
+ <<: *explorer_db_env
12
+ GQL_PORT: 4350
13
+ expose:
14
+ - 4350
15
+ command: ["sqd", "serve:prod"]
16
+ healthcheck:
17
+ test:
18
+ [
19
+ "CMD",
20
+ "curl",
21
+ "-fsS",
22
+ "http://127.0.0.1:4350/graphql?query=%7B__typename%7D",
23
+ ]
24
+ start_period: 10s
25
+ start_interval: 200ms
26
+ interval: 10s
27
+ timeout: 1s
28
+ retries: 5
29
+ depends_on:
30
+ database:
31
+ condition: service_healthy
32
+
33
+ squid_processor:
34
+ image: cartesi/rollups-explorer-api:1.0.0-alpha.3
35
+ environment:
36
+ <<: *explorer_db_env
37
+ CHAIN_IDS: ${CARTESI_BLOCKCHAIN_ID:-13370}
38
+ RPC_URL_13370: ${RPC_URL:-http://anvil:8545}
39
+ BLOCK_CONFIRMATIONS_13370: 0
40
+ GENESIS_BLOCK_13370: 1
41
+ command: ["sqd", "process:prod"]
42
+ depends_on:
43
+ database:
44
+ condition: service_healthy
45
+
46
+ explorer:
47
+ image: cartesi/rollups-explorer:1.0.0-alpha.2
48
+ expose:
49
+ - 3000
50
+ depends_on:
51
+ database:
52
+ condition: service_healthy
53
+
54
+ proxy:
55
+ volumes:
56
+ - ./proxy/explorer.yaml:/etc/traefik/conf.d/explorer.yaml
57
+ - ./proxy/explorer-api.yaml:/etc/traefik/conf.d/explorer-api.yaml
@@ -0,0 +1,23 @@
1
+ services:
2
+ graphql:
3
+ image: ${CARTESI_SDK_IMAGE}
4
+ environment:
5
+ POSTGRES_GRAPHQL_DB_URL: postgres://postgres:password@database:5432/graphql?sslmode=disable
6
+ POSTGRES_NODE_DB_URL: postgres://postgres:password@database:5432/rollupsdb?sslmode=disable
7
+ expose:
8
+ - 8080
9
+ command: ["cartesi-rollups-graphql"]
10
+ healthcheck:
11
+ test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8080/health"]
12
+ start_period: 10s
13
+ start_interval: 200ms
14
+ interval: 10s
15
+ timeout: 1s
16
+ retries: 5
17
+ depends_on:
18
+ database:
19
+ condition: service_healthy
20
+
21
+ proxy:
22
+ volumes:
23
+ - ./proxy/graphql.yaml:/etc/traefik/conf.d/graphql.yaml
@@ -0,0 +1,6 @@
1
+ services:
2
+ rollups-node:
3
+ deploy:
4
+ resources:
5
+ limits:
6
+ cpus: "${CARTESI_ROLLUPS_NODE_CPUS}"
@@ -0,0 +1,6 @@
1
+ services:
2
+ rollups-node:
3
+ deploy:
4
+ resources:
5
+ limits:
6
+ memory: "${CARTESI_ROLLUPS_NODE_MEMORY}M"
@@ -0,0 +1,26 @@
1
+ services:
2
+ rollups-node:
3
+ image: cartesi/rollups-runtime:${CARTESI_SDK_VERSION}
4
+ depends_on:
5
+ database:
6
+ condition: service_healthy
7
+ anvil:
8
+ condition: service_healthy
9
+ expose:
10
+ - "10000"
11
+ - "10011"
12
+ - "10012"
13
+ healthcheck:
14
+ test: ["CMD", "curl", "-fsS", "http://127.0.0.1:10000/livez"]
15
+ start_period: 10s
16
+ start_interval: 200ms
17
+ interval: 10s
18
+ timeout: 1s
19
+ retries: 5
20
+ command: ["cartesi-rollups-node"]
21
+ env_file:
22
+ - ${CARTESI_BIN_PATH}/compose/rollups/default.env
23
+
24
+ proxy:
25
+ volumes:
26
+ - ./proxy/rollups-node.yaml:/etc/traefik/conf.d/rollups-node.yaml
@@ -0,0 +1,18 @@
1
+ services:
2
+ paymaster:
3
+ image: ${CARTESI_SDK_IMAGE}
4
+ command: "mock-verifying-paymaster"
5
+ environment:
6
+ - ALTO_RPC=http://bundler:4337
7
+ - ANVIL_RPC=http://anvil:8545
8
+ healthcheck:
9
+ test: ["CMD", "curl", "-fsS", "http://127.0.0.1:3000/ping"]
10
+ start_period: 10s
11
+ start_interval: 200ms
12
+ interval: 10s
13
+ timeout: 1s
14
+ retries: 5
15
+
16
+ proxy:
17
+ volumes:
18
+ - ./proxy/paymaster.yaml:/etc/traefik/conf.d/paymaster.yaml
@@ -0,0 +1,24 @@
1
+ services:
2
+ proxy:
3
+ image: traefik:v3.3.4
4
+ healthcheck:
5
+ test: ["CMD", "traefik", "healthcheck", "--ping"]
6
+ start_period: 10s
7
+ start_interval: 200ms
8
+ interval: 10s
9
+ timeout: 1s
10
+ retries: 5
11
+ command:
12
+ [
13
+ "--ping=true",
14
+ "--entryPoints.web.address=:8088",
15
+ "--entryPoints.traefik.address=:8080",
16
+ "--metrics.prometheus=true",
17
+ "--metrics.prometheus.addServicesLabels=true",
18
+ "--providers.file.directory=/etc/traefik/conf.d",
19
+ "--providers.file.watch=true",
20
+ "--log",
21
+ "--log.level=INFO",
22
+ ]
23
+ ports:
24
+ - ${CARTESI_LISTEN_PORT:-8080}:8088
@@ -0,0 +1,17 @@
1
+ http:
2
+ routers:
3
+ anvil:
4
+ rule: "PathPrefix(`/anvil`)"
5
+ middlewares:
6
+ - "remove-anvil-prefix"
7
+ service: anvil
8
+ middlewares:
9
+ remove-anvil-prefix:
10
+ replacePathRegex:
11
+ regex: "^/anvil(.*)"
12
+ replacement: "$1"
13
+ services:
14
+ anvil:
15
+ loadBalancer:
16
+ servers:
17
+ - url: "http://anvil:8545"
@@ -0,0 +1,17 @@
1
+ http:
2
+ routers:
3
+ bundler:
4
+ rule: "PathPrefix(`/bundler`)"
5
+ middlewares:
6
+ - "remove-bundler-prefix"
7
+ service: bundler
8
+ middlewares:
9
+ remove-bundler-prefix:
10
+ replacePathRegex:
11
+ regex: "^/bundler/(.*)"
12
+ replacement: "/$1"
13
+ services:
14
+ bundler:
15
+ loadBalancer:
16
+ servers:
17
+ - url: "http://bundler:4337"
@@ -0,0 +1,17 @@
1
+ http:
2
+ routers:
3
+ espresso-reader:
4
+ rule: "PathPrefix(`/transaction`)"
5
+ middlewares:
6
+ - "remove-espresso-reader-prefix"
7
+ service: espresso-reader
8
+ middlewares:
9
+ remove-espresso-reader-prefix:
10
+ replacePathRegex:
11
+ regex: "^/transaction/(.*)"
12
+ replacement: "/$1"
13
+ services:
14
+ espresso-reader:
15
+ loadBalancer:
16
+ servers:
17
+ - url: "http://espresso_reader:8081"
@@ -0,0 +1,17 @@
1
+ http:
2
+ routers:
3
+ explorer-api:
4
+ rule: "PathPrefix(`/explorer-api`)"
5
+ middlewares:
6
+ - "remove-explorer-api-prefix"
7
+ service: explorer-api
8
+ middlewares:
9
+ remove-explorer-api-prefix:
10
+ replacePathRegex:
11
+ regex: "^/explorer-api/(.*)"
12
+ replacement: "/$1"
13
+ services:
14
+ explorer-api:
15
+ loadBalancer:
16
+ servers:
17
+ - url: "http://explorer_api:4350"
@@ -0,0 +1,10 @@
1
+ http:
2
+ routers:
3
+ explorer:
4
+ rule: "PathPrefix(`/explorer`)"
5
+ service: explorer
6
+ services:
7
+ explorer:
8
+ loadBalancer:
9
+ servers:
10
+ - url: "http://explorer:3000"
@@ -0,0 +1,10 @@
1
+ http:
2
+ routers:
3
+ graphql:
4
+ rule: "PathPrefix(`/graphql`)"
5
+ service: graphql
6
+ services:
7
+ graphql:
8
+ loadBalancer:
9
+ servers:
10
+ - url: "http://graphql:8080"
@@ -0,0 +1,17 @@
1
+ http:
2
+ routers:
3
+ paymaster:
4
+ rule: "PathPrefix(`/paymaster`)"
5
+ middlewares:
6
+ - "remove-paymaster-prefix"
7
+ service: paymaster
8
+ middlewares:
9
+ remove-paymaster-prefix:
10
+ replacePathRegex:
11
+ regex: "^/paymaster/(.*)"
12
+ replacement: "/$1"
13
+ services:
14
+ paymaster:
15
+ loadBalancer:
16
+ servers:
17
+ - url: "http://paymaster:3000"