@cartesi/cli 2.0.0-alpha.7 → 2.0.0-alpha.9

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 (36) hide show
  1. package/dist/commands/create.d.ts +1 -5
  2. package/dist/commands/create.d.ts.map +1 -1
  3. package/dist/commands/create.js +4 -46
  4. package/dist/commands/rollups/create.d.ts +7 -0
  5. package/dist/commands/rollups/create.d.ts.map +1 -0
  6. package/dist/commands/rollups/create.js +36 -0
  7. package/dist/commands/rollups/deploy.d.ts.map +1 -1
  8. package/dist/commands/rollups/deploy.js +21 -9
  9. package/dist/commands/rollups/start.d.ts.map +1 -1
  10. package/dist/commands/rollups/start.js +6 -4
  11. package/dist/commands/rollups.d.ts.map +1 -1
  12. package/dist/commands/rollups.js +2 -0
  13. package/dist/commands/send.js +1 -1
  14. package/dist/compose/rollups/default.env +7 -8
  15. package/dist/compose/rollups/docker-compose-anvil.yaml +4 -2
  16. package/dist/compose/rollups/docker-compose-database.yaml +1 -1
  17. package/dist/compose/rollups/docker-compose-espresso.yaml +6 -32
  18. package/dist/compose/rollups/docker-compose-explorer.yaml +8 -21
  19. package/dist/compose/rollups/docker-compose-graphql.yaml +3 -29
  20. package/dist/compose/rollups/docker-compose-node.yaml +2 -12
  21. package/dist/compose/rollups/proxy/anvil.yaml +17 -0
  22. package/dist/config.d.ts +2 -1
  23. package/dist/config.d.ts.map +1 -1
  24. package/dist/config.js +4 -3
  25. package/dist/contracts.d.ts +1695 -1636
  26. package/dist/contracts.d.ts.map +1 -1
  27. package/dist/contracts.js +632 -592
  28. package/dist/exec/rollups.d.ts +0 -1
  29. package/dist/exec/rollups.d.ts.map +1 -1
  30. package/dist/exec/rollups.js +5 -6
  31. package/dist/template.d.ts +3 -0
  32. package/dist/template.d.ts.map +1 -0
  33. package/dist/template.js +16 -0
  34. package/dist/wallet.d.ts.map +1 -1
  35. package/dist/wallet.js +29 -11
  36. package/package.json +3 -3
@@ -1,7 +1,3 @@
1
1
  import { Command } from "@commander-js/extra-typings";
2
- export declare const DEFAULT_TEMPLATES_BRANCH = "sdk-0.9";
3
- export declare const createCreateCommand: () => Command<[string], {
4
- template: "cpp" | "cpp-low-level" | "go" | "javascript" | "lua" | "python" | "ruby" | "rust" | "typescript";
5
- branch: string;
6
- }, {}>;
2
+ export declare const createCreateCommand: () => Command<[], {}, {}>;
7
3
  //# sourceMappingURL=create.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAM9D,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAmClD,eAAO,MAAM,mBAAmB;;;MA0B/B,CAAC"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAGtD,eAAO,MAAM,mBAAmB,2BAU/B,CAAC"}
@@ -1,51 +1,9 @@
1
- import { Command, Option } from "@commander-js/extra-typings";
1
+ import { Command } from "@commander-js/extra-typings";
2
2
  import chalk from "chalk";
3
- import { downloadTemplate } from "giget";
4
- import ora from "ora";
5
- export const DEFAULT_TEMPLATES_BRANCH = "sdk-0.9";
6
- const TEMPLATES = [
7
- "cpp",
8
- "cpp-low-level",
9
- "go",
10
- "javascript",
11
- "lua",
12
- "python",
13
- "ruby",
14
- "rust",
15
- "typescript",
16
- ];
17
- const download = async (template, branch, out) => {
18
- const cartesiProvider = async (input) => {
19
- return {
20
- name: "cartesi",
21
- subdir: input,
22
- url: "https://github.com/cartesi/application-templates",
23
- tar: `https://codeload.github.com/cartesi/application-templates/tar.gz/refs/heads/${branch}`,
24
- };
25
- };
26
- const input = `cartesi:${template}`;
27
- return downloadTemplate(input, {
28
- dir: out,
29
- providers: { cartesi: cartesiProvider },
30
- });
31
- };
32
3
  export const createCreateCommand = () => {
33
4
  return new Command("create")
34
- .argument("<name>", "application and directory name")
35
- .addOption(new Option("-t, --template <template>", "template name to use")
36
- .choices(TEMPLATES)
37
- .makeOptionMandatory())
38
- .option("-b, --branch <branch>", "cartesi/application-templates repository branch name to use", DEFAULT_TEMPLATES_BRANCH)
39
- .action(async (name, { branch, template }) => {
40
- const spinner = ora("Creating application...").start();
41
- try {
42
- const { dir } = await download(template, branch, name);
43
- spinner.succeed(`Application created at ${chalk.cyan(dir)}`);
44
- }
45
- catch (e) {
46
- spinner.fail(e instanceof Error
47
- ? `Error creating application: ${chalk.red(e.message)}`
48
- : String(e));
49
- }
5
+ .summary("DEPRECATED: use 'rollups create' instead")
6
+ .action(async () => {
7
+ console.warn(chalk.yellow("create command is deprecated, use 'rollups create' instead"));
50
8
  });
51
9
  };
@@ -0,0 +1,7 @@
1
+ import { Command } from "@commander-js/extra-typings";
2
+ export declare const DEFAULT_TEMPLATES_BRANCH = "prerelease/sdk-12";
3
+ export declare const createCreateCommand: () => Command<[string], {
4
+ template: "cpp" | "cpp-low-level" | "go" | "javascript" | "lua" | "python" | "ruby" | "rust" | "typescript";
5
+ branch: string;
6
+ }, {}>;
7
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/rollups/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAK9D,eAAO,MAAM,wBAAwB,sBAAsB,CAAC;AAc5D,eAAO,MAAM,mBAAmB;;;MA+B/B,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { Command, Option } from "@commander-js/extra-typings";
2
+ import chalk from "chalk";
3
+ import ora from "ora";
4
+ import { download } from "../../template.js";
5
+ export const DEFAULT_TEMPLATES_BRANCH = "prerelease/sdk-12";
6
+ const TEMPLATES = [
7
+ "cpp",
8
+ "cpp-low-level",
9
+ "go",
10
+ "javascript",
11
+ "lua",
12
+ "python",
13
+ "ruby",
14
+ "rust",
15
+ "typescript",
16
+ ];
17
+ export const createCreateCommand = () => {
18
+ return new Command("create")
19
+ .argument("<name>", "application and directory name")
20
+ .addOption(new Option("-t, --template <template>", "template name to use")
21
+ .choices(TEMPLATES)
22
+ .makeOptionMandatory())
23
+ .option("-b, --branch <branch>", "cartesi/application-templates repository branch name to use", DEFAULT_TEMPLATES_BRANCH)
24
+ .action(async (name, { branch, template }) => {
25
+ const spinner = ora("Creating application...").start();
26
+ try {
27
+ const { dir } = await download("rollups", template, branch, name);
28
+ spinner.succeed(`Application created at ${chalk.cyan(dir)}`);
29
+ }
30
+ catch (e) {
31
+ spinner.fail(e instanceof Error
32
+ ? `Error creating application: ${chalk.red(e.message)}`
33
+ : String(e));
34
+ }
35
+ });
36
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/commands/rollups/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AA8N9D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;EAqG/B,CAAC"}
1
+ {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/commands/rollups/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAoP9D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;EAqG/B,CAAC"}
@@ -3,10 +3,10 @@ import input from "@inquirer/input";
3
3
  import chalk from "chalk";
4
4
  import { execa } from "execa";
5
5
  import ora from "ora";
6
- import { zeroHash } from "viem";
7
- import { anvil } from "viem/chains";
6
+ import { encodeFunctionData, zeroHash, } from "viem";
7
+ import { cannon } from "viem/chains";
8
8
  import { getContextPath, getMachineHash, parseAddress, parseHash, } from "../../base.js";
9
- import { applicationFactoryAbi, applicationFactoryAddress, authorityFactoryAbi, authorityFactoryAddress, } from "../../contracts.js";
9
+ import { applicationFactoryAbi, applicationFactoryAddress, authorityFactoryAbi, authorityFactoryAddress, dataAvailabilityAbi, inputBoxAddress, } from "../../contracts.js";
10
10
  import { addressInput } from "../../prompts.js";
11
11
  import { connect } from "../send.js";
12
12
  /**
@@ -60,6 +60,12 @@ const deployApplication = async (publicClient, walletClient, options) => {
60
60
  message: "Application Owner",
61
61
  default: walletClient.account?.address,
62
62
  }));
63
+ // create data availability descriptor for InputBox only
64
+ const dataAvailability = encodeFunctionData({
65
+ abi: dataAvailabilityAbi,
66
+ functionName: "InputBox",
67
+ args: [inputBoxAddress],
68
+ });
63
69
  const applicationAddress = await publicClient.readContract({
64
70
  abi: applicationFactoryAbi,
65
71
  address: applicationFactoryAddress,
@@ -68,7 +74,7 @@ const deployApplication = async (publicClient, walletClient, options) => {
68
74
  authorityAddress,
69
75
  applicationOwner,
70
76
  templateHash,
71
- // "0x", // XXX: update to latest rollups contract
77
+ dataAvailability,
72
78
  salt,
73
79
  ],
74
80
  });
@@ -83,7 +89,13 @@ const deployApplication = async (publicClient, walletClient, options) => {
83
89
  address: applicationFactoryAddress,
84
90
  account: walletClient.account,
85
91
  functionName: "newApplication",
86
- args: [authorityAddress, applicationOwner, templateHash, salt],
92
+ args: [
93
+ authorityAddress,
94
+ applicationOwner,
95
+ templateHash,
96
+ dataAvailability,
97
+ salt,
98
+ ],
87
99
  });
88
100
  progress.start("Deploying application...");
89
101
  const hash = await walletClient.writeContract(request);
@@ -151,8 +163,8 @@ const registerApplication = async (options) => {
151
163
  ]);
152
164
  const registration = stdout ? JSON.parse(stdout) : undefined;
153
165
  if (registration) {
154
- if (registration.State !== "ENABLED") {
155
- throw new Error(registration.Reason);
166
+ if (registration.state !== "ENABLED") {
167
+ throw new Error(registration.reason);
156
168
  }
157
169
  progress.succeed(`Registration ${chalk.cyan(name)}`);
158
170
  }
@@ -165,7 +177,7 @@ export const createDeployCommand = () => {
165
177
  return new Command("deploy")
166
178
  .description("Deploy a rollups application to a rollups node.")
167
179
  .configureHelp({ showGlobalOptions: true })
168
- .option("--chain-id <id>", "Chain ID", parseInt, 31337)
180
+ .option("--chain-id <id>", "Chain ID", parseInt, 13370)
169
181
  .option("--rpc-url <url>", "RPC URL")
170
182
  .option("--mnemonic <phrase>", "Mnemonic passphrase")
171
183
  .option("--mnemonic-index <index>", "Mnemonic account index", parseInt, 0)
@@ -198,7 +210,7 @@ export const createDeployCommand = () => {
198
210
  const authorityAddress = await deployAuthority(publicClient, walletClient, { progress, ...options });
199
211
  // deploy application contract
200
212
  const applicationAddress = await deployApplication(publicClient, walletClient, { authorityAddress, progress, templateHash, ...options });
201
- if (publicClient.chain?.id === anvil.id) {
213
+ if (publicClient.chain?.id === cannon.id) {
202
214
  // copy machine snapshot to rollups node container
203
215
  const containerSnapshotPath = await publishMachine({
204
216
  progress,
@@ -1 +1 @@
1
- {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/rollups/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AA2I9D,eAAO,MAAM,kBAAkB;;;;;;;;;;;EAgK9B,CAAC"}
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/rollups/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AA4I9D,eAAO,MAAM,kBAAkB;;;;;;;;;;;EAkK9B,CAAC"}
@@ -5,7 +5,7 @@ import { Listr } from "listr2";
5
5
  import pRetry from "p-retry";
6
6
  import path from "path";
7
7
  import { getServiceHealth } from "../../base.js";
8
- import { DEFAULT_SDK } from "../../config.js";
8
+ import { DEFAULT_SDK_IMAGE, DEFAULT_SDK_VERSION } from "../../config.js";
9
9
  const commaSeparatedList = (value) => value.split(",");
10
10
  const host = "http://127.0.0.1";
11
11
  // services configuration
@@ -14,7 +14,7 @@ const baseServices = [
14
14
  name: "anvil",
15
15
  file: "docker-compose-anvil.yaml",
16
16
  healthySemaphore: "anvil",
17
- healthyTitle: `${chalk.cyan("anvil")} service ready at ${chalk.cyan(`${host}:8545`)}`,
17
+ healthyTitle: (port) => `${chalk.cyan("anvil")} service ready at ${chalk.cyan(`${host}:${port}/anvil`)}`,
18
18
  waitTitle: `${chalk.cyan("anvil")} service starting...`,
19
19
  errorTitle: `${chalk.red("anvil")} service failed`,
20
20
  },
@@ -132,7 +132,8 @@ export const createStartCommand = () => {
132
132
  CARTESI_LISTEN_PORT: port.toString(),
133
133
  CARTESI_ROLLUPS_NODE_CPUS: cpus?.toString(),
134
134
  CARTESI_ROLLUPS_NODE_MEMORY: memory?.toString(),
135
- CARTESI_SDK_IMAGE: DEFAULT_SDK,
135
+ CARTESI_SDK_IMAGE: DEFAULT_SDK_IMAGE,
136
+ CARTESI_SDK_VERSION: DEFAULT_SDK_VERSION,
136
137
  };
137
138
  // build a list of unique compose files
138
139
  const composeFiles = [
@@ -178,7 +179,8 @@ export const createStartCommand = () => {
178
179
  console.warn(chalk.yellow(`WARNING: default block is set to '${defaultBlock}', production configuration will likely use 'finalized'`));
179
180
  }
180
181
  // pull images first
181
- await execa("docker", [...composeArgs, "pull"], {
182
+ const pullArgs = ["--policy", "missing"];
183
+ await execa("docker", [...composeArgs, "pull", ...pullArgs], {
182
184
  env,
183
185
  stdio: "inherit",
184
186
  });
@@ -1 +1 @@
1
- {"version":3,"file":"rollups.d.ts","sourceRoot":"","sources":["../../src/commands/rollups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAOtD,eAAO,MAAM,oBAAoB;;MAgBhC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,UAAU,CACvC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAClD,CAAC"}
1
+ {"version":3,"file":"rollups.d.ts","sourceRoot":"","sources":["../../src/commands/rollups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAQtD,eAAO,MAAM,oBAAoB;;MAiBhC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,UAAU,CACvC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAClD,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { Command } from "@commander-js/extra-typings";
2
+ import { createCreateCommand } from "./rollups/create.js";
2
3
  import { createDeployCommand } from "./rollups/deploy.js";
3
4
  import { createLogsCommand } from "./rollups/logs.js";
4
5
  import { createStartCommand } from "./rollups/start.js";
@@ -15,5 +16,6 @@ export const createRollupsCommand = () => {
15
16
  command.addCommand(createStatusCommand());
16
17
  command.addCommand(createStopCommand());
17
18
  command.addCommand(createDeployCommand());
19
+ command.addCommand(createCreateCommand());
18
20
  return command;
19
21
  };
@@ -37,7 +37,7 @@ export const getInputApplicationAddress = async (dapp) => {
37
37
  export const createSendCommand = () => {
38
38
  const command = new Command("send")
39
39
  .description("Sends different kinds of input to the application in interactive mode.")
40
- .option("--chain-id <id>", "Chain ID", parseInt, 31337)
40
+ .option("--chain-id <id>", "Chain ID", parseInt, 13370)
41
41
  .option("--rpc-url <url>", "RPC URL")
42
42
  .option("--mnemonic <phrase>", "Mnemonic passphrase")
43
43
  .option("--mnemonic-index <index>", "Mnemonic account index", parseInt, 0)
@@ -6,7 +6,7 @@ CARTESI_LOG_LEVEL="${CARTESI_LOG_LEVEL:-info}"
6
6
  # features
7
7
  CARTESI_FEATURE_INPUT_READER_ENABLED="${CARTESI_FEATURE_INPUT_READER_ENABLED:-true}"
8
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:-false}"
9
+ CARTESI_FEATURE_MACHINE_HASH_CHECK_ENABLED="${CARTESI_FEATURE_MACHINE_HASH_CHECK_ENABLED:-true}"
10
10
 
11
11
  # rollups
12
12
  CARTESI_EVM_READER_RETRY_POLICY_MAX_RETRIES="${CARTESI_EVM_READER_RETRY_POLICY_MAX_RETRIES:-3}"
@@ -17,19 +17,18 @@ CARTESI_CLAIMER_POLLING_INTERVAL="${CARTESI_CLAIMER_POLLING_INTERVAL:-3}"
17
17
  CARTESI_MAX_STARTUP_TIME="${CARTESI_MAX_STARTUP_TIME:-15}"
18
18
 
19
19
  # blockchain
20
- CARTESI_BLOCKCHAIN_ID="${CARTESI_BLOCKCHAIN_ID:-31337}"
20
+ CARTESI_BLOCKCHAIN_ID="${CARTESI_BLOCKCHAIN_ID:-13370}"
21
21
  CARTESI_BLOCKCHAIN_HTTP_ENDPOINT="${CARTESI_BLOCKCHAIN_HTTP_ENDPOINT:-http://anvil:8545}"
22
22
  CARTESI_BLOCKCHAIN_WS_ENDPOINT="${CARTESI_BLOCKCHAIN_WS_ENDPOINT:-ws://anvil:8545}"
23
- CARTESI_BLOCKCHAIN_DEFAULT_BLOCK="${CARTESI_BLOCKCHAIN_DEFAULT_BLOCK:-finalized}"
23
+ CARTESI_BLOCKCHAIN_DEFAULT_BLOCK="${CARTESI_BLOCKCHAIN_DEFAULT_BLOCK:-latest}"
24
24
 
25
25
  # contracts
26
- CARTESI_CONTRACTS_INPUT_BOX_ADDRESS="${CARTESI_CONTRACTS_INPUT_BOX_ADDRESS:-0x593E5BCf894D6829Dd26D0810DA7F064406aebB6}"
27
- CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER="${CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER:-1}"
28
- CARTESI_CONTRACTS_APPLICATION_FACTORY_ADDRESS="${CARTESI_CONTRACTS_APPLICATION_FACTORY_ADDRESS:-0xd7d4d184b82b1a4e08f304DDaB0A2A7a301C2620}"
29
- CARTESI_CONTRACTS_AUTHORITY_FACTORY_ADDRESS="${CARTESI_CONTRACTS_AUTHORITY_FACTORY_ADDRESS:-0xB897F7Fe78f220aE34B7FA9493092701a873Ed45}"
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}"
30
29
 
31
30
  # auth
32
31
  CARTESI_AUTH_MNEMONIC="${CARTESI_AUTH_MNEMONIC:-test test test test test test test test test test test junk}"
33
32
 
34
33
  # postgres
35
- CARTESI_DATABASE_CONNECTION="postgres://postgres:password@database:5432/postgres?sslmode=disable"
34
+ CARTESI_DATABASE_CONNECTION="postgres://postgres:password@database:5432/rollupsdb?sslmode=disable"
@@ -11,5 +11,7 @@ services:
11
11
  retries: 5
12
12
  environment:
13
13
  ANVIL_IP_ADDR: 0.0.0.0
14
- ports:
15
- - 8545:8545
14
+
15
+ proxy:
16
+ volumes:
17
+ - ./proxy/anvil.yaml:/etc/traefik/conf.d/anvil.yaml
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  database:
3
- image: postgres:16
3
+ image: cartesi/rollups-database:${CARTESI_SDK_VERSION}
4
4
  healthcheck:
5
5
  test: ["CMD-SHELL", "pg_isready -U postgres || exit 1"]
6
6
  start_period: 10s
@@ -1,17 +1,4 @@
1
1
  services:
2
- espresso_database_creator:
3
- image: postgres:16
4
- command: ["createdb", "sequencer"]
5
- depends_on:
6
- database:
7
- condition: service_healthy
8
- environment:
9
- PGHOST: database
10
- PGPORT: 5432
11
- PGUSER: postgres
12
- PGPASSWORD: password
13
- PGDATABASE: postgres
14
-
15
2
  espresso:
16
3
  image: ${CARTESI_SDK_IMAGE}
17
4
  command: ["espresso-dev-node"]
@@ -21,8 +8,8 @@ services:
21
8
  cpus: "4"
22
9
  memory: "1G"
23
10
  depends_on:
24
- espresso_database_creator:
25
- condition: service_completed_successfully
11
+ database:
12
+ condition: service_healthy
26
13
  anvil:
27
14
  condition: service_healthy
28
15
  environment:
@@ -35,7 +22,7 @@ services:
35
22
  ESPRESSO_SEQUENCER_POSTGRES_PORT: 5432
36
23
  ESPRESSO_SEQUENCER_POSTGRES_USER: postgres
37
24
  ESPRESSO_SEQUENCER_POSTGRES_PASSWORD: password
38
- ESPRESSO_SEQUENCER_POSTGRES_DATABASE: sequencer
25
+ ESPRESSO_SEQUENCER_POSTGRES_DATABASE: espresso
39
26
  ESPRESSO_SEQUENCER_ETH_MNEMONIC: ${CARTESI_AUTH_MNEMONIC:-test test test test test test test test test test test junk}
40
27
  ESPRESSO_SEQUENCER_L1_POLLING_INTERVAL: "1s"
41
28
  ESPRESSO_STATE_PROVER_UPDATE_INTERVAL: "1s"
@@ -57,19 +44,6 @@ services:
57
44
  environment:
58
45
  CARTESI_FEATURE_INPUT_READER_ENABLED: false
59
46
 
60
- espresso_reader_migration:
61
- image: ${CARTESI_SDK_IMAGE}
62
- command:
63
- - migrate
64
- - -source
65
- - file:///usr/share/cartesi/rollups-espresso-reader/migrations
66
- - -database
67
- - postgres://postgres:password@database:5432/postgres?sslmode=disable&x-migrations-table=espresso_schema_migrations
68
- - up
69
- depends_on:
70
- rollups-node-migration:
71
- condition: service_completed_successfully
72
-
73
47
  espresso_reader:
74
48
  image: ${CARTESI_SDK_IMAGE}
75
49
  command: ["cartesi-rollups-espresso-reader"]
@@ -78,12 +52,12 @@ services:
78
52
  ports:
79
53
  - 8081
80
54
  depends_on:
81
- espresso_reader_migration:
82
- condition: service_completed_successfully
55
+ database:
56
+ condition: service_healthy
83
57
  espresso:
84
58
  condition: service_healthy
85
59
  environment:
86
- CARTESI_POSTGRES_ENDPOINT: postgres://postgres:password@database:5432/postgres?sslmode=disable
60
+ CARTESI_POSTGRES_ENDPOINT: postgres://postgres:password@database:5432/rollupsdb?sslmode=disable
87
61
  ESPRESSO_SERVICE_ENDPOINT: ":8081"
88
62
  ESPRESSO_BASE_URL: http://espresso:8770
89
63
  ESPRESSO_NAMESPACE: 51025
@@ -1,17 +1,4 @@
1
1
  services:
2
- database_creator:
3
- image: postgres:16
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
2
  explorer_api:
16
3
  image: cartesi/rollups-explorer-api:0.5.0
17
4
  environment:
@@ -37,31 +24,31 @@ services:
37
24
  timeout: 1s
38
25
  retries: 5
39
26
  depends_on:
40
- database_creator:
41
- condition: service_completed_successfully
27
+ database:
28
+ condition: service_healthy
42
29
 
43
30
  squid_processor:
44
31
  image: cartesi/rollups-explorer-api:0.5.0
45
32
  environment:
46
- CHAIN_ID: ${CHAIN_ID:-31337}
33
+ CHAIN_ID: ${CHAIN_ID:-13370}
47
34
  RPC_URL_31337: ${RPC_URL:-http://anvil:8545}
48
- BLOCK_CONFIRMATIONS_31337: 0
35
+ BLOCK_CONFIRMATIONS_13370: 0
49
36
  DB_NAME: ${PGDATABASE:-squid}
50
37
  DB_PORT: ${PGPORT:-5432}
51
38
  DB_HOST: ${PGHOST:-database}
52
39
  DB_PASS: ${PGPASSWORD:-password}
53
40
  command: ["sqd", "process:prod"]
54
41
  depends_on:
55
- database_creator:
56
- condition: service_completed_successfully
42
+ database:
43
+ condition: service_healthy
57
44
 
58
45
  explorer:
59
46
  image: cartesi/rollups-explorer:0.12.0
60
47
  expose:
61
48
  - 3000
62
49
  depends_on:
63
- database_creator:
64
- condition: service_completed_successfully
50
+ database:
51
+ condition: service_healthy
65
52
 
66
53
  proxy:
67
54
  volumes:
@@ -1,35 +1,9 @@
1
1
  services:
2
- graphql_database_creator:
3
- image: postgres:16
4
- command: ["createdb", "graphql"]
5
- depends_on:
6
- database:
7
- condition: service_healthy
8
- environment:
9
- PGHOST: database
10
- PGPORT: 5432
11
- PGUSER: postgres
12
- PGPASSWORD: password
13
- PGDATABASE: postgres
14
-
15
- graphql_database_migration:
16
- image: ${CARTESI_SDK_IMAGE}
17
- command:
18
- - migrate
19
- - -path
20
- - /usr/share/cartesi/rollups-graphql/migrations
21
- - -database
22
- - postgres://postgres:password@database:5432/graphql?sslmode=disable
23
- - up
24
- depends_on:
25
- graphql_database_creator:
26
- condition: service_completed_successfully
27
-
28
2
  graphql:
29
3
  image: ${CARTESI_SDK_IMAGE}
30
4
  environment:
31
5
  POSTGRES_GRAPHQL_DB_URL: postgres://postgres:password@database:5432/graphql?sslmode=disable
32
- POSTGRES_NODE_DB_URL: postgres://postgres:password@database:5432/postgres?sslmode=disable
6
+ POSTGRES_NODE_DB_URL: postgres://postgres:password@database:5432/rollupsdb?sslmode=disable
33
7
  expose:
34
8
  - 8080
35
9
  command: ["cartesi-rollups-graphql"]
@@ -41,8 +15,8 @@ services:
41
15
  timeout: 1s
42
16
  retries: 5
43
17
  depends_on:
44
- graphql_database_migration:
45
- condition: service_completed_successfully
18
+ database:
19
+ condition: service_healthy
46
20
 
47
21
  proxy:
48
22
  volumes:
@@ -1,19 +1,9 @@
1
1
  services:
2
- rollups-node-migration:
3
- image: ${CARTESI_SDK_IMAGE}
4
- command: ["cartesi-rollups-cli", "db", "upgrade"]
2
+ rollups-node:
3
+ image: cartesi/rollups-runtime:${CARTESI_SDK_VERSION}
5
4
  depends_on:
6
5
  database:
7
6
  condition: service_healthy
8
- restart: "no"
9
- env_file:
10
- - ${CARTESI_BIN_PATH}/compose/rollups/default.env
11
-
12
- rollups-node:
13
- image: ${CARTESI_SDK_IMAGE}
14
- depends_on:
15
- rollups-node-migration:
16
- condition: service_completed_successfully
17
7
  anvil:
18
8
  condition: service_healthy
19
9
  expose:
@@ -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"
package/dist/config.d.ts CHANGED
@@ -29,7 +29,8 @@ export declare class RequiredFieldError extends Error {
29
29
  export declare class InvalidStringArrayError extends Error {
30
30
  constructor();
31
31
  }
32
- export declare const DEFAULT_SDK = "cartesi/sdk:0.12.0-alpha.11";
32
+ export declare const DEFAULT_SDK_VERSION = "0.12.0-alpha.15";
33
+ export declare const DEFAULT_SDK_IMAGE = "cartesi/sdk:0.12.0-alpha.15";
33
34
  type DriveFormat = "ext2" | "sqfs";
34
35
  export type ImageInfo = {
35
36
  cmd: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAsB,MAAM,WAAW,CAAC;AAE9D;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,aAAa;CAIrC;AAED,qBAAa,uBAAwB,SAAQ,KAAK;gBAClC,MAAM,EAAE,aAAa;CAIpC;AAED,qBAAa,4BAA6B,SAAQ,KAAK;gBACvC,MAAM,EAAE,aAAa;CAIpC;AAED,qBAAa,uBAAwB,SAAQ,KAAK;gBAClC,KAAK,EAAE,aAAa;CAInC;AAED,qBAAa,wBAAyB,SAAQ,KAAK;gBACnC,KAAK,EAAE,aAAa;CAInC;AAED,qBAAa,uBAAwB,SAAQ,KAAK;gBAClC,KAAK,EAAE,aAAa;CAInC;AAED,qBAAa,sBAAuB,SAAQ,KAAK;gBACjC,KAAK,EAAE,aAAa;CA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M,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACpC,OAAO,EAAE,aAAa,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;CACf,CAAC;AAIF,eAAO,MAAM,sBAAsB,QAAO,WAOxC,CAAC;AAEH,eAAO,MAAM,oBAAoB,QAAO,aAYtC,CAAC;AAEH,eAAO,MAAM,aAAa,QAAO,MAI/B,CAAC;AA+KH,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,KAAG,WAUjD,CAAC;AA0GF,eAAO,MAAM,KAAK,GAAI,KAAK,MAAM,KAAG,MAUnC,CAAC"}
package/dist/config.js CHANGED
@@ -64,7 +64,8 @@ export class InvalidStringArrayError extends Error {
64
64
  const DEFAULT_FORMAT = "ext2";
65
65
  const DEFAULT_RAM = "128Mi";
66
66
  const DEFAULT_RAM_IMAGE = "/usr/share/cartesi-machine/images/linux.bin";
67
- export const DEFAULT_SDK = "cartesi/sdk:0.12.0-alpha.11";
67
+ export const DEFAULT_SDK_VERSION = "0.12.0-alpha.15";
68
+ export const DEFAULT_SDK_IMAGE = `cartesi/sdk:${DEFAULT_SDK_VERSION}`;
68
69
  export const defaultRootDriveConfig = () => ({
69
70
  builder: "docker",
70
71
  context: ".",
@@ -89,7 +90,7 @@ export const defaultMachineConfig = () => ({
89
90
  export const defaultConfig = () => ({
90
91
  drives: { root: defaultRootDriveConfig() },
91
92
  machine: defaultMachineConfig(),
92
- sdk: DEFAULT_SDK,
93
+ sdk: DEFAULT_SDK_IMAGE,
93
94
  });
94
95
  const parseBoolean = (value, defaultValue) => {
95
96
  if (value === undefined) {
@@ -361,7 +362,7 @@ export const parse = (str) => {
361
362
  const config = {
362
363
  drives: parseDrives(toml.drives),
363
364
  machine: parseMachine(toml.machine),
364
- sdk: parseString(toml.sdk, DEFAULT_SDK),
365
+ sdk: parseString(toml.sdk, DEFAULT_SDK_IMAGE),
365
366
  };
366
367
  return config;
367
368
  };