@metamask-previews/bitcoin-regtest-up 0.0.0-preview-82e080825 → 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/bitcoin-regtest-up` package ([#8827](https://github.com/MetaMask/core/pull/8827)).
13
-
14
10
  [Unreleased]: https://github.com/MetaMask/core/
package/LICENSE.APACHE2 CHANGED
@@ -186,7 +186,7 @@
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
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -1,116 +1,15 @@
1
1
  # `@metamask/bitcoin-regtest-up`
2
2
 
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.
3
+ Bitcoin Core regtest runtime installer for MetaMask E2E tests
8
4
 
9
- This package does not use Docker and does not start or seed a Bitcoin node.
5
+ ## Installation
10
6
 
11
- ## Usage
7
+ `yarn add @metamask/bitcoin-regtest-up`
12
8
 
13
- Install the package in the consuming repo:
9
+ or
14
10
 
15
- ```bash
16
- yarn add @metamask/bitcoin-regtest-up
17
- npm install @metamask/bitcoin-regtest-up
18
- ```
11
+ `npm install @metamask/bitcoin-regtest-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
- "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. 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 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`.
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
- 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; } });
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
@@ -1 +1 @@
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"]}
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
- export { BITCOIN_REGTEST_DEFAULT_CORE, cleanBitcoinRegtestCache, getBitcoinRegtestCacheDirectory, installBitcoinRegtest, parseBitcoinRegtestInstallCliOptions, readBitcoinRegtestInstallOptionsFromPackageJson, } from "./install.cjs";
2
- export type { BitcoinRegtestArtifactConfig, BitcoinRegtestArtifactPlatformConfig, BitcoinRegtestInstallDependencies, BitcoinRegtestInstallOptions, BitcoinRegtestInstallResult, } from "./install.cjs";
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
@@ -1 +1 @@
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"}
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
- export { BITCOIN_REGTEST_DEFAULT_CORE, cleanBitcoinRegtestCache, getBitcoinRegtestCacheDirectory, installBitcoinRegtest, parseBitcoinRegtestInstallCliOptions, readBitcoinRegtestInstallOptionsFromPackageJson, } from "./install.mjs";
2
- export type { BitcoinRegtestArtifactConfig, BitcoinRegtestArtifactPlatformConfig, BitcoinRegtestInstallDependencies, BitcoinRegtestInstallOptions, BitcoinRegtestInstallResult, } from "./install.mjs";
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
@@ -1 +1 @@
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"}
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
- export { BITCOIN_REGTEST_DEFAULT_CORE, cleanBitcoinRegtestCache, getBitcoinRegtestCacheDirectory, installBitcoinRegtest, parseBitcoinRegtestInstallCliOptions, readBitcoinRegtestInstallOptionsFromPackageJson } from "./install.mjs";
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
@@ -1 +1 @@
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"]}
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/bitcoin-regtest-up",
3
- "version": "0.0.0-preview-82e080825",
3
+ "version": "0.0.0-preview-2a256aff2",
4
4
  "description": "Bitcoin Core regtest 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/bitcoin-regtest-up.mjs",
19
18
  "files": [
20
19
  "dist/"
21
20
  ],
@@ -1,50 +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.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
@@ -1 +0,0 @@
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"]}
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=bitcoin-regtest-up.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bitcoin-regtest-up.d.cts","sourceRoot":"","sources":["../../src/bin/bitcoin-regtest-up.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=bitcoin-regtest-up.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bitcoin-regtest-up.d.mts","sourceRoot":"","sources":["../../src/bin/bitcoin-regtest-up.ts"],"names":[],"mappings":""}
@@ -1,48 +0,0 @@
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
@@ -1 +0,0 @@
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"]}