Build Service / BuildPackage (push) Has been cancelled
Adds a user toggle for SUBS_PUBLISH_REQUIRE_FINALIZED, copies the certrelay monitor binary to /data/bin for terminal use, and bumps the spaced image to horologger/spaces:v0.0.9x. Co-authored-by: Cursor <cursoragent@cursor.com>
66 lines
1.8 KiB
TypeScript
66 lines
1.8 KiB
TypeScript
import { storeJson } from '../fileModels/storeJson'
|
|
import { i18n } from '../i18n'
|
|
import { sdk } from '../sdk'
|
|
|
|
const { InputSpec, Value } = sdk
|
|
|
|
const inputSpec = InputSpec.of({
|
|
subsPublishRequireFinalized: Value.toggle({
|
|
name: i18n('Require Finalized Publish'),
|
|
description: i18n(
|
|
'When on, subs blocks certificate publish until commitments are finalized (150 confirmations). Maps to SUBS_PUBLISH_REQUIRE_FINALIZED in the subs daemon environment. Off by default.',
|
|
),
|
|
warning: null,
|
|
footnote: null,
|
|
default: false,
|
|
}),
|
|
})
|
|
|
|
export const configureSubspaces = sdk.Action.withInput(
|
|
// id
|
|
'configure-subspaces',
|
|
|
|
// metadata
|
|
async ({ effects }) => ({
|
|
name: i18n('Configure Subspaces'),
|
|
description: i18n(
|
|
'Set user-tunable subs options. Saving restarts the service so the subs daemon picks up the new environment.',
|
|
),
|
|
warning: null,
|
|
allowedStatuses: 'any',
|
|
group: null,
|
|
visibility: 'enabled',
|
|
}),
|
|
|
|
// input
|
|
inputSpec,
|
|
|
|
// prefill — current value (unset/null => false)
|
|
async ({ effects }) => {
|
|
const enabled = await storeJson
|
|
.read((s) => s.subsPublishRequireFinalized)
|
|
.once()
|
|
return { subsPublishRequireFinalized: enabled === true }
|
|
},
|
|
|
|
// run
|
|
async ({ effects, input }) => {
|
|
await storeJson.merge(effects, {
|
|
subsPublishRequireFinalized: input.subsPublishRequireFinalized,
|
|
})
|
|
|
|
return {
|
|
version: '1',
|
|
title: i18n('Success'),
|
|
message: input.subsPublishRequireFinalized
|
|
? i18n(
|
|
'Subspaces configuration saved. SUBS_PUBLISH_REQUIRE_FINALIZED is enabled; the service is restarting.',
|
|
)
|
|
: i18n(
|
|
'Subspaces configuration saved. SUBS_PUBLISH_REQUIRE_FINALIZED is disabled; the service is restarting.',
|
|
),
|
|
result: null,
|
|
}
|
|
},
|
|
)
|