+42
-28
@@ -56,6 +56,8 @@ export const main = sdk.setupMain(async ({ effects }) => {
|
||||
const { password: APP_PASSWORD, btcAuth, dbAuth, spacedAuth } = store
|
||||
const enableExplorer = store.enableExplorer === true
|
||||
const enableSubspaces = store.enableSubspaces === true
|
||||
// subs-prover is independently gated and defaults OFF (null/undefined => false).
|
||||
const enableSubsProver = store.enableSubsProver === true
|
||||
|
||||
const spacedEnv = {
|
||||
SPACED_CHAIN,
|
||||
@@ -262,8 +264,8 @@ export const main = sdk.setupMain(async ({ effects }) => {
|
||||
// Appends the Subspaces chain (fetch → build → wallet ensure → subs-prover →
|
||||
// subs daemon) to any existing chain. `as any` because the chain's TS type
|
||||
// depends on prior IDs and we can't easily express the union here.
|
||||
const withSubspaces = (chain: any): any =>
|
||||
chain
|
||||
const withSubspaces = (chain: any): any => {
|
||||
let c = chain
|
||||
.addOneshot('subspaces-dirs', {
|
||||
subcontainer: subspacesSub,
|
||||
exec: {
|
||||
@@ -278,32 +280,6 @@ export const main = sdk.setupMain(async ({ effects }) => {
|
||||
},
|
||||
requires: [],
|
||||
})
|
||||
.addDaemon('subs-prover', {
|
||||
subcontainer: subspacesSub,
|
||||
exec: {
|
||||
command: [
|
||||
'sh',
|
||||
'-c',
|
||||
`cd ${SUBSPACES_PROVER_DIR} && exec ${SUBSPACES_PROVER_BIN} --server --server-port ${SUBSPACES_PROVER_PORT}`,
|
||||
],
|
||||
env: proverEnv,
|
||||
// Run as root: the horologger/subs image declares USER subs, but our
|
||||
// /data volume + subdirs are root-owned, so the non-root user can't
|
||||
// traverse/write them. Root sidesteps the ownership mismatch.
|
||||
user: 'root',
|
||||
},
|
||||
ready: {
|
||||
display: i18n('Subspaces Prover'),
|
||||
fn: () =>
|
||||
sdk.healthCheck.checkPortListening(effects, SUBSPACES_PROVER_PORT, {
|
||||
successMessage: i18n('subs-prover is ready'),
|
||||
errorMessage: i18n('subs-prover is not ready'),
|
||||
}),
|
||||
gracePeriod: 60_000,
|
||||
trigger: sdk.trigger.cooldownTrigger(30_000),
|
||||
},
|
||||
requires: ['subspaces-dirs'],
|
||||
})
|
||||
.addDaemon('subs-registry', {
|
||||
subcontainer: subspacesSub,
|
||||
exec: {
|
||||
@@ -349,6 +325,44 @@ export const main = sdk.setupMain(async ({ effects }) => {
|
||||
requires: ['subspaces-dirs', 'spaced', 'subs-registry'],
|
||||
})
|
||||
|
||||
// subs-prover is opt-in and DISABLED BY DEFAULT (toggle via the "Enable
|
||||
// Subspaces Prover" action). Its interface (8888) stays registered either
|
||||
// way (see interfaces.ts), but the daemon only starts when enabled. It's
|
||||
// added LAST and depends on every other subspaces daemon; it runs lengthy
|
||||
// timing tests on boot and NOTHING depends on it, so its slow startup never
|
||||
// blocks anything else.
|
||||
if (enableSubsProver) {
|
||||
c = c.addDaemon('subs-prover', {
|
||||
subcontainer: subspacesSub,
|
||||
exec: {
|
||||
command: [
|
||||
'sh',
|
||||
'-c',
|
||||
`cd ${SUBSPACES_PROVER_DIR} && exec ${SUBSPACES_PROVER_BIN} --server --server-port ${SUBSPACES_PROVER_PORT}`,
|
||||
],
|
||||
env: proverEnv,
|
||||
// Run as root: the horologger/subs image declares USER subs, but our
|
||||
// /data volume + subdirs are root-owned, so the non-root user can't
|
||||
// traverse/write them. Root sidesteps the ownership mismatch.
|
||||
user: 'root',
|
||||
},
|
||||
ready: {
|
||||
display: i18n('Subspaces Prover'),
|
||||
fn: () =>
|
||||
sdk.healthCheck.checkPortListening(effects, SUBSPACES_PROVER_PORT, {
|
||||
successMessage: i18n('subs-prover is ready'),
|
||||
errorMessage: i18n('subs-prover is not ready'),
|
||||
}),
|
||||
gracePeriod: 60_000,
|
||||
trigger: sdk.trigger.cooldownTrigger(30_000),
|
||||
},
|
||||
requires: ['subspaces-dirs', 'subs-registry', 'subs'],
|
||||
})
|
||||
}
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
if (!enableExplorer) {
|
||||
// Spaces-only mode: spaced + gotty terminal. No PostgreSQL, no indexer.
|
||||
// User can flip the toggle via the Enable Embedded Explorer action;
|
||||
|
||||
Reference in New Issue
Block a user