diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h index 261fab62628..7f6df1c7aa4 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h @@ -3362,7 +3362,7 @@ GPB_FINAL @interface GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosRespon /** The actual finalized information about the requested epochs */ @property(nonatomic, readwrite, strong, null_resettable) GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_FinalizedEpochInfos *epochs; -/** Cryptographic proof of the finalized epoch information, if requested */ +/** Cryptographic proof of the finalized epoch */ @property(nonatomic, readwrite, strong, null_resettable) Proof *proof; /** Metadata about the blockchain state */ @@ -3384,7 +3384,8 @@ typedef GPB_ENUM(GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0 }; /** - * FinalizedEpochInfos holds a collection of finalized epoch information entries + * FinalizedEpochInfos holds a collection of finalized epoch information + * entries **/ GPB_FINAL @interface GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_FinalizedEpochInfos : GPBMessage @@ -6438,7 +6439,10 @@ GPB_FINAL @interface GetTokenPerpetualDistributionLastClaimRequest_GetTokenPerpe /** 32‑byte token identifier */ @property(nonatomic, readwrite, copy, null_resettable) NSData *tokenId; -/** This should be set if you wish to get back the last claim info as a specific type */ +/** + * This should be set if you wish to get back the last claim info as a + * specific type + **/ @property(nonatomic, readwrite, strong, null_resettable) GetTokenPerpetualDistributionLastClaimRequest_ContractTokenInfo *contractInfo; /** Test to see if @c contractInfo has been set. */ @property(nonatomic, readwrite) BOOL hasContractInfo; diff --git a/packages/dashmate/src/config/getConfigProfilesFactory.js b/packages/dashmate/src/config/getConfigProfilesFactory.js index c1aa1bf6428..655386979aa 100644 --- a/packages/dashmate/src/config/getConfigProfilesFactory.js +++ b/packages/dashmate/src/config/getConfigProfilesFactory.js @@ -5,9 +5,10 @@ export default function getConfigProfilesFactory() { /** * @typedef {function} getConfigProfiles * @param {Config} config + * @param {{ includeAll?: boolean }} [options] * @returns {string[]} */ - function getConfigProfiles(config) { + function getConfigProfiles(config, { includeAll = false } = {}) { const profiles = []; profiles.push('core'); @@ -15,15 +16,19 @@ export default function getConfigProfilesFactory() { if (config.get('platform.enable')) { profiles.push('platform'); - // Select which DAPI stack to enable via profiles - if (config.get('platform.dapi.deprecated.enabled')) { + const deprecatedEnabled = config.get('platform.dapi.deprecated.enabled'); + + if (includeAll) { + profiles.push('platform-dapi-deprecated'); + profiles.push('platform-dapi-rs'); + } else if (deprecatedEnabled) { profiles.push('platform-dapi-deprecated'); } else { profiles.push('platform-dapi-rs'); } } - return profiles; + return Array.from(new Set(profiles)); } return getConfigProfiles; diff --git a/packages/dashmate/src/listr/tasks/resetNodeTaskFactory.js b/packages/dashmate/src/listr/tasks/resetNodeTaskFactory.js index 506e601778d..2fbf5d6c660 100644 --- a/packages/dashmate/src/listr/tasks/resetNodeTaskFactory.js +++ b/packages/dashmate/src/listr/tasks/resetNodeTaskFactory.js @@ -12,6 +12,7 @@ import wait from '../../util/wait.js'; * @param {ConfigFile} configFile * @param {HomeDir} homeDir * @param {generateEnvs} generateEnvs + * @param {getConfigProfiles} getConfigProfiles * @return {resetNodeTask} */ export default function resetNodeTaskFactory( @@ -23,7 +24,13 @@ export default function resetNodeTaskFactory( configFile, homeDir, generateEnvs, + getConfigProfiles, ) { + function selectPlatformProfiles(config, options) { + return getConfigProfiles(config, options) + .filter((profile) => profile.startsWith('platform')); + } + /** * Remove path but ignore permission issues to avoid failing reset on root-owned directories. * @@ -70,9 +77,13 @@ export default function resetNodeTaskFactory( title: 'Check services are not running', skip: (ctx) => ctx.isForce, task: async (ctx) => { + const profiles = ctx.isPlatformOnlyReset + ? selectPlatformProfiles(config, { includeAll: true }) + : []; + if (await dockerCompose.isNodeRunning( config, - { profiles: ctx.isPlatformOnlyReset ? ['platform'] : [] }, + { profiles }, )) { throw new Error('Running services detected. Please ensure all services are stopped for this config before starting'); } @@ -98,12 +109,14 @@ export default function resetNodeTaskFactory( title: 'Remove platform services and associated data', enabled: (ctx) => ctx.isPlatformOnlyReset, task: async (ctx, task) => { + const profiles = selectPlatformProfiles(config, { includeAll: true }); + if (ctx.keepData) { // eslint-disable-next-line no-param-reassign task.title = 'Remove platform services and keep associated data'; } - await dockerCompose.rm(config, { profiles: ['platform'] }); + await dockerCompose.rm(config, { profiles }); // Remove volumes if (!ctx.keepData) { @@ -111,7 +124,7 @@ export default function resetNodeTaskFactory( const projectVolumeNames = await dockerCompose.getVolumeNames( config, - { profiles: ['platform'] }, + { profiles }, ); await Promise.all( @@ -132,7 +145,7 @@ export default function resetNodeTaskFactory( await wait(1000); // Remove containers - await dockerCompose.rm(config, { profiles: ['platform'] }); + await dockerCompose.rm(config, { profiles }); isRetry = true; diff --git a/packages/dashmate/src/listr/tasks/startNodeTaskFactory.js b/packages/dashmate/src/listr/tasks/startNodeTaskFactory.js index e517bdbbd00..23b460f0b31 100644 --- a/packages/dashmate/src/listr/tasks/startNodeTaskFactory.js +++ b/packages/dashmate/src/listr/tasks/startNodeTaskFactory.js @@ -33,15 +33,9 @@ export default function startNodeTaskFactory( homeDir, getConfigProfiles, ) { - function getPlatformProfiles(config) { - const platformProfiles = getConfigProfiles(config) + function selectPlatformProfiles(config, options) { + return getConfigProfiles(config, options) .filter((profile) => profile.startsWith('platform')); - - if (platformProfiles.length === 0) { - platformProfiles.push('platform'); - } - - return Array.from(new Set(platformProfiles)); } /** @@ -102,7 +96,7 @@ export default function startNodeTaskFactory( title: 'Check node is not started', enabled: (ctx) => !ctx.isForce, task: async (ctx) => { - const profiles = ctx.platformOnly ? getPlatformProfiles(config) : []; + const profiles = ctx.platformOnly ? selectPlatformProfiles(config) : []; if (await dockerCompose.isNodeRunning(config, { profiles })) { throw new Error('Running services detected. Please ensure all services are stopped for this config before starting'); @@ -157,7 +151,7 @@ export default function startNodeTaskFactory( config.get('core.masternode.operator.privateKey', true); } - const profiles = ctx.platformOnly ? getPlatformProfiles(config) : []; + const profiles = ctx.platformOnly ? selectPlatformProfiles(config) : []; await dockerCompose.up(config, { profiles }); }, diff --git a/packages/dashmate/src/listr/tasks/stopNodeTaskFactory.js b/packages/dashmate/src/listr/tasks/stopNodeTaskFactory.js index 264aac6dd92..9fdf39c6c53 100644 --- a/packages/dashmate/src/listr/tasks/stopNodeTaskFactory.js +++ b/packages/dashmate/src/listr/tasks/stopNodeTaskFactory.js @@ -16,15 +16,9 @@ export default function stopNodeTaskFactory( getConnectionHost, getConfigProfiles, ) { - function getPlatformProfiles(config) { - const platformProfiles = getConfigProfiles(config) + function selectPlatformProfiles(config, options) { + return getConfigProfiles(config, options) .filter((profile) => profile.startsWith('platform')); - - if (platformProfiles.length === 0) { - platformProfiles.push('platform'); - } - - return Array.from(new Set(platformProfiles)); } /** @@ -40,7 +34,9 @@ export default function stopNodeTaskFactory( title: 'Check node is running', skip: (ctx) => ctx.isForce, task: async (ctx) => { - const profiles = ctx.platformOnly ? getPlatformProfiles(config) : []; + const profiles = ctx.platformOnly + ? selectPlatformProfiles(config, { includeAll: true }) + : []; if (!await dockerCompose.isNodeRunning(config, { profiles })) { throw new Error('Node is not running'); @@ -80,7 +76,9 @@ export default function stopNodeTaskFactory( { title: `Stopping ${config.getName()} node`, task: async (ctx) => { - const profiles = ctx.platformOnly ? getPlatformProfiles(config) : []; + const profiles = ctx.platformOnly + ? selectPlatformProfiles(config, { includeAll: true }) + : []; await dockerCompose.stop(config, { profiles }); },