@cartesi/cli 2.0.0-alpha.7 → 2.0.0-alpha.8
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.
- package/dist/commands/create.d.ts +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +1 -1
- package/dist/commands/rollups/deploy.d.ts.map +1 -1
- package/dist/commands/rollups/deploy.js +21 -9
- package/dist/commands/rollups/start.d.ts.map +1 -1
- package/dist/commands/rollups/start.js +6 -4
- package/dist/commands/send.js +1 -1
- package/dist/compose/rollups/default.env +6 -7
- package/dist/compose/rollups/docker-compose-anvil.yaml +4 -2
- package/dist/compose/rollups/docker-compose-database.yaml +1 -1
- package/dist/compose/rollups/docker-compose-espresso.yaml +6 -32
- package/dist/compose/rollups/docker-compose-explorer.yaml +8 -21
- package/dist/compose/rollups/docker-compose-graphql.yaml +3 -29
- package/dist/compose/rollups/docker-compose-node.yaml +2 -12
- package/dist/compose/rollups/proxy/anvil.yaml +17 -0
- package/dist/config.d.ts +2 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +4 -3
- package/dist/contracts.d.ts +1695 -1636
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +632 -592
- package/dist/exec/rollups.js +6 -6
- package/dist/wallet.d.ts.map +1 -1
- package/dist/wallet.js +29 -11
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from "@commander-js/extra-typings";
|
|
2
|
-
export declare const DEFAULT_TEMPLATES_BRANCH = "sdk-
|
|
2
|
+
export declare const DEFAULT_TEMPLATES_BRANCH = "prerelease/sdk-12";
|
|
3
3
|
export declare const createCreateCommand: () => Command<[string], {
|
|
4
4
|
template: "cpp" | "cpp-low-level" | "go" | "javascript" | "lua" | "python" | "ruby" | "rust" | "typescript";
|
|
5
5
|
branch: string;
|
|
@@ -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,
|
|
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,sBAAsB,CAAC;AAmC5D,eAAO,MAAM,mBAAmB;;;MA0B/B,CAAC"}
|
package/dist/commands/create.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Command, Option } from "@commander-js/extra-typings";
|
|
|
2
2
|
import chalk from "chalk";
|
|
3
3
|
import { downloadTemplate } from "giget";
|
|
4
4
|
import ora from "ora";
|
|
5
|
-
export const DEFAULT_TEMPLATES_BRANCH = "sdk-
|
|
5
|
+
export const DEFAULT_TEMPLATES_BRANCH = "prerelease/sdk-12";
|
|
6
6
|
const TEMPLATES = [
|
|
7
7
|
"cpp",
|
|
8
8
|
"cpp-low-level",
|
|
@@ -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;
|
|
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 {
|
|
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
|
-
|
|
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: [
|
|
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.
|
|
155
|
-
throw new Error(registration.
|
|
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,
|
|
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 ===
|
|
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;
|
|
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 {
|
|
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}
|
|
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:
|
|
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
|
-
|
|
182
|
+
const pullArgs = ["--policy", "missing"];
|
|
183
|
+
await execa("docker", [...composeArgs, "pull", ...pullArgs], {
|
|
182
184
|
env,
|
|
183
185
|
stdio: "inherit",
|
|
184
186
|
});
|
package/dist/commands/send.js
CHANGED
|
@@ -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,
|
|
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)
|
|
@@ -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:-
|
|
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:-
|
|
23
|
+
CARTESI_BLOCKCHAIN_DEFAULT_BLOCK="${CARTESI_BLOCKCHAIN_DEFAULT_BLOCK:-latest}"
|
|
24
24
|
|
|
25
25
|
# contracts
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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/
|
|
34
|
+
CARTESI_DATABASE_CONNECTION="postgres://postgres:password@database:5432/rollupsdb?sslmode=disable"
|
|
@@ -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
|
-
|
|
25
|
-
condition:
|
|
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:
|
|
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
|
-
|
|
82
|
-
condition:
|
|
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/
|
|
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
|
-
|
|
41
|
-
condition:
|
|
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:-
|
|
33
|
+
CHAIN_ID: ${CHAIN_ID:-13370}
|
|
47
34
|
RPC_URL_31337: ${RPC_URL:-http://anvil:8545}
|
|
48
|
-
|
|
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
|
-
|
|
56
|
-
condition:
|
|
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
|
-
|
|
64
|
-
condition:
|
|
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/
|
|
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
|
-
|
|
45
|
-
condition:
|
|
18
|
+
database:
|
|
19
|
+
condition: service_healthy
|
|
46
20
|
|
|
47
21
|
proxy:
|
|
48
22
|
volumes:
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
services:
|
|
2
|
-
rollups-node
|
|
3
|
-
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
|
|
32
|
+
export declare const DEFAULT_SDK_VERSION = "0.12.0-alpha.13";
|
|
33
|
+
export declare const DEFAULT_SDK_IMAGE = "cartesi/sdk:0.12.0-alpha.13";
|
|
33
34
|
type DriveFormat = "ext2" | "sqfs";
|
|
34
35
|
export type ImageInfo = {
|
|
35
36
|
cmd: string[];
|
package/dist/config.d.ts.map
CHANGED
|
@@ -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,qBAA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B,GACnB,cAAc,CACnB,GAAG;IACA,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,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
|
|
67
|
+
export const DEFAULT_SDK_VERSION = "0.12.0-alpha.13";
|
|
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:
|
|
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,
|
|
365
|
+
sdk: parseString(toml.sdk, DEFAULT_SDK_IMAGE),
|
|
365
366
|
};
|
|
366
367
|
return config;
|
|
367
368
|
};
|