@metamask-previews/solana-test-validator-up 0.0.0-preview-b2742a2fc → 0.0.0-preview-a8fd340
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 +15 -0
- package/README.md +108 -7
- package/dist/bin/solana-test-validator-up.cjs +49 -0
- package/dist/bin/solana-test-validator-up.cjs.map +1 -0
- package/dist/bin/solana-test-validator-up.d.cts +3 -0
- package/dist/bin/solana-test-validator-up.d.cts.map +1 -0
- package/dist/bin/solana-test-validator-up.d.mts +3 -0
- package/dist/bin/solana-test-validator-up.d.mts.map +1 -0
- package/dist/bin/solana-test-validator-up.mjs +47 -0
- package/dist/bin/solana-test-validator-up.mjs.map +1 -0
- package/dist/index.cjs +8 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -7
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -7
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -9
- package/dist/index.mjs.map +1 -1
- package/dist/install.cjs +382 -0
- package/dist/install.cjs.map +1 -0
- package/dist/install.d.cts +41 -0
- package/dist/install.d.cts.map +1 -0
- package/dist/install.d.mts +41 -0
- package/dist/install.d.mts.map +1 -0
- package/dist/install.mjs +374 -0
- package/dist/install.mjs.map +1 -0
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,4 +7,19 @@ 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 ([#9210](https://github.com/MetaMask/core/pull/9210)).
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Parse `.yarnrc.yml` as YAML when resolving the cache directory so
|
|
17
|
+
`enableGlobalCache` matches `@metamask/foundryup` ([#9210](https://github.com/MetaMask/core/pull/9210)).
|
|
18
|
+
- Tolerate a missing `package.json` when reading installer options so flag-only
|
|
19
|
+
`install` and `cache clean` commands work ([#9210](https://github.com/MetaMask/core/pull/9210)).
|
|
20
|
+
- Merge partial `release` overrides from `package.json` with the pinned defaults
|
|
21
|
+
instead of replacing them ([#9210](https://github.com/MetaMask/core/pull/9210)).
|
|
22
|
+
- Propagate child termination signals as a non-zero exit from generated binary
|
|
23
|
+
wrappers ([#9210](https://github.com/MetaMask/core/pull/9210)).
|
|
24
|
+
|
|
10
25
|
[Unreleased]: https://github.com/MetaMask/core/
|
package/README.md
CHANGED
|
@@ -1,15 +1,116 @@
|
|
|
1
1
|
# `@metamask/solana-test-validator-up`
|
|
2
2
|
|
|
3
|
-
solana-test-validator
|
|
3
|
+
`solana-test-validator-up` installs a pinned Solana/Agave runtime for local
|
|
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.
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
This package does not use Docker and does not start or seed a Solana node.
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
## Usage
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
Install the package in the consuming repo:
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
```bash
|
|
17
|
+
yarn add @metamask/solana-test-validator-up
|
|
18
|
+
npm install @metamask/solana-test-validator-up
|
|
19
|
+
```
|
|
12
20
|
|
|
13
|
-
|
|
21
|
+
For Yarn v4 projects, it is usually simplest to add package scripts in the
|
|
22
|
+
consuming repo:
|
|
14
23
|
|
|
15
|
-
|
|
24
|
+
```json
|
|
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. When `.yarnrc.yml`
|
|
85
|
+
is parsed as YAML, `enableGlobalCache: true` moves the cache to
|
|
86
|
+
`~/.cache/metamask`, 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`.
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solana-test-validator-up.d.cts","sourceRoot":"","sources":["../../src/bin/solana-test-validator-up.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solana-test-validator-up.d.mts","sourceRoot":"","sources":["../../src/bin/solana-test-validator-up.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
exports.default = greeter;
|
|
3
|
+
exports.readSolanaTestValidatorInstallOptionsFromPackageJson = exports.parseSolanaTestValidatorInstallCliOptions = exports.installSolanaTestValidator = exports.getSolanaTestValidatorCacheDirectory = exports.cleanSolanaTestValidatorCache = exports.SOLANA_TEST_VALIDATOR_DEFAULT_RELEASE = void 0;
|
|
4
|
+
var install_1 = require("./install.cjs");
|
|
5
|
+
Object.defineProperty(exports, "SOLANA_TEST_VALIDATOR_DEFAULT_RELEASE", { enumerable: true, get: function () { return install_1.SOLANA_TEST_VALIDATOR_DEFAULT_RELEASE; } });
|
|
6
|
+
Object.defineProperty(exports, "cleanSolanaTestValidatorCache", { enumerable: true, get: function () { return install_1.cleanSolanaTestValidatorCache; } });
|
|
7
|
+
Object.defineProperty(exports, "getSolanaTestValidatorCacheDirectory", { enumerable: true, get: function () { return install_1.getSolanaTestValidatorCacheDirectory; } });
|
|
8
|
+
Object.defineProperty(exports, "installSolanaTestValidator", { enumerable: true, get: function () { return install_1.installSolanaTestValidator; } });
|
|
9
|
+
Object.defineProperty(exports, "parseSolanaTestValidatorInstallCliOptions", { enumerable: true, get: function () { return install_1.parseSolanaTestValidatorInstallCliOptions; } });
|
|
10
|
+
Object.defineProperty(exports, "readSolanaTestValidatorInstallOptionsFromPackageJson", { enumerable: true, get: function () { return install_1.readSolanaTestValidatorInstallOptionsFromPackageJson; } });
|
|
13
11
|
//# 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,yCAOmB;AANjB,gIAAA,qCAAqC,OAAA;AACrC,wHAAA,6BAA6B,OAAA;AAC7B,+HAAA,oCAAoC,OAAA;AACpC,qHAAA,0BAA0B,OAAA;AAC1B,oIAAA,yCAAyC,OAAA;AACzC,+IAAA,oDAAoD,OAAA","sourcesContent":["export {\n SOLANA_TEST_VALIDATOR_DEFAULT_RELEASE,\n cleanSolanaTestValidatorCache,\n getSolanaTestValidatorCacheDirectory,\n installSolanaTestValidator,\n parseSolanaTestValidatorInstallCliOptions,\n readSolanaTestValidatorInstallOptionsFromPackageJson,\n} from './install';\nexport type {\n SolanaTestValidatorArtifactConfig,\n SolanaTestValidatorArtifactPlatformConfig,\n SolanaTestValidatorInstallDependencies,\n SolanaTestValidatorInstallOptions,\n SolanaTestValidatorInstallResult,\n} from './install';\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* @param name - The name to greet.
|
|
5
|
-
* @returns The greeting.
|
|
6
|
-
*/
|
|
7
|
-
export default function greeter(name: string): string;
|
|
1
|
+
export { SOLANA_TEST_VALIDATOR_DEFAULT_RELEASE, cleanSolanaTestValidatorCache, getSolanaTestValidatorCacheDirectory, installSolanaTestValidator, parseSolanaTestValidatorInstallCliOptions, readSolanaTestValidatorInstallOptionsFromPackageJson, } from "./install.cjs";
|
|
2
|
+
export type { SolanaTestValidatorArtifactConfig, SolanaTestValidatorArtifactPlatformConfig, SolanaTestValidatorInstallDependencies, SolanaTestValidatorInstallOptions, SolanaTestValidatorInstallResult, } from "./install.cjs";
|
|
8
3
|
//# 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,OAAO,EACL,qCAAqC,EACrC,6BAA6B,EAC7B,oCAAoC,EACpC,0BAA0B,EAC1B,yCAAyC,EACzC,oDAAoD,GACrD,sBAAkB;AACnB,YAAY,EACV,iCAAiC,EACjC,yCAAyC,EACzC,sCAAsC,EACtC,iCAAiC,EACjC,gCAAgC,GACjC,sBAAkB"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* @param name - The name to greet.
|
|
5
|
-
* @returns The greeting.
|
|
6
|
-
*/
|
|
7
|
-
export default function greeter(name: string): string;
|
|
1
|
+
export { SOLANA_TEST_VALIDATOR_DEFAULT_RELEASE, cleanSolanaTestValidatorCache, getSolanaTestValidatorCacheDirectory, installSolanaTestValidator, parseSolanaTestValidatorInstallCliOptions, readSolanaTestValidatorInstallOptionsFromPackageJson, } from "./install.mjs";
|
|
2
|
+
export type { SolanaTestValidatorArtifactConfig, SolanaTestValidatorArtifactPlatformConfig, SolanaTestValidatorInstallDependencies, SolanaTestValidatorInstallOptions, SolanaTestValidatorInstallResult, } from "./install.mjs";
|
|
8
3
|
//# 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,OAAO,EACL,qCAAqC,EACrC,6BAA6B,EAC7B,oCAAoC,EACpC,0BAA0B,EAC1B,yCAAyC,EACzC,oDAAoD,GACrD,sBAAkB;AACnB,YAAY,EACV,iCAAiC,EACjC,yCAAyC,EACzC,sCAAsC,EACtC,iCAAiC,EACjC,gCAAgC,GACjC,sBAAkB"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +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) {
|
|
8
|
-
return `Hello, ${name}!`;
|
|
9
|
-
}
|
|
1
|
+
export { SOLANA_TEST_VALIDATOR_DEFAULT_RELEASE, cleanSolanaTestValidatorCache, getSolanaTestValidatorCacheDirectory, installSolanaTestValidator, parseSolanaTestValidatorInstallCliOptions, readSolanaTestValidatorInstallOptionsFromPackageJson } from "./install.mjs";
|
|
10
2
|
//# 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,OAAO,EACL,qCAAqC,EACrC,6BAA6B,EAC7B,oCAAoC,EACpC,0BAA0B,EAC1B,yCAAyC,EACzC,oDAAoD,EACrD,sBAAkB","sourcesContent":["export {\n SOLANA_TEST_VALIDATOR_DEFAULT_RELEASE,\n cleanSolanaTestValidatorCache,\n getSolanaTestValidatorCacheDirectory,\n installSolanaTestValidator,\n parseSolanaTestValidatorInstallCliOptions,\n readSolanaTestValidatorInstallOptionsFromPackageJson,\n} from './install';\nexport type {\n SolanaTestValidatorArtifactConfig,\n SolanaTestValidatorArtifactPlatformConfig,\n SolanaTestValidatorInstallDependencies,\n SolanaTestValidatorInstallOptions,\n SolanaTestValidatorInstallResult,\n} from './install';\n"]}
|