@cartesi/cli 2.0.0-alpha.11 → 2.0.0-alpha.12
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/base.d.ts +2 -2
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +9 -13
- package/dist/builder/directory.d.ts +2 -2
- package/dist/builder/directory.d.ts.map +1 -1
- package/dist/builder/directory.js +1 -1
- package/dist/builder/docker.d.ts +1 -1
- package/dist/builder/docker.d.ts.map +1 -1
- package/dist/builder/docker.js +8 -8
- package/dist/builder/empty.d.ts +2 -2
- package/dist/builder/empty.d.ts.map +1 -1
- package/dist/builder/empty.js +1 -1
- package/dist/builder/none.d.ts +2 -2
- package/dist/builder/none.d.ts.map +1 -1
- package/dist/builder/none.js +1 -1
- package/dist/builder/tar.d.ts +2 -2
- package/dist/builder/tar.d.ts.map +1 -1
- package/dist/builder/tar.js +1 -1
- package/dist/commands/build.js +2 -2
- package/dist/commands/create.d.ts +5 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +31 -4
- package/dist/commands/deploy.d.ts +16 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +267 -8
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +3 -9
- package/dist/commands/{rollups/logs.d.ts → logs.d.ts} +2 -3
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/{rollups/logs.js → logs.js} +4 -3
- package/dist/commands/run.js +2 -2
- package/dist/commands/send/eip712.d.ts +34 -0
- package/dist/commands/send/eip712.d.ts.map +1 -0
- package/dist/commands/send/eip712.js +81 -0
- package/dist/commands/send/erc721.d.ts.map +1 -1
- package/dist/commands/send/erc721.js +1 -1
- package/dist/commands/send/generic.d.ts +2 -0
- package/dist/commands/send/generic.d.ts.map +1 -1
- package/dist/commands/send/generic.js +18 -10
- package/dist/commands/send.d.ts +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +4 -4
- package/dist/commands/shell.js +1 -1
- package/dist/commands/{rollups/start.d.ts → start.d.ts} +3 -3
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/{rollups/start.js → start.js} +24 -15
- package/dist/commands/{rollups/status.d.ts → status.d.ts} +2 -3
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/{rollups/status.js → status.js} +7 -6
- package/dist/commands/stop.d.ts +5 -0
- package/dist/commands/stop.d.ts.map +1 -0
- package/dist/commands/{rollups/stop.js → stop.js} +4 -3
- package/dist/compose/{rollups/default.env → default.env} +1 -0
- package/dist/compose/{rollups/docker-compose-bundler.yaml → docker-compose-bundler.yaml} +0 -6
- package/dist/compose/{rollups/docker-compose-espresso.yaml → docker-compose-espresso.yaml} +11 -20
- package/dist/compose/{rollups/docker-compose-graphql.yaml → docker-compose-graphql.yaml} +2 -2
- package/dist/compose/{rollups/docker-compose-node.yaml → docker-compose-node.yaml} +6 -1
- package/dist/compose/docker-compose-passkey-server.yaml +15 -0
- package/dist/compose/{rollups/proxy → proxy}/bundler.yaml +12 -0
- package/dist/compose/proxy/passkey-server.yaml +17 -0
- package/dist/compose/{rollups/proxy → proxy}/rollups-node.yaml +2 -2
- package/dist/config.d.ts +4 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +22 -21
- package/dist/exec/cartesi-machine.d.ts +2 -2
- package/dist/exec/cartesi-machine.d.ts.map +1 -1
- package/dist/exec/cartesi-machine.js +1 -1
- package/dist/exec/crane.d.ts +3 -3
- package/dist/exec/crane.d.ts.map +1 -1
- package/dist/exec/crane.js +1 -1
- package/dist/exec/genext2fs.d.ts +2 -2
- package/dist/exec/genext2fs.d.ts.map +1 -1
- package/dist/exec/genext2fs.js +2 -2
- package/dist/exec/mksquashfs.d.ts +2 -2
- package/dist/exec/mksquashfs.d.ts.map +1 -1
- package/dist/exec/mksquashfs.js +2 -2
- package/dist/exec/rollups.d.ts +1 -1
- package/dist/exec/rollups.d.ts.map +1 -1
- package/dist/exec/util.d.ts +2 -2
- package/dist/exec/util.d.ts.map +1 -1
- package/dist/exec/util.js +6 -10
- package/dist/index.js +10 -4
- package/dist/machine.d.ts +1 -1
- package/dist/machine.d.ts.map +1 -1
- package/dist/prompts.d.ts +3 -3
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +1 -1
- package/dist/template.d.ts +2 -2
- package/dist/template.d.ts.map +1 -1
- package/dist/template.js +2 -2
- package/dist/wallet.d.ts +1 -1
- package/dist/wallet.d.ts.map +1 -1
- package/dist/wallet.js +77 -93
- package/package.json +5 -6
- package/dist/commands/rollups/create.d.ts +0 -7
- package/dist/commands/rollups/create.d.ts.map +0 -1
- package/dist/commands/rollups/create.js +0 -36
- package/dist/commands/rollups/deploy.d.ts +0 -16
- package/dist/commands/rollups/deploy.d.ts.map +0 -1
- package/dist/commands/rollups/deploy.js +0 -237
- package/dist/commands/rollups/logs.d.ts.map +0 -1
- package/dist/commands/rollups/start.d.ts.map +0 -1
- package/dist/commands/rollups/status.d.ts.map +0 -1
- package/dist/commands/rollups/stop.d.ts +0 -5
- package/dist/commands/rollups/stop.d.ts.map +0 -1
- package/dist/commands/rollups.d.ts +0 -6
- package/dist/commands/rollups.d.ts.map +0 -1
- package/dist/commands/rollups.js +0 -21
- /package/dist/compose/{rollups/docker-compose-anvil.yaml → docker-compose-anvil.yaml} +0 -0
- /package/dist/compose/{rollups/docker-compose-database.yaml → docker-compose-database.yaml} +0 -0
- /package/dist/compose/{rollups/docker-compose-explorer.yaml → docker-compose-explorer.yaml} +0 -0
- /package/dist/compose/{rollups/docker-compose-node-cpus.yaml → docker-compose-node-cpus.yaml} +0 -0
- /package/dist/compose/{rollups/docker-compose-node-memory.yaml → docker-compose-node-memory.yaml} +0 -0
- /package/dist/compose/{rollups/docker-compose-paymaster.yaml → docker-compose-paymaster.yaml} +0 -0
- /package/dist/compose/{rollups/docker-compose-proxy.yaml → docker-compose-proxy.yaml} +0 -0
- /package/dist/compose/{rollups/proxy → proxy}/anvil.yaml +0 -0
- /package/dist/compose/{rollups/proxy → proxy}/espresso.yaml +0 -0
- /package/dist/compose/{rollups/proxy → proxy}/explorer-api.yaml +0 -0
- /package/dist/compose/{rollups/proxy → proxy}/explorer.yaml +0 -0
- /package/dist/compose/{rollups/proxy → proxy}/graphql.yaml +0 -0
- /package/dist/compose/{rollups/proxy → proxy}/paymaster.yaml +0 -0
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { Command } from "@commander-js/extra-typings";
|
|
2
2
|
import { execa } from "execa";
|
|
3
|
+
import { DEFAULT_COMPOSE_ENVIRONMENT_NAME } from "../config.js";
|
|
3
4
|
export const createLogsCommand = () => {
|
|
4
5
|
return new Command("logs")
|
|
5
|
-
.description("Show logs of a local
|
|
6
|
+
.description("Show logs of a local environment.")
|
|
7
|
+
.option("--environment-name <string>", "name of environment", DEFAULT_COMPOSE_ENVIRONMENT_NAME)
|
|
6
8
|
.option("-f, --follow", "Follow log output")
|
|
7
9
|
.option("--no-color", "Produce monochrome output")
|
|
8
10
|
.option("--since <string>", "Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)")
|
|
9
11
|
.option("-n, --tail <string>", "Number of lines to show from the end of the logs", "all")
|
|
10
12
|
.option("--until <string>", "Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)")
|
|
11
13
|
.configureHelp({ showGlobalOptions: true })
|
|
12
|
-
.action(async ({ follow, color, since, tail, until }, command) => {
|
|
13
|
-
const { environmentName } = command.optsWithGlobals();
|
|
14
|
+
.action(async ({ environmentName, follow, color, since, tail, until }, command) => {
|
|
14
15
|
const logOptions = ["--no-log-prefix"];
|
|
15
16
|
if (follow)
|
|
16
17
|
logOptions.push("--follow");
|
package/dist/commands/run.js
CHANGED
|
@@ -3,8 +3,8 @@ import chalk from "chalk";
|
|
|
3
3
|
export const createRunCommand = () => {
|
|
4
4
|
return new Command("run")
|
|
5
5
|
.description("Run a local cartesi node for the application.")
|
|
6
|
-
.summary("DEPRECATED: use '
|
|
6
|
+
.summary("DEPRECATED: use 'start' instead")
|
|
7
7
|
.action(async () => {
|
|
8
|
-
console.warn(chalk.yellow("run command is deprecated, use '
|
|
8
|
+
console.warn(chalk.yellow("run command is deprecated, use 'start' and 'deploy' instead"));
|
|
9
9
|
});
|
|
10
10
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Hex, WalletClient } from "viem";
|
|
2
|
+
import type { Address } from "viem/accounts";
|
|
3
|
+
type SendOptions = {
|
|
4
|
+
eip712TxUrl: string;
|
|
5
|
+
chainId: number;
|
|
6
|
+
maxGasPrice: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const DEFAULT_SEND_CONFIG: Readonly<SendOptions>;
|
|
9
|
+
type TypedData = {
|
|
10
|
+
domain: {
|
|
11
|
+
name: string;
|
|
12
|
+
version: string;
|
|
13
|
+
chainId: number;
|
|
14
|
+
verifyingContract: Address;
|
|
15
|
+
};
|
|
16
|
+
types: Record<string, {
|
|
17
|
+
name: string;
|
|
18
|
+
type: string;
|
|
19
|
+
}[]>;
|
|
20
|
+
primaryType: string;
|
|
21
|
+
message: Record<string, unknown>;
|
|
22
|
+
};
|
|
23
|
+
/** Fetches the nonce for a given user and application */
|
|
24
|
+
export declare const getNonceForEip712: (application: Address, user: Address, sendOptions: SendOptions) => Promise<number>;
|
|
25
|
+
/** Submits a transaction to L2 */
|
|
26
|
+
export declare const postEip712Transaction: (data: Record<string, unknown>, sendOptions: SendOptions) => Promise<{
|
|
27
|
+
id: string;
|
|
28
|
+
}>;
|
|
29
|
+
/** Creates a Typed Data object for signing */
|
|
30
|
+
export declare const createEip712TypedData: (app: Address, data: Hex, nonce: number, sendOptions: SendOptions) => Promise<TypedData>;
|
|
31
|
+
/** Sends a transaction to L2 */
|
|
32
|
+
export declare const sendEip712: (walletClient: WalletClient, applicationAddress: Address, payload: Hex, sendOptions?: Partial<SendOptions>) => Promise<string>;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=eip712.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eip712.d.ts","sourceRoot":"","sources":["../../../src/commands/send/eip712.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAI5C,CAAC;AAEX,KAAK,SAAS,GAAG;IACb,MAAM,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,OAAO,CAAC;KAC9B,CAAC;IACF,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC,CAAC;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,CAAC;AA2CF,yDAAyD;AACzD,eAAO,MAAM,iBAAiB,GAC1B,aAAa,OAAO,EACpB,MAAM,OAAO,EACb,aAAa,WAAW,KACzB,OAAO,CAAC,MAAM,CAMhB,CAAC;AAEF,kCAAkC;AAClC,eAAO,MAAM,qBAAqB,GAC9B,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,aAAa,WAAW,KACzB,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAMxB,CAAC;AAEF,8CAA8C;AAC9C,eAAO,MAAM,qBAAqB,GAC9B,KAAK,OAAO,EACZ,MAAM,GAAG,EACT,OAAO,MAAM,EACb,aAAa,WAAW,KACzB,OAAO,CAAC,SAAS,CAUnB,CAAC;AAEF,gCAAgC;AAChC,eAAO,MAAM,UAAU,GACnB,cAAc,YAAY,EAC1B,oBAAoB,OAAO,EAC3B,SAAS,GAAG,EACZ,cAAc,OAAO,CAAC,WAAW,CAAC,KACnC,OAAO,CAAC,MAAM,CAyBhB,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export const DEFAULT_SEND_CONFIG = {
|
|
2
|
+
eip712TxUrl: "http://localhost:8080/transaction",
|
|
3
|
+
chainId: 31337,
|
|
4
|
+
maxGasPrice: 10,
|
|
5
|
+
};
|
|
6
|
+
const fetchJSON = async (url, options) => {
|
|
7
|
+
const response = await fetch(url, options);
|
|
8
|
+
if (!response.ok) {
|
|
9
|
+
throw new Error(`HTTP Error: ${response.status} - ${await response.text()}`);
|
|
10
|
+
}
|
|
11
|
+
return response.json();
|
|
12
|
+
};
|
|
13
|
+
const serializeBigInt = (_key, value) => typeof value === "bigint" ? value.toString() : value;
|
|
14
|
+
const createTypedDataTemplate = (chainId, verifyingContract) => ({
|
|
15
|
+
domain: {
|
|
16
|
+
name: "Cartesi",
|
|
17
|
+
version: "0.1.0",
|
|
18
|
+
chainId,
|
|
19
|
+
verifyingContract,
|
|
20
|
+
},
|
|
21
|
+
types: {
|
|
22
|
+
EIP712Domain: [
|
|
23
|
+
{ name: "name", type: "string" },
|
|
24
|
+
{ name: "version", type: "string" },
|
|
25
|
+
{ name: "chainId", type: "uint256" },
|
|
26
|
+
{ name: "verifyingContract", type: "address" },
|
|
27
|
+
],
|
|
28
|
+
CartesiMessage: [
|
|
29
|
+
{ name: "app", type: "address" },
|
|
30
|
+
{ name: "nonce", type: "uint64" },
|
|
31
|
+
{ name: "max_gas_price", type: "uint128" },
|
|
32
|
+
{ name: "data", type: "bytes" },
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
primaryType: "CartesiMessage",
|
|
36
|
+
message: {},
|
|
37
|
+
});
|
|
38
|
+
/** Fetches the nonce for a given user and application */
|
|
39
|
+
export const getNonceForEip712 = async (application, user, sendOptions) => {
|
|
40
|
+
return fetchJSON(`${sendOptions.eip712TxUrl}/nonce`, {
|
|
41
|
+
method: "POST",
|
|
42
|
+
headers: { "Content-Type": "application/json" },
|
|
43
|
+
body: JSON.stringify({ msg_sender: user, app_contract: application }),
|
|
44
|
+
}).then((res) => res.nonce);
|
|
45
|
+
};
|
|
46
|
+
/** Submits a transaction to L2 */
|
|
47
|
+
export const postEip712Transaction = async (data, sendOptions) => {
|
|
48
|
+
return fetchJSON(`${sendOptions.eip712TxUrl}/submit`, {
|
|
49
|
+
method: "POST",
|
|
50
|
+
headers: { "Content-Type": "application/json" },
|
|
51
|
+
body: JSON.stringify(data, serializeBigInt),
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
/** Creates a Typed Data object for signing */
|
|
55
|
+
export const createEip712TypedData = async (app, data, nonce, sendOptions) => {
|
|
56
|
+
return {
|
|
57
|
+
...createTypedDataTemplate(sendOptions.chainId, app),
|
|
58
|
+
message: {
|
|
59
|
+
app,
|
|
60
|
+
nonce,
|
|
61
|
+
data,
|
|
62
|
+
max_gas_price: BigInt(sendOptions.maxGasPrice),
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
/** Sends a transaction to L2 */
|
|
67
|
+
export const sendEip712 = async (walletClient, applicationAddress, payload, sendOptions) => {
|
|
68
|
+
if (!walletClient.account) {
|
|
69
|
+
throw new Error("Wallet account is missing.");
|
|
70
|
+
}
|
|
71
|
+
const options = { ...DEFAULT_SEND_CONFIG, ...sendOptions };
|
|
72
|
+
const account = walletClient.account.address;
|
|
73
|
+
const nonce = await getNonceForEip712(applicationAddress, account, options);
|
|
74
|
+
const typedData = await createEip712TypedData(applicationAddress, payload, nonce, options);
|
|
75
|
+
const signature = await walletClient.signTypedData({
|
|
76
|
+
account,
|
|
77
|
+
...typedData,
|
|
78
|
+
});
|
|
79
|
+
const { id } = await postEip712Transaction({ typedData, account, signature }, options);
|
|
80
|
+
return id;
|
|
81
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"erc721.d.ts","sourceRoot":"","sources":["../../../src/commands/send/erc721.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"erc721.d.ts","sourceRoot":"","sources":["../../../src/commands/send/erc721.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAuDtD,eAAO,MAAM,mBAAmB;;;;;;;;;EAuD/B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from "@commander-js/extra-typings";
|
|
2
2
|
import input from "@inquirer/input";
|
|
3
3
|
import ora from "ora";
|
|
4
|
-
import { erc721Abi, getAddress, isAddress } from "viem";
|
|
4
|
+
import { erc721Abi, getAddress, isAddress, } from "viem";
|
|
5
5
|
import { erc721PortalAbi, erc721PortalAddress } from "../../contracts.js";
|
|
6
6
|
import { connect, getInputApplicationAddress, } from "../send.js";
|
|
7
7
|
const readToken = async (publicClient, address) => {
|
|
@@ -2,6 +2,8 @@ import { Command } from "@commander-js/extra-typings";
|
|
|
2
2
|
export declare const createGenericCommand: () => Command<[], {
|
|
3
3
|
input?: string | undefined;
|
|
4
4
|
inputEncoding?: "string" | "hex" | "abi" | undefined;
|
|
5
|
+
type: "evm" | "eip712";
|
|
6
|
+
eip712TxUrl: string;
|
|
5
7
|
inputAbiParams?: string | undefined;
|
|
6
8
|
}, {
|
|
7
9
|
chainId: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic.d.ts","sourceRoot":"","sources":["../../../src/commands/send/generic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"generic.d.ts","sourceRoot":"","sources":["../../../src/commands/send/generic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAqG9D,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EA8DhC,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { encodeAbiParameters, getAddress, isAddress, isHex, parseAbiParameters,
|
|
|
4
4
|
import { inputBoxAbi, inputBoxAddress } from "../../contracts.js";
|
|
5
5
|
import { bytesInput } from "../../prompts.js";
|
|
6
6
|
import { connect, getInputApplicationAddress, } from "../send.js";
|
|
7
|
+
import { DEFAULT_SEND_CONFIG, sendEip712 } from "./eip712.js";
|
|
7
8
|
const getInput = async (options) => {
|
|
8
9
|
const input = options.input;
|
|
9
10
|
const encoding = options.inputEncoding;
|
|
@@ -15,11 +16,11 @@ const getInput = async (options) => {
|
|
|
15
16
|
}
|
|
16
17
|
return input;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
+
if (encoding === "string") {
|
|
19
20
|
// encode UTF-8 string as hex
|
|
20
21
|
return stringToHex(input);
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
+
if (encoding === "abi") {
|
|
23
24
|
const abiParams = options.inputAbiParams;
|
|
24
25
|
if (!abiParams) {
|
|
25
26
|
throw new Error("Undefined input-abi-params");
|
|
@@ -72,15 +73,11 @@ const getInput = async (options) => {
|
|
|
72
73
|
}
|
|
73
74
|
return encodeAbiParameters(abiParameters, values);
|
|
74
75
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return input;
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
// encode UTF-8 string as hex
|
|
81
|
-
return stringToHex(input);
|
|
82
|
-
}
|
|
76
|
+
if (isHex(input)) {
|
|
77
|
+
return input;
|
|
83
78
|
}
|
|
79
|
+
// encode UTF-8 string as hex
|
|
80
|
+
return stringToHex(input);
|
|
84
81
|
}
|
|
85
82
|
return undefined;
|
|
86
83
|
};
|
|
@@ -90,6 +87,9 @@ export const createGenericCommand = () => {
|
|
|
90
87
|
.configureHelp({ showGlobalOptions: true })
|
|
91
88
|
.option("--input <input>", "input payload")
|
|
92
89
|
.addOption(new Option("--input-encoding <input-encoding>", "input encoding").choices(["hex", "string", "abi"]))
|
|
90
|
+
.addOption(new Option("--type <type>", "Transaction type").choices(["evm", "eip712"])
|
|
91
|
+
.default("evm"))
|
|
92
|
+
.addOption(new Option("--eip712-tx-url <url>", "EIP-712 base url").default(DEFAULT_SEND_CONFIG.eip712TxUrl))
|
|
93
93
|
.option("--input-abi-params <input-abi-params>", "input abi params")
|
|
94
94
|
.action(async (options, command) => {
|
|
95
95
|
const sendOptions = command.optsWithGlobals();
|
|
@@ -99,6 +99,14 @@ export const createGenericCommand = () => {
|
|
|
99
99
|
const applicationAddress = await getInputApplicationAddress(sendOptions.dapp);
|
|
100
100
|
const payload = (await getInput(options)) ||
|
|
101
101
|
(await bytesInput({ message: "Input" }));
|
|
102
|
+
if (options.type === 'eip712') {
|
|
103
|
+
const progress = ora("Sending input...").start();
|
|
104
|
+
const hash = await sendEip712(walletClient, applicationAddress, payload, {
|
|
105
|
+
eip712TxUrl: options.eip712TxUrl,
|
|
106
|
+
});
|
|
107
|
+
progress.succeed(`Input sent: ${hash}`);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
102
110
|
const { request } = await publicClient.simulateContract({
|
|
103
111
|
address: inputBoxAddress,
|
|
104
112
|
abi: inputBoxAbi,
|
package/dist/commands/send.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from "@commander-js/extra-typings";
|
|
2
|
-
import { Address, PublicClient, WalletClient } from "viem";
|
|
2
|
+
import { type Address, type PublicClient, type WalletClient } from "viem";
|
|
3
3
|
export declare const connect: (options: {
|
|
4
4
|
chainId?: number;
|
|
5
5
|
rpcUrl?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/commands/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAGtD,OAAO,
|
|
1
|
+
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/commands/send.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAGtD,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,YAAY,EAEpB,MAAM,MAAM,CAAC;AASd,eAAO,MAAM,OAAO,GAAI,SAAS;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACzB,KAAG,OAAO,CAAC;IACR,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;CAC9B,CAYA,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACnC,OAAO,MAAM,KACd,OAAO,CAAC,OAAO,CAiBjB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;MA6C7B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,UAAU,CACpC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAC/C,CAAC"}
|
package/dist/commands/send.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from "@commander-js/extra-typings";
|
|
2
2
|
import input from "@inquirer/input";
|
|
3
3
|
import select from "@inquirer/select";
|
|
4
|
-
import { isAddress } from "viem";
|
|
4
|
+
import { isAddress, } from "viem";
|
|
5
5
|
import { parseAddress } from "../base.js";
|
|
6
6
|
import { getApplicationAddress } from "../exec/rollups.js";
|
|
7
7
|
import createClients, { supportedChains } from "../wallet.js";
|
|
@@ -13,7 +13,7 @@ export const connect = (options) => {
|
|
|
13
13
|
const { chainId, rpcUrl, mnemonic, mnemonicIndex } = options;
|
|
14
14
|
// create viem clients
|
|
15
15
|
return createClients({
|
|
16
|
-
chain: supportedChains({ includeDevnet: true }).find((c) => c.id
|
|
16
|
+
chain: supportedChains({ includeDevnet: true }).find((c) => c.id === chainId),
|
|
17
17
|
rpcUrl,
|
|
18
18
|
mnemonicPassphrase: mnemonic,
|
|
19
19
|
mnemonicIndex,
|
|
@@ -37,10 +37,10 @@ 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, 13370)
|
|
40
|
+
.option("--chain-id <id>", "Chain ID", Number.parseInt, 13370)
|
|
41
41
|
.option("--rpc-url <url>", "RPC URL")
|
|
42
42
|
.option("--mnemonic <phrase>", "Mnemonic passphrase")
|
|
43
|
-
.option("--mnemonic-index <index>", "Mnemonic account index", parseInt, 0)
|
|
43
|
+
.option("--mnemonic-index <index>", "Mnemonic account index", Number.parseInt, 0)
|
|
44
44
|
.option("--dapp <address>", "Application address", parseAddress, undefined)
|
|
45
45
|
.action(async (options, program) => {
|
|
46
46
|
// Get the registered subcommands from the program
|
package/dist/commands/shell.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command } from "@commander-js/extra-typings";
|
|
2
2
|
import fs from "fs-extra";
|
|
3
|
-
import path from "path";
|
|
3
|
+
import path from "node:path";
|
|
4
4
|
import { getApplicationConfig, getContextPath } from "../base.js";
|
|
5
5
|
import { bootMachine } from "../machine.js";
|
|
6
6
|
export const createShellCommand = () => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Command } from "@commander-js/extra-typings";
|
|
2
2
|
export declare const createStartCommand: () => Command<[], {
|
|
3
|
+
runtimeVersion: string;
|
|
4
|
+
environmentName: string;
|
|
3
5
|
blockTime: number;
|
|
4
6
|
defaultBlock: "latest" | "pending" | "safe" | "finalized";
|
|
5
7
|
cpus?: number | undefined;
|
|
@@ -8,7 +10,5 @@ export declare const createStartCommand: () => Command<[], {
|
|
|
8
10
|
port: number;
|
|
9
11
|
dryRun: boolean;
|
|
10
12
|
verbose: boolean;
|
|
11
|
-
}, {
|
|
12
|
-
environmentName: string;
|
|
13
|
-
}>;
|
|
13
|
+
}, {}>;
|
|
14
14
|
//# sourceMappingURL=start.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAwJ9D,eAAO,MAAM,kBAAkB;;;;;;;;;;;MA8K9B,CAAC"}
|
|
@@ -2,10 +2,10 @@ import { Command, Option } from "@commander-js/extra-typings";
|
|
|
2
2
|
import chalk from "chalk";
|
|
3
3
|
import { execa } from "execa";
|
|
4
4
|
import { Listr } from "listr2";
|
|
5
|
+
import path from "node:path";
|
|
5
6
|
import pRetry from "p-retry";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import { DEFAULT_SDK_IMAGE, DEFAULT_SDK_VERSION } from "../../config.js";
|
|
7
|
+
import { getServiceHealth } from "../base.js";
|
|
8
|
+
import { DEFAULT_COMPOSE_ENVIRONMENT_NAME, 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
|
|
@@ -84,6 +84,14 @@ const availableServices = [
|
|
|
84
84
|
waitTitle: `${chalk.cyan("paymaster")} service starting...`,
|
|
85
85
|
errorTitle: `${chalk.red("paymaster")} service failed`,
|
|
86
86
|
},
|
|
87
|
+
{
|
|
88
|
+
name: "passkey",
|
|
89
|
+
file: "docker-compose-passkey-server.yaml",
|
|
90
|
+
healthySemaphore: "passkey-server",
|
|
91
|
+
healthyTitle: (port) => `${chalk.cyan("passkey")} service ready at ${chalk.cyan(`${host}:${port}/passkey`)}`,
|
|
92
|
+
waitTitle: `${chalk.cyan("passkey")} service starting...`,
|
|
93
|
+
errorTitle: `${chalk.red("passkey")} service failed`,
|
|
94
|
+
},
|
|
87
95
|
];
|
|
88
96
|
const serviceMonitorTask = (options) => {
|
|
89
97
|
const { errorTitle, healthyTitle, service, waitTitle } = options;
|
|
@@ -104,8 +112,12 @@ const serviceMonitorTask = (options) => {
|
|
|
104
112
|
};
|
|
105
113
|
export const createStartCommand = () => {
|
|
106
114
|
return new Command("start")
|
|
107
|
-
.description("Start a local
|
|
115
|
+
.description("Start a local environment.")
|
|
108
116
|
.configureHelp({ showGlobalOptions: true })
|
|
117
|
+
.addOption(new Option("--runtime-version <version>", "version for Cartesi Rollups Runtime to use")
|
|
118
|
+
.default(DEFAULT_SDK_VERSION)
|
|
119
|
+
.hideHelp())
|
|
120
|
+
.option("--environment-name <string>", "name of environment", DEFAULT_COMPOSE_ENVIRONMENT_NAME)
|
|
109
121
|
.addOption(new Option("--block-time <number>", "interval between blocks (in seconds)")
|
|
110
122
|
.argParser(Number)
|
|
111
123
|
.default(5))
|
|
@@ -115,14 +127,13 @@ export const createStartCommand = () => {
|
|
|
115
127
|
.addOption(new Option("--cpus <number>", "number of cpu limits for the rollups-node").argParser(Number))
|
|
116
128
|
.addOption(new Option("--memory <number>", "memory limit for the rollups-node in MB").argParser(Number))
|
|
117
129
|
.option("--services <string>", `optional services to start, comma separated list from [${availableServices.map(({ name }) => name).join(", ")}]`, commaSeparatedList, [])
|
|
118
|
-
.option("-p, --port <number>", "port to listen on",
|
|
130
|
+
.option("-p, --port <number>", "port to listen on", Number, 8080)
|
|
119
131
|
.option("--dry-run", "show the docker compose configuration", false)
|
|
120
132
|
.option("-v, --verbose", "verbose output", false)
|
|
121
133
|
.action(async (options, command) => {
|
|
122
|
-
const { environmentName } =
|
|
123
|
-
const { blockTime, cpus, defaultBlock, dryRun, memory, port, services, verbose, } = options;
|
|
134
|
+
const { blockTime, cpus, defaultBlock, dryRun, environmentName, memory, port, services, verbose, runtimeVersion, } = options;
|
|
124
135
|
// path of the tool instalation
|
|
125
|
-
const binPath = path.join(path.dirname(new URL(import.meta.url).pathname), "
|
|
136
|
+
const binPath = path.join(path.dirname(new URL(import.meta.url).pathname), "..");
|
|
126
137
|
// setup the environment variable used in docker compose
|
|
127
138
|
const env = {
|
|
128
139
|
BLOCK_TIME: blockTime.toString(),
|
|
@@ -132,8 +143,8 @@ export const createStartCommand = () => {
|
|
|
132
143
|
CARTESI_LISTEN_PORT: port.toString(),
|
|
133
144
|
CARTESI_ROLLUPS_NODE_CPUS: cpus?.toString(),
|
|
134
145
|
CARTESI_ROLLUPS_NODE_MEMORY: memory?.toString(),
|
|
135
|
-
CARTESI_SDK_IMAGE: DEFAULT_SDK_IMAGE
|
|
136
|
-
CARTESI_SDK_VERSION:
|
|
146
|
+
CARTESI_SDK_IMAGE: `${DEFAULT_SDK_IMAGE}:${runtimeVersion}`,
|
|
147
|
+
CARTESI_SDK_VERSION: runtimeVersion,
|
|
137
148
|
};
|
|
138
149
|
// build a list of unique compose files
|
|
139
150
|
const composeFiles = [
|
|
@@ -153,12 +164,10 @@ export const createStartCommand = () => {
|
|
|
153
164
|
// add to compose files list
|
|
154
165
|
composeFiles.push(...optionalServices.map(({ file }) => file));
|
|
155
166
|
// create the "--file <file>" list
|
|
156
|
-
const files = composeFiles
|
|
157
|
-
.map((f) => [
|
|
167
|
+
const files = composeFiles.flatMap((f) => [
|
|
158
168
|
"--file",
|
|
159
|
-
path.join(binPath, "compose",
|
|
160
|
-
])
|
|
161
|
-
.flat();
|
|
169
|
+
path.join(binPath, "compose", f),
|
|
170
|
+
]);
|
|
162
171
|
const composeArgs = [
|
|
163
172
|
"compose",
|
|
164
173
|
...files,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAOtD,eAAO,MAAM,mBAAmB;;;MAkD/B,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Command } from "@commander-js/extra-typings";
|
|
2
2
|
import chalk from "chalk";
|
|
3
3
|
import Table from "cli-table3";
|
|
4
|
-
import { getServiceState } from "
|
|
5
|
-
import {
|
|
4
|
+
import { getServiceState } from "../base.js";
|
|
5
|
+
import { DEFAULT_COMPOSE_ENVIRONMENT_NAME } from "../config.js";
|
|
6
|
+
import { getDeployments } from "../exec/rollups.js";
|
|
6
7
|
export const createStatusCommand = () => {
|
|
7
8
|
return new Command("status")
|
|
8
|
-
.description("Shows the status of a local
|
|
9
|
+
.description("Shows the status of a local environment.")
|
|
9
10
|
.configureHelp({ showGlobalOptions: true })
|
|
11
|
+
.option("--environment-name <string>", "name of environment", DEFAULT_COMPOSE_ENVIRONMENT_NAME)
|
|
10
12
|
.option("--json", "output in JSON format")
|
|
11
|
-
.action(async ({ json }, command) => {
|
|
12
|
-
const { environmentName } = command.optsWithGlobals();
|
|
13
|
+
.action(async ({ environmentName, json }, command) => {
|
|
13
14
|
const status = await getServiceState({
|
|
14
15
|
environmentName,
|
|
15
16
|
service: "rollups-node",
|
|
@@ -22,7 +23,7 @@ export const createStatusCommand = () => {
|
|
|
22
23
|
}));
|
|
23
24
|
}
|
|
24
25
|
else {
|
|
25
|
-
console.log(`${chalk.cyan(environmentName)} is ${status
|
|
26
|
+
console.log(`${chalk.cyan(environmentName)} is ${status === "running" ? chalk.green("running") : chalk.red("not running")}`);
|
|
26
27
|
if (status === "running") {
|
|
27
28
|
if (deployments.length === 0) {
|
|
28
29
|
console.log(chalk.red("no applications deployed"));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stop.d.ts","sourceRoot":"","sources":["../../src/commands/stop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAMtD,eAAO,MAAM,iBAAiB;;MA4B7B,CAAC"}
|
|
@@ -2,12 +2,13 @@ import { Command } from "@commander-js/extra-typings";
|
|
|
2
2
|
import chalk from "chalk";
|
|
3
3
|
import { execa } from "execa";
|
|
4
4
|
import ora from "ora";
|
|
5
|
+
import { DEFAULT_COMPOSE_ENVIRONMENT_NAME } from "../config.js";
|
|
5
6
|
export const createStopCommand = () => {
|
|
6
7
|
return new Command("stop")
|
|
7
|
-
.description("Stop a local
|
|
8
|
+
.description("Stop a local environment.")
|
|
8
9
|
.configureHelp({ showGlobalOptions: true })
|
|
9
|
-
.
|
|
10
|
-
|
|
10
|
+
.option("--environment-name <string>", "name of environment", DEFAULT_COMPOSE_ENVIRONMENT_NAME)
|
|
11
|
+
.action(async ({ environmentName }, command) => {
|
|
11
12
|
const progress = ora(`Stopping ${chalk.cyan(environmentName)} environment...`).start();
|
|
12
13
|
try {
|
|
13
14
|
await execa("docker", [
|
|
@@ -7,6 +7,7 @@ CARTESI_LOG_LEVEL="${CARTESI_LOG_LEVEL:-info}"
|
|
|
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
9
|
CARTESI_FEATURE_MACHINE_HASH_CHECK_ENABLED="${CARTESI_FEATURE_MACHINE_HASH_CHECK_ENABLED:-true}"
|
|
10
|
+
CARTESI_SNAPSHOTS_DIR="/var/lib/cartesi-rollups-node/snapshots"
|
|
10
11
|
|
|
11
12
|
# rollups
|
|
12
13
|
CARTESI_EVM_READER_RETRY_POLICY_MAX_RETRIES="${CARTESI_EVM_READER_RETRY_POLICY_MAX_RETRIES:-3}"
|
|
@@ -7,8 +7,6 @@ services:
|
|
|
7
7
|
- "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789,0x0000000071727De22E5E9d8BAf0edAc6f37da032"
|
|
8
8
|
- "--log-level"
|
|
9
9
|
- "info"
|
|
10
|
-
- "--entrypoint-simulation-contract"
|
|
11
|
-
- "0x74Cb5e4eE81b86e70f9045036a1C5477de69eE87"
|
|
12
10
|
- "--rpc-url"
|
|
13
11
|
- "http://anvil:8545"
|
|
14
12
|
- "--min-executor-balance"
|
|
@@ -17,8 +15,6 @@ services:
|
|
|
17
15
|
- "0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97"
|
|
18
16
|
- "--executor-private-keys"
|
|
19
17
|
- "0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6,0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356,0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e,0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba,0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a"
|
|
20
|
-
- "--max-block-range"
|
|
21
|
-
- "10000"
|
|
22
18
|
- "--safe-mode"
|
|
23
19
|
- "false"
|
|
24
20
|
- "--port"
|
|
@@ -27,8 +23,6 @@ services:
|
|
|
27
23
|
- "error"
|
|
28
24
|
- "--wallet-client-log-level"
|
|
29
25
|
- "error"
|
|
30
|
-
- "--polling-interval"
|
|
31
|
-
- "100"
|
|
32
26
|
- "--enable-debug-endpoints"
|
|
33
27
|
healthcheck:
|
|
34
28
|
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:4337/health"]
|
|
@@ -2,6 +2,7 @@ services:
|
|
|
2
2
|
espresso:
|
|
3
3
|
image: ${CARTESI_SDK_IMAGE}
|
|
4
4
|
command: ["espresso-dev-node"]
|
|
5
|
+
init: true
|
|
5
6
|
deploy:
|
|
6
7
|
resources:
|
|
7
8
|
limits:
|
|
@@ -14,25 +15,21 @@ services:
|
|
|
14
15
|
condition: service_healthy
|
|
15
16
|
environment:
|
|
16
17
|
ESPRESSO_SEQUENCER_L1_PROVIDER: ${CARTESI_BLOCKCHAIN_HTTP_ENDPOINT:-http://anvil:8545}
|
|
17
|
-
ESPRESSO_SEQUENCER_API_PORT:
|
|
18
|
-
ESPRESSO_BUILDER_PORT:
|
|
19
|
-
ESPRESSO_PROVER_PORT: 8772
|
|
18
|
+
ESPRESSO_SEQUENCER_API_PORT: 24000
|
|
19
|
+
ESPRESSO_BUILDER_PORT: 23000
|
|
20
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
21
|
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: "
|
|
28
|
-
ESPRESSO_STATE_PROVER_UPDATE_INTERVAL: "
|
|
22
|
+
ESPRESSO_SEQUENCER_L1_POLLING_INTERVAL: "${BLOCK_TIME}s"
|
|
23
|
+
ESPRESSO_STATE_PROVER_UPDATE_INTERVAL: "10s"
|
|
24
|
+
ESPRESSO_SEQUENCER_DATABASE_MAX_CONNECTIONS: 25
|
|
25
|
+
ESPRESSO_SEQUENCER_STORAGE_PATH: /data/espresso
|
|
29
26
|
healthcheck:
|
|
30
27
|
test:
|
|
31
28
|
[
|
|
32
29
|
"CMD",
|
|
33
30
|
"curl",
|
|
34
31
|
"-fsS",
|
|
35
|
-
"http://127.0.0.1:
|
|
32
|
+
"http://127.0.0.1:24000/status/block-height",
|
|
36
33
|
]
|
|
37
34
|
start_period: 10s
|
|
38
35
|
start_interval: 200ms
|
|
@@ -40,15 +37,11 @@ services:
|
|
|
40
37
|
timeout: 1s
|
|
41
38
|
retries: 5
|
|
42
39
|
|
|
43
|
-
rollups-node:
|
|
44
|
-
environment:
|
|
45
|
-
CARTESI_FEATURE_INPUT_READER_ENABLED: false
|
|
46
|
-
|
|
47
40
|
espresso_reader:
|
|
48
41
|
image: ${CARTESI_SDK_IMAGE}
|
|
49
42
|
command: ["cartesi-rollups-espresso-reader"]
|
|
50
43
|
env_file:
|
|
51
|
-
- ${CARTESI_BIN_PATH}/compose/
|
|
44
|
+
- ${CARTESI_BIN_PATH}/compose/default.env
|
|
52
45
|
ports:
|
|
53
46
|
- 8081
|
|
54
47
|
depends_on:
|
|
@@ -57,11 +50,9 @@ services:
|
|
|
57
50
|
espresso:
|
|
58
51
|
condition: service_healthy
|
|
59
52
|
environment:
|
|
60
|
-
|
|
53
|
+
CARTESI_DATABASE_CONNECTION: postgres://postgres:password@database:5432/rollupsdb?sslmode=disable
|
|
61
54
|
ESPRESSO_SERVICE_ENDPOINT: ":8081"
|
|
62
|
-
ESPRESSO_BASE_URL: http://espresso:
|
|
63
|
-
ESPRESSO_NAMESPACE: 51025
|
|
64
|
-
ESPRESSO_STARTING_BLOCK: 101
|
|
55
|
+
ESPRESSO_BASE_URL: http://espresso:24000
|
|
65
56
|
|
|
66
57
|
proxy:
|
|
67
58
|
volumes:
|
|
@@ -2,8 +2,8 @@ services:
|
|
|
2
2
|
graphql:
|
|
3
3
|
image: ${CARTESI_SDK_IMAGE}
|
|
4
4
|
environment:
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
CARTESI_GRAPHQL_DATABASE_CONNECTION: postgres://postgres:password@database:5432/graphql?sslmode=disable
|
|
6
|
+
CARTESI_DATABASE_CONNECTION: postgres://postgres:password@database:5432/rollupsdb?sslmode=disable
|
|
7
7
|
expose:
|
|
8
8
|
- 8080
|
|
9
9
|
command: ["cartesi-rollups-graphql"]
|
|
@@ -19,8 +19,13 @@ services:
|
|
|
19
19
|
retries: 5
|
|
20
20
|
command: ["cartesi-rollups-node"]
|
|
21
21
|
env_file:
|
|
22
|
-
- ${CARTESI_BIN_PATH}/compose/
|
|
22
|
+
- ${CARTESI_BIN_PATH}/compose/default.env
|
|
23
|
+
volumes:
|
|
24
|
+
- snapshots:/var/lib/cartesi-rollups-node/snapshots
|
|
23
25
|
|
|
24
26
|
proxy:
|
|
25
27
|
volumes:
|
|
26
28
|
- ./proxy/rollups-node.yaml:/etc/traefik/conf.d/rollups-node.yaml
|
|
29
|
+
|
|
30
|
+
volumes:
|
|
31
|
+
snapshots:
|