@metamask-previews/solana-test-validator-up 0.0.0-preview-9b6bf0851 → 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 +0 -4
- package/README.md +7 -108
- package/dist/index.cjs +10 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +7 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +9 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -2
- package/dist/bin/solana-test-validator-up.cjs +0 -49
- package/dist/bin/solana-test-validator-up.cjs.map +0 -1
- package/dist/bin/solana-test-validator-up.d.cts +0 -3
- package/dist/bin/solana-test-validator-up.d.cts.map +0 -1
- package/dist/bin/solana-test-validator-up.d.mts +0 -3
- package/dist/bin/solana-test-validator-up.d.mts.map +0 -1
- package/dist/bin/solana-test-validator-up.mjs +0 -47
- package/dist/bin/solana-test-validator-up.mjs.map +0 -1
- package/dist/install.cjs +0 -359
- package/dist/install.cjs.map +0 -1
- package/dist/install.d.cts +0 -41
- package/dist/install.d.cts.map +0 -1
- package/dist/install.d.mts +0 -41
- package/dist/install.d.mts.map +0 -1
- package/dist/install.mjs +0 -351
- package/dist/install.mjs.map +0 -1
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/solana-test-validator-up` package ([#8826](https://github.com/MetaMask/core/pull/8826)).
|
|
13
|
-
|
|
14
10
|
[Unreleased]: https://github.com/MetaMask/core/
|
package/README.md
CHANGED
|
@@ -1,116 +1,15 @@
|
|
|
1
1
|
# `@metamask/solana-test-validator-up`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
development and CI. It follows the same runtime-only shape as
|
|
5
|
-
`@metamask/foundryup`: this package installs external runtime artifacts into the
|
|
6
|
-
MetaMask cache and exposes binaries in `node_modules/.bin`; the consuming test
|
|
7
|
-
harness owns process startup, local-validator config, readiness checks, and
|
|
8
|
-
seeding.
|
|
3
|
+
solana-test-validator runtime installer for MetaMask E2E tests
|
|
9
4
|
|
|
10
|
-
|
|
5
|
+
## Installation
|
|
11
6
|
|
|
12
|
-
|
|
7
|
+
`yarn add @metamask/solana-test-validator-up`
|
|
13
8
|
|
|
14
|
-
|
|
9
|
+
or
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
yarn add @metamask/solana-test-validator-up
|
|
18
|
-
npm install @metamask/solana-test-validator-up
|
|
19
|
-
```
|
|
11
|
+
`npm install @metamask/solana-test-validator-up`
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
consuming repo:
|
|
13
|
+
## Contributing
|
|
23
14
|
|
|
24
|
-
|
|
25
|
-
{
|
|
26
|
-
"scripts": {
|
|
27
|
-
"solana-test-validator-up": "node_modules/.bin/solana-test-validator-up",
|
|
28
|
-
"solana-test-validator": "node_modules/.bin/solana-test-validator",
|
|
29
|
-
"solana": "node_modules/.bin/solana"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Install solana-test-validator and the Solana CLI:
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
yarn solana-test-validator-up install
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Run the installed validator wrapper:
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
node_modules/.bin/solana-test-validator --reset
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
For MetaMask Extension E2E tests, the Solana seeder should spawn
|
|
47
|
-
`node_modules/.bin/solana-test-validator`, pass its generated local-validator
|
|
48
|
-
ports and ledger directory, poll JSON-RPC directly, and perform all account
|
|
49
|
-
seeding itself.
|
|
50
|
-
|
|
51
|
-
## Installed Artifacts
|
|
52
|
-
|
|
53
|
-
`solana-test-validator-up` installs:
|
|
54
|
-
|
|
55
|
-
- a platform-specific Solana/Agave release archive
|
|
56
|
-
- a `node_modules/.bin/solana-test-validator` wrapper
|
|
57
|
-
- a `node_modules/.bin/solana` wrapper
|
|
58
|
-
|
|
59
|
-
## CLI
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
solana-test-validator-up [install] [options]
|
|
63
|
-
solana-test-validator-up cache clean [options]
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Options:
|
|
67
|
-
|
|
68
|
-
- `--bin-directory <path>`: directory for generated wrappers. Defaults to
|
|
69
|
-
`node_modules/.bin`.
|
|
70
|
-
- `--cache-directory <path>`: artifact cache directory. Defaults to
|
|
71
|
-
`.metamask/cache`.
|
|
72
|
-
- `--release-url <url>` and `--release-checksum <hash>`: override the Solana
|
|
73
|
-
release archive for the current platform.
|
|
74
|
-
- `--platform <platform>`: override platform selection, for example
|
|
75
|
-
`linux-x64`.
|
|
76
|
-
|
|
77
|
-
## Default Release
|
|
78
|
-
|
|
79
|
-
The package currently pins Agave `v3.1.14` for `darwin-arm64`, `darwin-x64`,
|
|
80
|
-
and `linux-x64`.
|
|
81
|
-
|
|
82
|
-
## Cache
|
|
83
|
-
|
|
84
|
-
The cache defaults to `.metamask/cache` in the current repo. If `.yarnrc.yml`
|
|
85
|
-
contains `enableGlobalCache: true`, the cache moves to `~/.cache/metamask`,
|
|
86
|
-
matching the `@metamask/foundryup` behavior.
|
|
87
|
-
|
|
88
|
-
Clean only this package's cache namespace:
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
yarn solana-test-validator-up cache clean
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
## Package Config
|
|
95
|
-
|
|
96
|
-
The consuming repo can override the pinned artifact URLs and checksums in its
|
|
97
|
-
root `package.json`:
|
|
98
|
-
|
|
99
|
-
```json
|
|
100
|
-
{
|
|
101
|
-
"solanaTestValidatorUp": {
|
|
102
|
-
"release": {
|
|
103
|
-
"version": "v3.1.14",
|
|
104
|
-
"platforms": {
|
|
105
|
-
"linux-x64": {
|
|
106
|
-
"url": "https://github.com/anza-xyz/agave/releases/download/v3.1.14/solana-release-x86_64-unknown-linux-gnu.tar.bz2",
|
|
107
|
-
"checksum": "06f97c065cc977cbec2f13ffc9bc9d3b92fef485431fcb370a269de69532ef51"
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
Supported package config keys are `solanaTestValidatorUp`,
|
|
116
|
-
`solanatestvalidatorup`, and `solana-test-validator-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
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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;
|
|
11
13
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
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"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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;
|
|
3
8
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
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"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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;
|
|
3
8
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
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
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
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
|
+
}
|
|
2
10
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
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/solana-test-validator-up",
|
|
3
|
-
"version": "0.0.0-preview-
|
|
3
|
+
"version": "0.0.0-preview-2a256aff2",
|
|
4
4
|
"description": "solana-test-validator runtime installer for MetaMask E2E tests",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ethereum",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"type": "git",
|
|
16
16
|
"url": "https://github.com/MetaMask/core.git"
|
|
17
17
|
},
|
|
18
|
-
"bin": "./dist/bin/solana-test-validator-up.mjs",
|
|
19
18
|
"files": [
|
|
20
19
|
"dist/"
|
|
21
20
|
],
|
|
@@ -1,49 +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.cleanSolanaTestValidatorCache)({
|
|
14
|
-
...(0, install_1.readSolanaTestValidatorInstallOptionsFromPackageJson)(),
|
|
15
|
-
...(0, install_1.parseSolanaTestValidatorInstallCliOptions)(args.slice(1)),
|
|
16
|
-
});
|
|
17
|
-
console.log('[solana-test-validator-up] cache cleaned');
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const installArgs = command === 'install' ? args : process.argv.slice(2);
|
|
21
|
-
const result = await (0, install_1.installSolanaTestValidator)({
|
|
22
|
-
...(0, install_1.readSolanaTestValidatorInstallOptionsFromPackageJson)(),
|
|
23
|
-
...(0, install_1.parseSolanaTestValidatorInstallCliOptions)(installArgs),
|
|
24
|
-
});
|
|
25
|
-
console.log(`[solana-test-validator-up] Solana release ${result.cacheHit ? 'found in cache' : 'installed'}`);
|
|
26
|
-
console.log(`[solana-test-validator-up] solana-test-validator installed at ${result.binaryPath}`);
|
|
27
|
-
}
|
|
28
|
-
main().catch((error) => {
|
|
29
|
-
console.error(error);
|
|
30
|
-
process.exit(1);
|
|
31
|
-
});
|
|
32
|
-
function printHelp() {
|
|
33
|
-
console.log(`Usage: solana-test-validator-up [install] [options]
|
|
34
|
-
solana-test-validator-up cache clean [options]
|
|
35
|
-
|
|
36
|
-
Commands:
|
|
37
|
-
install Install solana-test-validator and solana CLI. Default command.
|
|
38
|
-
cache clean Remove cached solana-test-validator-up artifacts.
|
|
39
|
-
|
|
40
|
-
Options:
|
|
41
|
-
--bin-directory <path> Directory for executable wrappers.
|
|
42
|
-
Defaults to node_modules/.bin.
|
|
43
|
-
--cache-directory <path> Cache directory. Defaults to .metamask/cache.
|
|
44
|
-
--release-url <url> Solana release archive URL for the current platform.
|
|
45
|
-
--release-checksum <hash> Expected Solana release SHA-256 checksum.
|
|
46
|
-
--platform <platform> Override platform key, e.g. linux-x64.
|
|
47
|
-
--help Show this help text.`);
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=solana-test-validator-up.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"solana-test-validator-up.cjs","sourceRoot":"","sources":["../../src/bin/solana-test-validator-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,uCAA6B,EAAC;YAClC,GAAG,IAAA,8DAAoD,GAAE;YACzD,GAAG,IAAA,mDAAyC,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC5D,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;QACxD,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,oCAA0B,EAAC;QAC9C,GAAG,IAAA,8DAAoD,GAAE;QACzD,GAAG,IAAA,mDAAyC,EAAC,WAAW,CAAC;KAC1D,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CACT,6CACE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,WACvC,EAAE,CACH,CAAC;IACF,OAAO,CAAC,GAAG,CACT,iEAAiE,MAAM,CAAC,UAAU,EAAE,CACrF,CAAC;AACJ,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;;;;;;;;;;;;;;mDAcqC,CAAC,CAAC;AACrD,CAAC","sourcesContent":["#!/usr/bin/env node\n/* eslint-disable no-restricted-globals */\nimport {\n cleanSolanaTestValidatorCache,\n installSolanaTestValidator,\n parseSolanaTestValidatorInstallCliOptions,\n readSolanaTestValidatorInstallOptionsFromPackageJson,\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 cleanSolanaTestValidatorCache({\n ...readSolanaTestValidatorInstallOptionsFromPackageJson(),\n ...parseSolanaTestValidatorInstallCliOptions(args.slice(1)),\n });\n console.log('[solana-test-validator-up] cache cleaned');\n return;\n }\n\n const installArgs = command === 'install' ? args : process.argv.slice(2);\n const result = await installSolanaTestValidator({\n ...readSolanaTestValidatorInstallOptionsFromPackageJson(),\n ...parseSolanaTestValidatorInstallCliOptions(installArgs),\n });\n\n console.log(\n `[solana-test-validator-up] Solana release ${\n result.cacheHit ? 'found in cache' : 'installed'\n }`,\n );\n console.log(\n `[solana-test-validator-up] solana-test-validator installed at ${result.binaryPath}`,\n );\n}\n\nmain().catch((error) => {\n console.error(error);\n process.exit(1);\n});\n\nfunction printHelp(): void {\n console.log(`Usage: solana-test-validator-up [install] [options]\n solana-test-validator-up cache clean [options]\n\nCommands:\n install Install solana-test-validator and solana CLI. Default command.\n cache clean Remove cached solana-test-validator-up artifacts.\n\nOptions:\n --bin-directory <path> Directory for executable wrappers.\n Defaults to node_modules/.bin.\n --cache-directory <path> Cache directory. Defaults to .metamask/cache.\n --release-url <url> Solana release archive URL for the current platform.\n --release-checksum <hash> Expected Solana release SHA-256 checksum.\n --platform <platform> Override platform key, e.g. linux-x64.\n --help Show this help text.`);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"solana-test-validator-up.d.cts","sourceRoot":"","sources":["../../src/bin/solana-test-validator-up.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"solana-test-validator-up.d.mts","sourceRoot":"","sources":["../../src/bin/solana-test-validator-up.ts"],"names":[],"mappings":""}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/* eslint-disable no-restricted-globals */
|
|
3
|
-
import { cleanSolanaTestValidatorCache, installSolanaTestValidator, parseSolanaTestValidatorInstallCliOptions, readSolanaTestValidatorInstallOptionsFromPackageJson } 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 cleanSolanaTestValidatorCache({
|
|
12
|
-
...readSolanaTestValidatorInstallOptionsFromPackageJson(),
|
|
13
|
-
...parseSolanaTestValidatorInstallCliOptions(args.slice(1)),
|
|
14
|
-
});
|
|
15
|
-
console.log('[solana-test-validator-up] cache cleaned');
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const installArgs = command === 'install' ? args : process.argv.slice(2);
|
|
19
|
-
const result = await installSolanaTestValidator({
|
|
20
|
-
...readSolanaTestValidatorInstallOptionsFromPackageJson(),
|
|
21
|
-
...parseSolanaTestValidatorInstallCliOptions(installArgs),
|
|
22
|
-
});
|
|
23
|
-
console.log(`[solana-test-validator-up] Solana release ${result.cacheHit ? 'found in cache' : 'installed'}`);
|
|
24
|
-
console.log(`[solana-test-validator-up] solana-test-validator installed at ${result.binaryPath}`);
|
|
25
|
-
}
|
|
26
|
-
main().catch((error) => {
|
|
27
|
-
console.error(error);
|
|
28
|
-
process.exit(1);
|
|
29
|
-
});
|
|
30
|
-
function printHelp() {
|
|
31
|
-
console.log(`Usage: solana-test-validator-up [install] [options]
|
|
32
|
-
solana-test-validator-up cache clean [options]
|
|
33
|
-
|
|
34
|
-
Commands:
|
|
35
|
-
install Install solana-test-validator and solana CLI. Default command.
|
|
36
|
-
cache clean Remove cached solana-test-validator-up artifacts.
|
|
37
|
-
|
|
38
|
-
Options:
|
|
39
|
-
--bin-directory <path> Directory for executable wrappers.
|
|
40
|
-
Defaults to node_modules/.bin.
|
|
41
|
-
--cache-directory <path> Cache directory. Defaults to .metamask/cache.
|
|
42
|
-
--release-url <url> Solana release archive URL for the current platform.
|
|
43
|
-
--release-checksum <hash> Expected Solana release SHA-256 checksum.
|
|
44
|
-
--platform <platform> Override platform key, e.g. linux-x64.
|
|
45
|
-
--help Show this help text.`);
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=solana-test-validator-up.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"solana-test-validator-up.mjs","sourceRoot":"","sources":["../../src/bin/solana-test-validator-up.ts"],"names":[],"mappings":";AACA,0CAA0C;AAC1C,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,yCAAyC,EACzC,oDAAoD,EACrD,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,6BAA6B,CAAC;YAClC,GAAG,oDAAoD,EAAE;YACzD,GAAG,yCAAyC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC5D,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;QACxD,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,0BAA0B,CAAC;QAC9C,GAAG,oDAAoD,EAAE;QACzD,GAAG,yCAAyC,CAAC,WAAW,CAAC;KAC1D,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CACT,6CACE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,WACvC,EAAE,CACH,CAAC;IACF,OAAO,CAAC,GAAG,CACT,iEAAiE,MAAM,CAAC,UAAU,EAAE,CACrF,CAAC;AACJ,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;;;;;;;;;;;;;;mDAcqC,CAAC,CAAC;AACrD,CAAC","sourcesContent":["#!/usr/bin/env node\n/* eslint-disable no-restricted-globals */\nimport {\n cleanSolanaTestValidatorCache,\n installSolanaTestValidator,\n parseSolanaTestValidatorInstallCliOptions,\n readSolanaTestValidatorInstallOptionsFromPackageJson,\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 cleanSolanaTestValidatorCache({\n ...readSolanaTestValidatorInstallOptionsFromPackageJson(),\n ...parseSolanaTestValidatorInstallCliOptions(args.slice(1)),\n });\n console.log('[solana-test-validator-up] cache cleaned');\n return;\n }\n\n const installArgs = command === 'install' ? args : process.argv.slice(2);\n const result = await installSolanaTestValidator({\n ...readSolanaTestValidatorInstallOptionsFromPackageJson(),\n ...parseSolanaTestValidatorInstallCliOptions(installArgs),\n });\n\n console.log(\n `[solana-test-validator-up] Solana release ${\n result.cacheHit ? 'found in cache' : 'installed'\n }`,\n );\n console.log(\n `[solana-test-validator-up] solana-test-validator installed at ${result.binaryPath}`,\n );\n}\n\nmain().catch((error) => {\n console.error(error);\n process.exit(1);\n});\n\nfunction printHelp(): void {\n console.log(`Usage: solana-test-validator-up [install] [options]\n solana-test-validator-up cache clean [options]\n\nCommands:\n install Install solana-test-validator and solana CLI. Default command.\n cache clean Remove cached solana-test-validator-up artifacts.\n\nOptions:\n --bin-directory <path> Directory for executable wrappers.\n Defaults to node_modules/.bin.\n --cache-directory <path> Cache directory. Defaults to .metamask/cache.\n --release-url <url> Solana release archive URL for the current platform.\n --release-checksum <hash> Expected Solana release SHA-256 checksum.\n --platform <platform> Override platform key, e.g. linux-x64.\n --help Show this help text.`);\n}\n"]}
|