@toon-protocol/townhouse 0.3.2 → 0.5.0
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/dist/{chunk-6T5CXPYD.js → chunk-IXG4IYTG.js} +7929 -7413
- package/dist/chunk-IXG4IYTG.js.map +1 -0
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +34 -5
- package/dist/cli.js.map +1 -1
- package/dist/compose/townhouse-hs.yml +14 -9
- package/dist/image-manifest.json +10 -10
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/{manager-BtpOFwd6.d.ts → manager-DSkD9Td1.d.ts} +31 -3
- package/package.json +2 -2
- package/dist/chunk-6T5CXPYD.js.map +0 -1
package/dist/cli.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import Docker from 'dockerode';
|
|
3
|
-
import { C as ComposeLoaderOptions, T as TownhouseConfig, W as WalletManager, N as NodeType } from './manager-
|
|
3
|
+
import { C as ComposeLoaderOptions, T as TownhouseConfig, W as WalletManager, N as NodeType } from './manager-DSkD9Td1.js';
|
|
4
|
+
import '@toon-protocol/core';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Cross-platform browser opener for the wizard CLI command.
|
package/dist/cli.js
CHANGED
|
@@ -27,8 +27,9 @@ import {
|
|
|
27
27
|
saveWallet,
|
|
28
28
|
serviceFromContainerName,
|
|
29
29
|
tailContainerLogs,
|
|
30
|
-
writeHsConnectorConfig
|
|
31
|
-
|
|
30
|
+
writeHsConnectorConfig,
|
|
31
|
+
writeHsNodeEnvFile
|
|
32
|
+
} from "./chunk-IXG4IYTG.js";
|
|
32
33
|
import "./chunk-5O4SBV5O.js";
|
|
33
34
|
import {
|
|
34
35
|
CONTAINER_PREFIX
|
|
@@ -1993,7 +1994,7 @@ var HELP_TEXT = `townhouse \u2014 TOON node orchestrator
|
|
|
1993
1994
|
|
|
1994
1995
|
Usage:
|
|
1995
1996
|
townhouse setup [--no-browser] [--port <n>] [--config-dir <dir>] Run the first-run setup wizard
|
|
1996
|
-
townhouse init [--force] [--config-dir <dir>] [--password <pw>] [--preset <name>] [--yes] Initialize config + wallet
|
|
1997
|
+
townhouse init [--force] [--config-dir <dir>] [--password <pw>] [--preset <name>] [--network <mode>] [--yes] Initialize config + wallet
|
|
1997
1998
|
townhouse up [--town] [--mill] [--dvm] [-c <path>] [--password <pw>] Start nodes
|
|
1998
1999
|
townhouse down [-c <path>] Stop all nodes
|
|
1999
2000
|
townhouse status [-c <path>] Show node status
|
|
@@ -2027,6 +2028,8 @@ Flags:
|
|
|
2027
2028
|
--no-browser Skip opening the browser automatically (setup command)
|
|
2028
2029
|
--port Override the API port (setup command, default 9400)
|
|
2029
2030
|
--preset Init from a named preset (init only). Supported: demo
|
|
2031
|
+
--network Chain network for apex + nodes (init only): mainnet (default), testnet, devnet, custom
|
|
2032
|
+
--evm-url / --sol-url RPC URLs for --network custom (the project's dev chains; or EVM_URL/SOL_URL env)
|
|
2030
2033
|
--yes Non-interactive (init only); with --preset=demo uses demo password if --password absent
|
|
2031
2034
|
--json Machine-readable JSON output (node commands; NDJSON for \`logs\`)
|
|
2032
2035
|
--lines Number of historical log lines to fetch on attach (logs command, default 50)
|
|
@@ -2046,7 +2049,7 @@ function printInitNextStep(dir) {
|
|
|
2046
2049
|
);
|
|
2047
2050
|
console.log("It can take a few minutes; progress is shown throughout.");
|
|
2048
2051
|
}
|
|
2049
|
-
async function handleInit(force, configDir, password, preset, yes) {
|
|
2052
|
+
async function handleInit(force, configDir, password, preset, yes, network, endpoints) {
|
|
2050
2053
|
const dir = resolve(configDir ?? DEFAULT_CONFIG_DIR);
|
|
2051
2054
|
const configPath = join(dir, "config.yaml");
|
|
2052
2055
|
if (existsSync(configPath) && !force) {
|
|
@@ -2071,6 +2074,12 @@ async function handleInit(force, configDir, password, preset, yes) {
|
|
|
2071
2074
|
configToWrite = getDefaultConfig();
|
|
2072
2075
|
configToWrite.wallet.encrypted_path = join(dir, "wallet.enc");
|
|
2073
2076
|
}
|
|
2077
|
+
if (network !== void 0) {
|
|
2078
|
+
configToWrite.network = network;
|
|
2079
|
+
}
|
|
2080
|
+
if (endpoints && (endpoints.evmUrl || endpoints.solUrl)) {
|
|
2081
|
+
configToWrite.endpoints = endpoints;
|
|
2082
|
+
}
|
|
2074
2083
|
const yamlContent = stringify(configToWrite);
|
|
2075
2084
|
writeFileSync(configPath, yamlContent, {
|
|
2076
2085
|
encoding: "utf-8",
|
|
@@ -3143,6 +3152,7 @@ async function handleHsUp(_configPath, configDir, config, docker, options) {
|
|
|
3143
3152
|
writeHsConnectorConfig(configDir, config, { force });
|
|
3144
3153
|
const materialize = hsOverrides?.materializeComposeTemplate ?? materializeComposeTemplate;
|
|
3145
3154
|
const { composePath } = materialize("hs", { townhouseHome: configDir });
|
|
3155
|
+
writeHsNodeEnvFile(configDir, config);
|
|
3146
3156
|
ribbon.start("pull");
|
|
3147
3157
|
const orchestratorFactory = hsOverrides?.createOrchestrator ?? ((d, cfg, wm, opts) => new DockerOrchestrator(d, cfg, wm, opts));
|
|
3148
3158
|
const orch = orchestratorFactory(docker, config, walletManager, {
|
|
@@ -3603,6 +3613,9 @@ async function main(argv, dockerInstance, browserOpener, hsOverrides, nodeComman
|
|
|
3603
3613
|
"no-browser": { type: "boolean" },
|
|
3604
3614
|
port: { type: "string" },
|
|
3605
3615
|
preset: { type: "string" },
|
|
3616
|
+
network: { type: "string" },
|
|
3617
|
+
"evm-url": { type: "string" },
|
|
3618
|
+
"sol-url": { type: "string" },
|
|
3606
3619
|
yes: { type: "boolean" },
|
|
3607
3620
|
"rotate-keys": { type: "boolean" },
|
|
3608
3621
|
"skip-preflight": { type: "boolean" },
|
|
@@ -3678,12 +3691,28 @@ async function main(argv, dockerInstance, browserOpener, hsOverrides, nodeComman
|
|
|
3678
3691
|
process.exitCode = 1;
|
|
3679
3692
|
break;
|
|
3680
3693
|
}
|
|
3694
|
+
const networkVal = values.network;
|
|
3695
|
+
if (networkVal !== void 0 && !["mainnet", "testnet", "devnet", "custom"].includes(networkVal)) {
|
|
3696
|
+
console.error(
|
|
3697
|
+
`Unknown network: ${networkVal}. Supported: mainnet, testnet, devnet, custom`
|
|
3698
|
+
);
|
|
3699
|
+
process.exitCode = 1;
|
|
3700
|
+
break;
|
|
3701
|
+
}
|
|
3702
|
+
const evmUrl = values["evm-url"] ?? process.env["EVM_URL"];
|
|
3703
|
+
const solUrl = values["sol-url"] ?? process.env["SOL_URL"];
|
|
3704
|
+
const endpoints = evmUrl || solUrl ? {
|
|
3705
|
+
...evmUrl ? { evmUrl } : {},
|
|
3706
|
+
...solUrl ? { solUrl } : {}
|
|
3707
|
+
} : void 0;
|
|
3681
3708
|
await handleInit(
|
|
3682
3709
|
values.force === true,
|
|
3683
3710
|
values["config-dir"],
|
|
3684
3711
|
values.password,
|
|
3685
3712
|
presetVal,
|
|
3686
|
-
values.yes === true
|
|
3713
|
+
values.yes === true,
|
|
3714
|
+
networkVal,
|
|
3715
|
+
endpoints
|
|
3687
3716
|
);
|
|
3688
3717
|
break;
|
|
3689
3718
|
}
|