Files
spaces-startos/startos/actions/enableSubspaces.ts
T
spacesops b308d0ceaa
Build Service / BuildPackage (push) Has been cancelled
v0.0.9:2
2026-05-23 02:37:38 -04:00

38 lines
1.3 KiB
TypeScript

import { storeJson } from '../fileModels/storeJson'
import { i18n } from '../i18n'
import { sdk } from '../sdk'
export const enableSubspaces = sdk.Action.withoutInput(
// id
'enable-subspaces',
// metadata
async ({ effects }) => {
const current = await storeJson.read((s) => s.enableSubspaces).once()
return {
name: i18n('Enable Subspaces'),
description: i18n(
'Turn on the embedded Subspaces service (off-chain Bitcoin handles). Starts three prebuilt daemons — subs (Web UI), subs-prover, and registry-server — each on its own interface. Service restarts automatically. subs loads the existing `default` spaces wallet; create it first via the Space-CLI Web UI (`spaces createwallet`) if you have not already.',
),
warning: null,
allowedStatuses: 'any',
group: null,
visibility: current === true ? 'hidden' : 'enabled',
}
},
// run
async ({ effects }) => {
await storeJson.merge(effects, { enableSubspaces: true })
return {
version: '1',
title: i18n('Success'),
message: i18n(
'Subspaces enabled. The service is restarting; the Subspaces Web UI (7777), Prover (8888), and Registry (8081) interfaces come up once their daemons are healthy.',
),
result: null,
}
},
)