@metamask-previews/bitcoin-regtest-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 +11 -0
- package/README.md +108 -7
- package/dist/bin/bitcoin-regtest-up.cjs +50 -0
- package/dist/bin/bitcoin-regtest-up.cjs.map +1 -0
- package/dist/bin/bitcoin-regtest-up.d.cts +3 -0
- package/dist/bin/bitcoin-regtest-up.d.cts.map +1 -0
- package/dist/bin/bitcoin-regtest-up.d.mts +3 -0
- package/dist/bin/bitcoin-regtest-up.d.mts.map +1 -0
- package/dist/bin/bitcoin-regtest-up.mjs +48 -0
- package/dist/bin/bitcoin-regtest-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 +421 -0
- package/dist/install.cjs.map +1 -0
- package/dist/install.d.cts +43 -0
- package/dist/install.d.cts.map +1 -0
- package/dist/install.d.mts +43 -0
- package/dist/install.d.mts.map +1 -0
- package/dist/install.mjs +413 -0
- package/dist/install.mjs.map +1 -0
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,4 +7,15 @@ 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/bitcoin-regtest-up` package ([#9212](https://github.com/MetaMask/core/pull/9212)).
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Parse `.yarnrc.yml` as YAML for global-cache detection, matching `@metamask/foundryup` ([#9212](https://github.com/MetaMask/core/pull/9212)).
|
|
17
|
+
- Tolerate a missing `package.json` so flag-only `install` and `cache clean` commands work ([#9212](https://github.com/MetaMask/core/pull/9212)).
|
|
18
|
+
- Merge partial `bitcoinCore` overrides from `package.json` with the pinned defaults instead of replacing them ([#9212](https://github.com/MetaMask/core/pull/9212)).
|
|
19
|
+
- Propagate child termination signals as a non-zero exit from the generated `bitcoind` and `bitcoin-cli` wrappers ([#9212](https://github.com/MetaMask/core/pull/9212)).
|
|
20
|
+
|
|
10
21
|
[Unreleased]: https://github.com/MetaMask/core/
|
package/README.md
CHANGED
|
@@ -1,15 +1,116 @@
|
|
|
1
1
|
# `@metamask/bitcoin-regtest-up`
|
|
2
2
|
|
|
3
|
-
Bitcoin Core
|
|
3
|
+
`bitcoin-regtest-up` installs a pinned Bitcoin Core 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, regtest config, readiness checks, and seeding.
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
This package does not use Docker and does not start or seed a Bitcoin node.
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
## Usage
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
Install the package in the consuming repo:
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
```bash
|
|
16
|
+
yarn add @metamask/bitcoin-regtest-up
|
|
17
|
+
npm install @metamask/bitcoin-regtest-up
|
|
18
|
+
```
|
|
12
19
|
|
|
13
|
-
|
|
20
|
+
For Yarn v4 projects, it is usually simplest to add package scripts in the
|
|
21
|
+
consuming repo:
|
|
14
22
|
|
|
15
|
-
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"scripts": {
|
|
26
|
+
"bitcoin-regtest-up": "node_modules/.bin/bitcoin-regtest-up",
|
|
27
|
+
"bitcoind": "node_modules/.bin/bitcoind",
|
|
28
|
+
"bitcoin-cli": "node_modules/.bin/bitcoin-cli"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Install bitcoind and bitcoin-cli:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
yarn bitcoin-regtest-up install
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Run the installed Bitcoin Core wrappers:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
node_modules/.bin/bitcoind -regtest
|
|
43
|
+
node_modules/.bin/bitcoin-cli -regtest getblockchaininfo
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
For MetaMask Extension E2E tests, the Bitcoin seeder should spawn
|
|
47
|
+
`node_modules/.bin/bitcoind`, pass its generated regtest datadir and ports, use
|
|
48
|
+
`node_modules/.bin/bitcoin-cli` for node setup, poll JSON-RPC directly, and
|
|
49
|
+
perform all wallet/funding seeding itself.
|
|
50
|
+
|
|
51
|
+
## Installed Artifacts
|
|
52
|
+
|
|
53
|
+
`bitcoin-regtest-up` installs:
|
|
54
|
+
|
|
55
|
+
- a platform-specific Bitcoin Core release archive
|
|
56
|
+
- a `node_modules/.bin/bitcoind` wrapper
|
|
57
|
+
- a `node_modules/.bin/bitcoin-cli` wrapper
|
|
58
|
+
|
|
59
|
+
## CLI
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
bitcoin-regtest-up [install] [options]
|
|
63
|
+
bitcoin-regtest-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
|
+
- `--bitcoin-core-url <url>` and `--bitcoin-core-checksum <hash>`: override the
|
|
73
|
+
Bitcoin Core 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 Bitcoin Core `30.2` for `darwin-arm64`,
|
|
80
|
+
`darwin-x64`, `linux-arm64`, and `linux-x64`.
|
|
81
|
+
|
|
82
|
+
## Cache
|
|
83
|
+
|
|
84
|
+
The cache defaults to `.metamask/cache` in the current repo. `enableGlobalCache`
|
|
85
|
+
is read by parsing `.yarnrc.yml` as YAML; when it is `true`, the cache moves to
|
|
86
|
+
`~/.cache/metamask`, matching the `@metamask/foundryup` behavior.
|
|
87
|
+
|
|
88
|
+
Clean only this package's cache namespace:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
yarn bitcoin-regtest-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
|
+
"bitcoinRegtestUp": {
|
|
102
|
+
"bitcoinCore": {
|
|
103
|
+
"version": "30.2",
|
|
104
|
+
"platforms": {
|
|
105
|
+
"linux-x64": {
|
|
106
|
+
"url": "https://bitcoincore.org/bin/bitcoin-core-30.2/bitcoin-30.2-x86_64-linux-gnu.tar.gz",
|
|
107
|
+
"checksum": "6aa7bb4feb699c4c6262dd23e4004191f6df7f373b5d5978b5bcdd4bb72f75d8"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Supported package config keys are `bitcoinRegtestUp`, `bitcoinregtestup`, and
|
|
116
|
+
`bitcoin-regtest-up`.
|
|
@@ -0,0 +1,50 @@
|
|
|
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.cleanBitcoinRegtestCache)({
|
|
14
|
+
...(0, install_1.readBitcoinRegtestInstallOptionsFromPackageJson)(),
|
|
15
|
+
...(0, install_1.parseBitcoinRegtestInstallCliOptions)(args.slice(1)),
|
|
16
|
+
});
|
|
17
|
+
console.log('[bitcoin-regtest-up] cache cleaned');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const installArgs = command === 'install' ? args : process.argv.slice(2);
|
|
21
|
+
const result = await (0, install_1.installBitcoinRegtest)({
|
|
22
|
+
...(0, install_1.readBitcoinRegtestInstallOptionsFromPackageJson)(),
|
|
23
|
+
...(0, install_1.parseBitcoinRegtestInstallCliOptions)(installArgs),
|
|
24
|
+
});
|
|
25
|
+
console.log(`[bitcoin-regtest-up] Bitcoin Core ${result.cacheHit ? 'found in cache' : 'installed'}`);
|
|
26
|
+
console.log(`[bitcoin-regtest-up] bitcoind installed at ${result.bitcoindBinary}`);
|
|
27
|
+
console.log(`[bitcoin-regtest-up] bitcoin-cli installed at ${result.bitcoinCliBinary}`);
|
|
28
|
+
}
|
|
29
|
+
main().catch((error) => {
|
|
30
|
+
console.error(error);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
});
|
|
33
|
+
function printHelp() {
|
|
34
|
+
console.log(`Usage: bitcoin-regtest-up [install] [options]
|
|
35
|
+
bitcoin-regtest-up cache clean [options]
|
|
36
|
+
|
|
37
|
+
Commands:
|
|
38
|
+
install Install Bitcoin Core bitcoind and bitcoin-cli. Default command.
|
|
39
|
+
cache clean Remove cached bitcoin-regtest-up artifacts.
|
|
40
|
+
|
|
41
|
+
Options:
|
|
42
|
+
--bin-directory <path> Directory for executable wrappers.
|
|
43
|
+
Defaults to node_modules/.bin.
|
|
44
|
+
--cache-directory <path> Cache directory. Defaults to .metamask/cache.
|
|
45
|
+
--bitcoin-core-url <url> Bitcoin Core archive URL for the current platform.
|
|
46
|
+
--bitcoin-core-checksum <hash> Expected Bitcoin Core SHA-256 checksum.
|
|
47
|
+
--platform <platform> Override platform key, e.g. linux-x64.
|
|
48
|
+
--help Show this help text.`);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=bitcoin-regtest-up.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitcoin-regtest-up.cjs","sourceRoot":"","sources":["../../src/bin/bitcoin-regtest-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,kCAAwB,EAAC;YAC7B,GAAG,IAAA,yDAA+C,GAAE;YACpD,GAAG,IAAA,8CAAoC,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACvD,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;QAClD,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,+BAAqB,EAAC;QACzC,GAAG,IAAA,yDAA+C,GAAE;QACpD,GAAG,IAAA,8CAAoC,EAAC,WAAW,CAAC;KACrD,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CACT,qCACE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,WACvC,EAAE,CACH,CAAC;IACF,OAAO,CAAC,GAAG,CACT,8CAA8C,MAAM,CAAC,cAAc,EAAE,CACtE,CAAC;IACF,OAAO,CAAC,GAAG,CACT,iDAAiD,MAAM,CAAC,gBAAgB,EAAE,CAC3E,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;;;;;;;;;;;;;;uDAcyC,CAAC,CAAC;AACzD,CAAC","sourcesContent":["#!/usr/bin/env node\n/* eslint-disable no-restricted-globals */\nimport {\n cleanBitcoinRegtestCache,\n installBitcoinRegtest,\n parseBitcoinRegtestInstallCliOptions,\n readBitcoinRegtestInstallOptionsFromPackageJson,\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 cleanBitcoinRegtestCache({\n ...readBitcoinRegtestInstallOptionsFromPackageJson(),\n ...parseBitcoinRegtestInstallCliOptions(args.slice(1)),\n });\n console.log('[bitcoin-regtest-up] cache cleaned');\n return;\n }\n\n const installArgs = command === 'install' ? args : process.argv.slice(2);\n const result = await installBitcoinRegtest({\n ...readBitcoinRegtestInstallOptionsFromPackageJson(),\n ...parseBitcoinRegtestInstallCliOptions(installArgs),\n });\n\n console.log(\n `[bitcoin-regtest-up] Bitcoin Core ${\n result.cacheHit ? 'found in cache' : 'installed'\n }`,\n );\n console.log(\n `[bitcoin-regtest-up] bitcoind installed at ${result.bitcoindBinary}`,\n );\n console.log(\n `[bitcoin-regtest-up] bitcoin-cli installed at ${result.bitcoinCliBinary}`,\n );\n}\n\nmain().catch((error) => {\n console.error(error);\n process.exit(1);\n});\n\nfunction printHelp(): void {\n console.log(`Usage: bitcoin-regtest-up [install] [options]\n bitcoin-regtest-up cache clean [options]\n\nCommands:\n install Install Bitcoin Core bitcoind and bitcoin-cli. Default command.\n cache clean Remove cached bitcoin-regtest-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 --bitcoin-core-url <url> Bitcoin Core archive URL for the current platform.\n --bitcoin-core-checksum <hash> Expected Bitcoin Core 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":"bitcoin-regtest-up.d.cts","sourceRoot":"","sources":["../../src/bin/bitcoin-regtest-up.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitcoin-regtest-up.d.mts","sourceRoot":"","sources":["../../src/bin/bitcoin-regtest-up.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable no-restricted-globals */
|
|
3
|
+
import { cleanBitcoinRegtestCache, installBitcoinRegtest, parseBitcoinRegtestInstallCliOptions, readBitcoinRegtestInstallOptionsFromPackageJson } 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 cleanBitcoinRegtestCache({
|
|
12
|
+
...readBitcoinRegtestInstallOptionsFromPackageJson(),
|
|
13
|
+
...parseBitcoinRegtestInstallCliOptions(args.slice(1)),
|
|
14
|
+
});
|
|
15
|
+
console.log('[bitcoin-regtest-up] cache cleaned');
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const installArgs = command === 'install' ? args : process.argv.slice(2);
|
|
19
|
+
const result = await installBitcoinRegtest({
|
|
20
|
+
...readBitcoinRegtestInstallOptionsFromPackageJson(),
|
|
21
|
+
...parseBitcoinRegtestInstallCliOptions(installArgs),
|
|
22
|
+
});
|
|
23
|
+
console.log(`[bitcoin-regtest-up] Bitcoin Core ${result.cacheHit ? 'found in cache' : 'installed'}`);
|
|
24
|
+
console.log(`[bitcoin-regtest-up] bitcoind installed at ${result.bitcoindBinary}`);
|
|
25
|
+
console.log(`[bitcoin-regtest-up] bitcoin-cli installed at ${result.bitcoinCliBinary}`);
|
|
26
|
+
}
|
|
27
|
+
main().catch((error) => {
|
|
28
|
+
console.error(error);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
});
|
|
31
|
+
function printHelp() {
|
|
32
|
+
console.log(`Usage: bitcoin-regtest-up [install] [options]
|
|
33
|
+
bitcoin-regtest-up cache clean [options]
|
|
34
|
+
|
|
35
|
+
Commands:
|
|
36
|
+
install Install Bitcoin Core bitcoind and bitcoin-cli. Default command.
|
|
37
|
+
cache clean Remove cached bitcoin-regtest-up artifacts.
|
|
38
|
+
|
|
39
|
+
Options:
|
|
40
|
+
--bin-directory <path> Directory for executable wrappers.
|
|
41
|
+
Defaults to node_modules/.bin.
|
|
42
|
+
--cache-directory <path> Cache directory. Defaults to .metamask/cache.
|
|
43
|
+
--bitcoin-core-url <url> Bitcoin Core archive URL for the current platform.
|
|
44
|
+
--bitcoin-core-checksum <hash> Expected Bitcoin Core SHA-256 checksum.
|
|
45
|
+
--platform <platform> Override platform key, e.g. linux-x64.
|
|
46
|
+
--help Show this help text.`);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=bitcoin-regtest-up.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitcoin-regtest-up.mjs","sourceRoot":"","sources":["../../src/bin/bitcoin-regtest-up.ts"],"names":[],"mappings":";AACA,0CAA0C;AAC1C,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,oCAAoC,EACpC,+CAA+C,EAChD,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,wBAAwB,CAAC;YAC7B,GAAG,+CAA+C,EAAE;YACpD,GAAG,oCAAoC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACvD,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;QAClD,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,qBAAqB,CAAC;QACzC,GAAG,+CAA+C,EAAE;QACpD,GAAG,oCAAoC,CAAC,WAAW,CAAC;KACrD,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CACT,qCACE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,WACvC,EAAE,CACH,CAAC;IACF,OAAO,CAAC,GAAG,CACT,8CAA8C,MAAM,CAAC,cAAc,EAAE,CACtE,CAAC;IACF,OAAO,CAAC,GAAG,CACT,iDAAiD,MAAM,CAAC,gBAAgB,EAAE,CAC3E,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;;;;;;;;;;;;;;uDAcyC,CAAC,CAAC;AACzD,CAAC","sourcesContent":["#!/usr/bin/env node\n/* eslint-disable no-restricted-globals */\nimport {\n cleanBitcoinRegtestCache,\n installBitcoinRegtest,\n parseBitcoinRegtestInstallCliOptions,\n readBitcoinRegtestInstallOptionsFromPackageJson,\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 cleanBitcoinRegtestCache({\n ...readBitcoinRegtestInstallOptionsFromPackageJson(),\n ...parseBitcoinRegtestInstallCliOptions(args.slice(1)),\n });\n console.log('[bitcoin-regtest-up] cache cleaned');\n return;\n }\n\n const installArgs = command === 'install' ? args : process.argv.slice(2);\n const result = await installBitcoinRegtest({\n ...readBitcoinRegtestInstallOptionsFromPackageJson(),\n ...parseBitcoinRegtestInstallCliOptions(installArgs),\n });\n\n console.log(\n `[bitcoin-regtest-up] Bitcoin Core ${\n result.cacheHit ? 'found in cache' : 'installed'\n }`,\n );\n console.log(\n `[bitcoin-regtest-up] bitcoind installed at ${result.bitcoindBinary}`,\n );\n console.log(\n `[bitcoin-regtest-up] bitcoin-cli installed at ${result.bitcoinCliBinary}`,\n );\n}\n\nmain().catch((error) => {\n console.error(error);\n process.exit(1);\n});\n\nfunction printHelp(): void {\n console.log(`Usage: bitcoin-regtest-up [install] [options]\n bitcoin-regtest-up cache clean [options]\n\nCommands:\n install Install Bitcoin Core bitcoind and bitcoin-cli. Default command.\n cache clean Remove cached bitcoin-regtest-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 --bitcoin-core-url <url> Bitcoin Core archive URL for the current platform.\n --bitcoin-core-checksum <hash> Expected Bitcoin Core 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.readBitcoinRegtestInstallOptionsFromPackageJson = exports.parseBitcoinRegtestInstallCliOptions = exports.installBitcoinRegtest = exports.getBitcoinRegtestCacheDirectory = exports.cleanBitcoinRegtestCache = exports.BITCOIN_REGTEST_DEFAULT_CORE = void 0;
|
|
4
|
+
var install_1 = require("./install.cjs");
|
|
5
|
+
Object.defineProperty(exports, "BITCOIN_REGTEST_DEFAULT_CORE", { enumerable: true, get: function () { return install_1.BITCOIN_REGTEST_DEFAULT_CORE; } });
|
|
6
|
+
Object.defineProperty(exports, "cleanBitcoinRegtestCache", { enumerable: true, get: function () { return install_1.cleanBitcoinRegtestCache; } });
|
|
7
|
+
Object.defineProperty(exports, "getBitcoinRegtestCacheDirectory", { enumerable: true, get: function () { return install_1.getBitcoinRegtestCacheDirectory; } });
|
|
8
|
+
Object.defineProperty(exports, "installBitcoinRegtest", { enumerable: true, get: function () { return install_1.installBitcoinRegtest; } });
|
|
9
|
+
Object.defineProperty(exports, "parseBitcoinRegtestInstallCliOptions", { enumerable: true, get: function () { return install_1.parseBitcoinRegtestInstallCliOptions; } });
|
|
10
|
+
Object.defineProperty(exports, "readBitcoinRegtestInstallOptionsFromPackageJson", { enumerable: true, get: function () { return install_1.readBitcoinRegtestInstallOptionsFromPackageJson; } });
|
|
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,uHAAA,4BAA4B,OAAA;AAC5B,mHAAA,wBAAwB,OAAA;AACxB,0HAAA,+BAA+B,OAAA;AAC/B,gHAAA,qBAAqB,OAAA;AACrB,+HAAA,oCAAoC,OAAA;AACpC,0IAAA,+CAA+C,OAAA","sourcesContent":["export {\n BITCOIN_REGTEST_DEFAULT_CORE,\n cleanBitcoinRegtestCache,\n getBitcoinRegtestCacheDirectory,\n installBitcoinRegtest,\n parseBitcoinRegtestInstallCliOptions,\n readBitcoinRegtestInstallOptionsFromPackageJson,\n} from './install';\nexport type {\n BitcoinRegtestArtifactConfig,\n BitcoinRegtestArtifactPlatformConfig,\n BitcoinRegtestInstallDependencies,\n BitcoinRegtestInstallOptions,\n BitcoinRegtestInstallResult,\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 { BITCOIN_REGTEST_DEFAULT_CORE, cleanBitcoinRegtestCache, getBitcoinRegtestCacheDirectory, installBitcoinRegtest, parseBitcoinRegtestInstallCliOptions, readBitcoinRegtestInstallOptionsFromPackageJson, } from "./install.cjs";
|
|
2
|
+
export type { BitcoinRegtestArtifactConfig, BitcoinRegtestArtifactPlatformConfig, BitcoinRegtestInstallDependencies, BitcoinRegtestInstallOptions, BitcoinRegtestInstallResult, } 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,4BAA4B,EAC5B,wBAAwB,EACxB,+BAA+B,EAC/B,qBAAqB,EACrB,oCAAoC,EACpC,+CAA+C,GAChD,sBAAkB;AACnB,YAAY,EACV,4BAA4B,EAC5B,oCAAoC,EACpC,iCAAiC,EACjC,4BAA4B,EAC5B,2BAA2B,GAC5B,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 { BITCOIN_REGTEST_DEFAULT_CORE, cleanBitcoinRegtestCache, getBitcoinRegtestCacheDirectory, installBitcoinRegtest, parseBitcoinRegtestInstallCliOptions, readBitcoinRegtestInstallOptionsFromPackageJson, } from "./install.mjs";
|
|
2
|
+
export type { BitcoinRegtestArtifactConfig, BitcoinRegtestArtifactPlatformConfig, BitcoinRegtestInstallDependencies, BitcoinRegtestInstallOptions, BitcoinRegtestInstallResult, } 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,4BAA4B,EAC5B,wBAAwB,EACxB,+BAA+B,EAC/B,qBAAqB,EACrB,oCAAoC,EACpC,+CAA+C,GAChD,sBAAkB;AACnB,YAAY,EACV,4BAA4B,EAC5B,oCAAoC,EACpC,iCAAiC,EACjC,4BAA4B,EAC5B,2BAA2B,GAC5B,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 { BITCOIN_REGTEST_DEFAULT_CORE, cleanBitcoinRegtestCache, getBitcoinRegtestCacheDirectory, installBitcoinRegtest, parseBitcoinRegtestInstallCliOptions, readBitcoinRegtestInstallOptionsFromPackageJson } 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,4BAA4B,EAC5B,wBAAwB,EACxB,+BAA+B,EAC/B,qBAAqB,EACrB,oCAAoC,EACpC,+CAA+C,EAChD,sBAAkB","sourcesContent":["export {\n BITCOIN_REGTEST_DEFAULT_CORE,\n cleanBitcoinRegtestCache,\n getBitcoinRegtestCacheDirectory,\n installBitcoinRegtest,\n parseBitcoinRegtestInstallCliOptions,\n readBitcoinRegtestInstallOptionsFromPackageJson,\n} from './install';\nexport type {\n BitcoinRegtestArtifactConfig,\n BitcoinRegtestArtifactPlatformConfig,\n BitcoinRegtestInstallDependencies,\n BitcoinRegtestInstallOptions,\n BitcoinRegtestInstallResult,\n} from './install';\n"]}
|