@metamask-previews/java-tron-up 0.0.0-preview-838d6b234 → 0.0.0-preview-2a256aff2

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/CHANGELOG.md CHANGED
@@ -7,8 +7,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ### Added
11
-
12
- - Add the `@metamask/java-tron-up` package ([#8825](https://github.com/MetaMask/core/pull/8825)).
13
-
14
10
  [Unreleased]: https://github.com/MetaMask/core/
package/LICENSE.APACHE2 CHANGED
@@ -186,7 +186,8 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright [yyyy] [name of copyright owner]
189
+ Copyright 2026 MetaMask
190
+
190
191
 
191
192
  Licensed under the Apache License, Version 2.0 (the "License");
192
193
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -1,124 +1,15 @@
1
1
  # `@metamask/java-tron-up`
2
2
 
3
- `java-tron-up` installs a pinned native java-tron runtime for local development
4
- and CI. It follows the same runtime-only shape as `@metamask/foundryup`: this
5
- package installs external runtime artifacts into the MetaMask cache and exposes
6
- binaries in `node_modules/.bin`; the consuming test harness owns process
7
- startup, private-network config, readiness checks, and seeding.
3
+ java-tron runtime installer for MetaMask E2E tests
8
4
 
9
- This package does not use Docker and does not start or seed a TRON node.
5
+ ## Installation
10
6
 
11
- ## Usage
7
+ `yarn add @metamask/java-tron-up`
12
8
 
13
- Install the package in the consuming repo:
9
+ or
14
10
 
15
- ```bash
16
- yarn add @metamask/java-tron-up
17
- npm install @metamask/java-tron-up
18
- ```
11
+ `npm install @metamask/java-tron-up`
19
12
 
20
- For Yarn v4 projects, it is usually simplest to add package scripts in the
21
- consuming repo:
13
+ ## Contributing
22
14
 
23
- ```json
24
- {
25
- "scripts": {
26
- "java-tron-up": "node_modules/.bin/java-tron-up",
27
- "java-tron": "node_modules/.bin/java-tron"
28
- }
29
- }
30
- ```
31
-
32
- Install java-tron and its managed Java runtime:
33
-
34
- ```bash
35
- yarn java-tron-up install
36
- ```
37
-
38
- Run the installed node wrapper:
39
-
40
- ```bash
41
- node_modules/.bin/java-tron -c /absolute/path/to/fullnode.conf --witness
42
- ```
43
-
44
- For MetaMask Extension E2E tests, the Tron seeder should spawn
45
- `node_modules/.bin/java-tron`, pass its generated private-network config, poll
46
- java-tron's HTTP APIs directly, and perform all account/token/staking seeding
47
- itself.
48
-
49
- ## Installed Artifacts
50
-
51
- `java-tron-up` installs:
52
-
53
- - a platform-specific `FullNode.jar`
54
- - a managed Java runtime matching java-tron's architecture requirements
55
- - a `node_modules/.bin/java-tron` wrapper that runs:
56
-
57
- ```bash
58
- java -jar FullNode.jar "$@"
59
- ```
60
-
61
- ## CLI
62
-
63
- ```bash
64
- java-tron-up [install] [options]
65
- java-tron-up cache clean [options]
66
- ```
67
-
68
- Options:
69
-
70
- - `--bin-directory <path>`: directory for generated wrappers. Defaults to
71
- `node_modules/.bin`.
72
- - `--cache-directory <path>`: artifact cache directory. Defaults to
73
- `.metamask/cache`.
74
- - `--full-node-url <url>` and `--full-node-checksum <hash>`: override the
75
- FullNode jar for the current platform.
76
- - `--java-runtime-url <url>` and `--java-runtime-checksum <hash>`: override the
77
- Java runtime archive for the current platform.
78
- - `--platform <platform>`: override platform selection, for example
79
- `linux-x64`.
80
-
81
- ## Default Release
82
-
83
- The package currently pins java-tron `GreatVoyage-v4.8.1` for `darwin-arm64`,
84
- `darwin-x64`, `linux-arm64`, and `linux-x64`.
85
-
86
- java-tron `4.8.1` requires JDK 8 for x86_64 and JDK 17 for arm64, so this
87
- package installs Azul Zulu Java 8 on x64 platforms and Azul Zulu Java 17 on
88
- arm64 platforms.
89
-
90
- ## Cache
91
-
92
- The cache defaults to `.metamask/cache` in the current repo. If `.yarnrc.yml`
93
- contains `enableGlobalCache: true`, the cache moves to `~/.cache/metamask`,
94
- matching the `@metamask/foundryup` behavior.
95
-
96
- Clean only this package's cache namespace:
97
-
98
- ```bash
99
- yarn java-tron-up cache clean
100
- ```
101
-
102
- ## Package Config
103
-
104
- The consuming repo can override the pinned artifact URLs and checksums in its
105
- root `package.json`:
106
-
107
- ```json
108
- {
109
- "javaTronUp": {
110
- "fullNode": {
111
- "version": "GreatVoyage-v4.8.1",
112
- "platforms": {
113
- "linux-x64": {
114
- "url": "https://github.com/tronprotocol/java-tron/releases/download/GreatVoyage-v4.8.1/FullNode.jar",
115
- "checksum": "0e67b2fe75d7077750e73c4fa20725c6e9824657275d96be256ae5da681f9945"
116
- }
117
- }
118
- }
119
- }
120
- }
121
- ```
122
-
123
- Supported package config keys are `javaTronUp`, `javatronup`, and
124
- `java-tron-up`.
15
+ This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/core#readme).
package/dist/index.cjs ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Example function that returns a greeting for the given name.
5
+ *
6
+ * @param name - The name to greet.
7
+ * @returns The greeting.
8
+ */
9
+ function greeter(name) {
10
+ return `Hello, ${name}!`;
11
+ }
12
+ exports.default = greeter;
13
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,SAAwB,OAAO,CAAC,IAAY;IAC1C,OAAO,UAAU,IAAI,GAAG,CAAC;AAC3B,CAAC;AAFD,0BAEC","sourcesContent":["/**\n * Example function that returns a greeting for the given name.\n *\n * @param name - The name to greet.\n * @returns The greeting.\n */\nexport default function greeter(name: string): string {\n return `Hello, ${name}!`;\n}\n"]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Example function that returns a greeting for the given name.
3
+ *
4
+ * @param name - The name to greet.
5
+ * @returns The greeting.
6
+ */
7
+ export default function greeter(name: string): string;
8
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Example function that returns a greeting for the given name.
3
+ *
4
+ * @param name - The name to greet.
5
+ * @returns The greeting.
6
+ */
7
+ export default function greeter(name: string): string;
8
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD"}
package/dist/index.mjs ADDED
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Example function that returns a greeting for the given name.
3
+ *
4
+ * @param name - The name to greet.
5
+ * @returns The greeting.
6
+ */
7
+ export default function greeter(name) {
8
+ return `Hello, ${name}!`;
9
+ }
10
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,IAAY;IAC1C,OAAO,UAAU,IAAI,GAAG,CAAC;AAC3B,CAAC","sourcesContent":["/**\n * Example function that returns a greeting for the given name.\n *\n * @param name - The name to greet.\n * @returns The greeting.\n */\nexport default function greeter(name: string): string {\n return `Hello, ${name}!`;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/java-tron-up",
3
- "version": "0.0.0-preview-838d6b234",
3
+ "version": "0.0.0-preview-2a256aff2",
4
4
  "description": "java-tron runtime installer for MetaMask E2E tests",
5
5
  "keywords": [
6
6
  "Ethereum",
@@ -15,11 +15,25 @@
15
15
  "type": "git",
16
16
  "url": "https://github.com/MetaMask/core.git"
17
17
  },
18
- "bin": "./dist/bin/java-tron-up.mjs",
19
18
  "files": [
20
19
  "dist/"
21
20
  ],
22
21
  "sideEffects": false,
22
+ "main": "./dist/index.cjs",
23
+ "types": "./dist/index.d.cts",
24
+ "exports": {
25
+ ".": {
26
+ "import": {
27
+ "types": "./dist/index.d.mts",
28
+ "default": "./dist/index.mjs"
29
+ },
30
+ "require": {
31
+ "types": "./dist/index.d.cts",
32
+ "default": "./dist/index.cjs"
33
+ }
34
+ },
35
+ "./package.json": "./package.json"
36
+ },
23
37
  "publishConfig": {
24
38
  "access": "public",
25
39
  "registry": "https://registry.npmjs.org/"
@@ -44,7 +58,6 @@
44
58
  "@types/jest": "^29.5.14",
45
59
  "deepmerge": "^4.2.2",
46
60
  "jest": "^29.7.0",
47
- "nock": "^13.3.1",
48
61
  "ts-jest": "^29.2.5",
49
62
  "tsx": "^4.20.5",
50
63
  "typedoc": "^0.25.13",
@@ -1,52 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- /* eslint-disable no-restricted-globals */
5
- const install_1 = require("../install.cjs");
6
- async function main() {
7
- const [command, ...args] = process.argv.slice(2);
8
- if (command === '--help' || command === 'help') {
9
- printHelp();
10
- return;
11
- }
12
- if (command === 'cache' && args[0] === 'clean') {
13
- await (0, install_1.cleanJavaTronCache)({
14
- ...(0, install_1.readJavaTronInstallOptionsFromPackageJson)(),
15
- ...(0, install_1.parseJavaTronInstallCliOptions)(args.slice(1)),
16
- });
17
- console.log('[java-tron-up] cache cleaned');
18
- return;
19
- }
20
- const installArgs = command === 'install' ? args : process.argv.slice(2);
21
- const result = await (0, install_1.installJavaTron)({
22
- ...(0, install_1.readJavaTronInstallOptionsFromPackageJson)(),
23
- ...(0, install_1.parseJavaTronInstallCliOptions)(installArgs),
24
- });
25
- console.log(`[java-tron-up] java-tron ${result.cacheHit ? 'found in cache' : 'installed'} at ${result.fullNodeJar}`);
26
- console.log(`[java-tron-up] Java runtime installed at ${result.javaBinary}`);
27
- console.log(`[java-tron-up] binary installed at ${result.binaryPath}`);
28
- }
29
- main().catch((error) => {
30
- console.error(error);
31
- process.exit(1);
32
- });
33
- function printHelp() {
34
- console.log(`Usage: java-tron-up [install] [options]
35
- java-tron-up cache clean [options]
36
-
37
- Commands:
38
- install Install java-tron and the managed Java runtime. Default command.
39
- cache clean Remove cached java-tron-up artifacts.
40
-
41
- Options:
42
- --bin-directory <path> Directory for the java-tron executable.
43
- Defaults to node_modules/.bin.
44
- --cache-directory <path> Cache directory. Defaults to .metamask/cache.
45
- --full-node-url <url> FullNode.jar URL for the current platform.
46
- --full-node-checksum <hash> Expected FullNode.jar SHA-256 checksum.
47
- --java-runtime-url <url> Java runtime archive URL for the current platform.
48
- --java-runtime-checksum <hash> Expected Java runtime SHA-256 checksum.
49
- --platform <platform> Override platform key, e.g. linux-x64.
50
- --help Show this help text.`);
51
- }
52
- //# sourceMappingURL=java-tron-up.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"java-tron-up.cjs","sourceRoot":"","sources":["../../src/bin/java-tron-up.ts"],"names":[],"mappings":";;;AACA,0CAA0C;AAC1C,4CAKoB;AAEpB,KAAK,UAAU,IAAI;IACjB,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEjD,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QAC/C,SAAS,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IAED,IAAI,OAAO,KAAK,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC;QAC/C,MAAM,IAAA,4BAAkB,EAAC;YACvB,GAAG,IAAA,mDAAyC,GAAE;YAC9C,GAAG,IAAA,wCAA8B,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACjD,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAC5C,OAAO;IACT,CAAC;IAED,MAAM,WAAW,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzE,MAAM,MAAM,GAAG,MAAM,IAAA,yBAAe,EAAC;QACnC,GAAG,IAAA,mDAAyC,GAAE;QAC9C,GAAG,IAAA,wCAA8B,EAAC,WAAW,CAAC;KAC/C,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CACT,4BACE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,WACvC,OAAO,MAAM,CAAC,WAAW,EAAE,CAC5B,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,4CAA4C,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,sCAAsC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;AACzE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,SAAS,SAAS;IAChB,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;sDAgBwC,CAAC,CAAC;AACxD,CAAC","sourcesContent":["#!/usr/bin/env node\n/* eslint-disable no-restricted-globals */\nimport {\n cleanJavaTronCache,\n installJavaTron,\n parseJavaTronInstallCliOptions,\n readJavaTronInstallOptionsFromPackageJson,\n} from '../install';\n\nasync function main(): Promise<void> {\n const [command, ...args] = process.argv.slice(2);\n\n if (command === '--help' || command === 'help') {\n printHelp();\n return;\n }\n\n if (command === 'cache' && args[0] === 'clean') {\n await cleanJavaTronCache({\n ...readJavaTronInstallOptionsFromPackageJson(),\n ...parseJavaTronInstallCliOptions(args.slice(1)),\n });\n console.log('[java-tron-up] cache cleaned');\n return;\n }\n\n const installArgs = command === 'install' ? args : process.argv.slice(2);\n const result = await installJavaTron({\n ...readJavaTronInstallOptionsFromPackageJson(),\n ...parseJavaTronInstallCliOptions(installArgs),\n });\n\n console.log(\n `[java-tron-up] java-tron ${\n result.cacheHit ? 'found in cache' : 'installed'\n } at ${result.fullNodeJar}`,\n );\n console.log(`[java-tron-up] Java runtime installed at ${result.javaBinary}`);\n console.log(`[java-tron-up] binary installed at ${result.binaryPath}`);\n}\n\nmain().catch((error) => {\n console.error(error);\n process.exit(1);\n});\n\nfunction printHelp(): void {\n console.log(`Usage: java-tron-up [install] [options]\n java-tron-up cache clean [options]\n\nCommands:\n install Install java-tron and the managed Java runtime. Default command.\n cache clean Remove cached java-tron-up artifacts.\n\nOptions:\n --bin-directory <path> Directory for the java-tron executable.\n Defaults to node_modules/.bin.\n --cache-directory <path> Cache directory. Defaults to .metamask/cache.\n --full-node-url <url> FullNode.jar URL for the current platform.\n --full-node-checksum <hash> Expected FullNode.jar SHA-256 checksum.\n --java-runtime-url <url> Java runtime archive URL for the current platform.\n --java-runtime-checksum <hash> Expected Java runtime SHA-256 checksum.\n --platform <platform> Override platform key, e.g. linux-x64.\n --help Show this help text.`);\n}\n"]}
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=java-tron-up.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"java-tron-up.d.cts","sourceRoot":"","sources":["../../src/bin/java-tron-up.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=java-tron-up.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"java-tron-up.d.mts","sourceRoot":"","sources":["../../src/bin/java-tron-up.ts"],"names":[],"mappings":""}
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env node
2
- /* eslint-disable no-restricted-globals */
3
- import { cleanJavaTronCache, installJavaTron, parseJavaTronInstallCliOptions, readJavaTronInstallOptionsFromPackageJson } from "../install.mjs";
4
- async function main() {
5
- const [command, ...args] = process.argv.slice(2);
6
- if (command === '--help' || command === 'help') {
7
- printHelp();
8
- return;
9
- }
10
- if (command === 'cache' && args[0] === 'clean') {
11
- await cleanJavaTronCache({
12
- ...readJavaTronInstallOptionsFromPackageJson(),
13
- ...parseJavaTronInstallCliOptions(args.slice(1)),
14
- });
15
- console.log('[java-tron-up] cache cleaned');
16
- return;
17
- }
18
- const installArgs = command === 'install' ? args : process.argv.slice(2);
19
- const result = await installJavaTron({
20
- ...readJavaTronInstallOptionsFromPackageJson(),
21
- ...parseJavaTronInstallCliOptions(installArgs),
22
- });
23
- console.log(`[java-tron-up] java-tron ${result.cacheHit ? 'found in cache' : 'installed'} at ${result.fullNodeJar}`);
24
- console.log(`[java-tron-up] Java runtime installed at ${result.javaBinary}`);
25
- console.log(`[java-tron-up] binary installed at ${result.binaryPath}`);
26
- }
27
- main().catch((error) => {
28
- console.error(error);
29
- process.exit(1);
30
- });
31
- function printHelp() {
32
- console.log(`Usage: java-tron-up [install] [options]
33
- java-tron-up cache clean [options]
34
-
35
- Commands:
36
- install Install java-tron and the managed Java runtime. Default command.
37
- cache clean Remove cached java-tron-up artifacts.
38
-
39
- Options:
40
- --bin-directory <path> Directory for the java-tron executable.
41
- Defaults to node_modules/.bin.
42
- --cache-directory <path> Cache directory. Defaults to .metamask/cache.
43
- --full-node-url <url> FullNode.jar URL for the current platform.
44
- --full-node-checksum <hash> Expected FullNode.jar SHA-256 checksum.
45
- --java-runtime-url <url> Java runtime archive URL for the current platform.
46
- --java-runtime-checksum <hash> Expected Java runtime SHA-256 checksum.
47
- --platform <platform> Override platform key, e.g. linux-x64.
48
- --help Show this help text.`);
49
- }
50
- //# sourceMappingURL=java-tron-up.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"java-tron-up.mjs","sourceRoot":"","sources":["../../src/bin/java-tron-up.ts"],"names":[],"mappings":";AACA,0CAA0C;AAC1C,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,8BAA8B,EAC9B,yCAAyC,EAC1C,uBAAmB;AAEpB,KAAK,UAAU,IAAI;IACjB,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEjD,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QAC/C,SAAS,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IAED,IAAI,OAAO,KAAK,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC;QAC/C,MAAM,kBAAkB,CAAC;YACvB,GAAG,yCAAyC,EAAE;YAC9C,GAAG,8BAA8B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACjD,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAC5C,OAAO;IACT,CAAC;IAED,MAAM,WAAW,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzE,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC;QACnC,GAAG,yCAAyC,EAAE;QAC9C,GAAG,8BAA8B,CAAC,WAAW,CAAC;KAC/C,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CACT,4BACE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,WACvC,OAAO,MAAM,CAAC,WAAW,EAAE,CAC5B,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,4CAA4C,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,sCAAsC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;AACzE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,SAAS,SAAS;IAChB,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;sDAgBwC,CAAC,CAAC;AACxD,CAAC","sourcesContent":["#!/usr/bin/env node\n/* eslint-disable no-restricted-globals */\nimport {\n cleanJavaTronCache,\n installJavaTron,\n parseJavaTronInstallCliOptions,\n readJavaTronInstallOptionsFromPackageJson,\n} from '../install';\n\nasync function main(): Promise<void> {\n const [command, ...args] = process.argv.slice(2);\n\n if (command === '--help' || command === 'help') {\n printHelp();\n return;\n }\n\n if (command === 'cache' && args[0] === 'clean') {\n await cleanJavaTronCache({\n ...readJavaTronInstallOptionsFromPackageJson(),\n ...parseJavaTronInstallCliOptions(args.slice(1)),\n });\n console.log('[java-tron-up] cache cleaned');\n return;\n }\n\n const installArgs = command === 'install' ? args : process.argv.slice(2);\n const result = await installJavaTron({\n ...readJavaTronInstallOptionsFromPackageJson(),\n ...parseJavaTronInstallCliOptions(installArgs),\n });\n\n console.log(\n `[java-tron-up] java-tron ${\n result.cacheHit ? 'found in cache' : 'installed'\n } at ${result.fullNodeJar}`,\n );\n console.log(`[java-tron-up] Java runtime installed at ${result.javaBinary}`);\n console.log(`[java-tron-up] binary installed at ${result.binaryPath}`);\n}\n\nmain().catch((error) => {\n console.error(error);\n process.exit(1);\n});\n\nfunction printHelp(): void {\n console.log(`Usage: java-tron-up [install] [options]\n java-tron-up cache clean [options]\n\nCommands:\n install Install java-tron and the managed Java runtime. Default command.\n cache clean Remove cached java-tron-up artifacts.\n\nOptions:\n --bin-directory <path> Directory for the java-tron executable.\n Defaults to node_modules/.bin.\n --cache-directory <path> Cache directory. Defaults to .metamask/cache.\n --full-node-url <url> FullNode.jar URL for the current platform.\n --full-node-checksum <hash> Expected FullNode.jar SHA-256 checksum.\n --java-runtime-url <url> Java runtime archive URL for the current platform.\n --java-runtime-checksum <hash> Expected Java runtime SHA-256 checksum.\n --platform <platform> Override platform key, e.g. linux-x64.\n --help Show this help text.`);\n}\n"]}