v0.0.9:2
Build Service / BuildPackage (push) Has been cancelled

This commit is contained in:
2026-05-23 02:37:38 -04:00
parent e41ff31221
commit b308d0ceaa
17 changed files with 911 additions and 493 deletions
+58
View File
@@ -0,0 +1,58 @@
import { i18n } from '../i18n'
import { sdk } from '../sdk'
import { dataDir, SUBSPACES_DIR } from '../utils'
export const resetSubspacesState = sdk.Action.withoutInput(
// id
'reset-subspaces-state',
// metadata
async ({ effects }) => ({
name: i18n('Reset Subspaces State'),
description: i18n(
'Wipe /data/subspaces so the next start re-creates empty Subspaces data, prover, and registry directories.',
),
warning: i18n(
'This deletes all local Subspaces state — any handles/proofs stored on disk will be lost. The binaries ship in the image, so nothing needs to be re-downloaded. The spaces wallet on spaced is preserved.',
),
allowedStatuses: 'any',
group: null,
visibility: 'enabled',
}),
// run
async ({ effects }) => {
const res = await sdk.SubContainer.withTemp(
effects,
{ imageId: 'subspaces' },
sdk.Mounts.of().mountVolume({
volumeId: 'main',
subpath: null,
mountpoint: dataDir,
readonly: false,
}),
'spaces-reset-subspaces',
(subc) => subc.exec(['rm', '-rf', SUBSPACES_DIR], { user: 'root' }),
)
if (res.exitCode !== 0) {
return {
version: '1',
title: i18n('Failure'),
message: i18n('Could not wipe Subspaces state: ${error}', {
error: (res.stderr ?? '').toString() || `exit ${res.exitCode}`,
}),
result: null,
}
}
return {
version: '1',
title: i18n('Success'),
message: i18n(
'Subspaces cache and data have been wiped. Start (or restart) the service to re-fetch and rebuild from GitHub.',
),
result: null,
}
},
)