Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/host/local-hm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ export interface LocalHmConfig {
* Override with `--hm-image` or `SPHERE_LOCAL_HM_IMAGE`.
*/
readonly image?: string;
/**
* Sphere network to inject into the HM (`UNICITY_NETWORK`) so the
* HM inherits it into every tenant it spawns. Defaults to 'testnet'
* for backward compat; pass 'testnet2' to run tenants against the
* v2 gateway (Phase-6 UXF fork).
*/
readonly network?: string;
/**
* Health-port to expose on `127.0.0.1`. The HM listens on 9401
* internally; we map each per-developer HM to a different host port
Expand Down Expand Up @@ -788,6 +795,7 @@ export async function ensureLocalHM(config: LocalHmConfig): Promise<LocalHmMetad
managerPubkey: currentPubkey,
managerDirectAddress: currentDirectAddress,
tenantsHostDir: tenantsDir,
network: config.network ?? process.env['SPHERE_LOCAL_HM_NETWORK'],
healthPort,
});

Expand Down
3 changes: 2 additions & 1 deletion src/trader/spawn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export interface TraderSpawnOptions {
* Sphere network for both wallet sanity-check and the test-fund gate.
* Defaults to whatever the wallet's `Sphere` instance reports.
*/
readonly network?: 'testnet' | 'mainnet' | 'dev';
readonly network?: 'testnet' | 'testnet2' | 'mainnet' | 'dev';
}

export interface TraderSpawnResult {
Expand Down Expand Up @@ -237,6 +237,7 @@ export async function spawnTrader(opts: TraderSpawnOptions): Promise<TraderSpawn
baseDir,
templatesFile: opts.templatesFile,
image: opts.hmImage,
network,
healthPort: opts.healthPort,
});

Expand Down
4 changes: 2 additions & 2 deletions src/trader/trader-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ interface TraderSpawnCliOpts {
templatesFile?: string;
healthPort?: string;
image?: string;
network?: 'testnet' | 'mainnet' | 'dev';
network?: 'testnet' | 'testnet2' | 'mainnet' | 'dev';
}

interface TraderStopCliOpts {
Expand Down Expand Up @@ -614,7 +614,7 @@ export function createTraderCommand(): Command {
.option('--hm-image <ref>', 'Override the local HM container image')
.option('--templates-file <path>', 'Override templates.json mounted into the HM')
.option('--health-port <port>', 'Override HM health-port host mapping (127.0.0.1:<port>)')
.option('--network <name>', 'Sphere network: testnet|mainnet|dev (default: testnet)')
.option('--network <name>', 'Sphere network: testnet|testnet2|mainnet|dev (default: testnet)')
.action(async function (this: Command, opts: TraderSpawnCliOpts) {
await handleSpawn(this, opts);
});
Expand Down