diff --git a/packages/dashmate/configs/defaults/getBaseConfigFactory.js b/packages/dashmate/configs/defaults/getBaseConfigFactory.js index 25e46e3a19..d337fd919f 100644 --- a/packages/dashmate/configs/defaults/getBaseConfigFactory.js +++ b/packages/dashmate/configs/defaults/getBaseConfigFactory.js @@ -97,11 +97,6 @@ function getBaseConfigFactory(homeDir) { mediantime: null, address: null, }, - sentinel: { - docker: { - image: 'dashpay/sentinel:1.7.3', - }, - }, devnet: { name: null, minimumDifficultyBlocks: 0, diff --git a/packages/dashmate/configs/getConfigFileMigrationsFactory.js b/packages/dashmate/configs/getConfigFileMigrationsFactory.js index ff02e9625d..590c3b850b 100644 --- a/packages/dashmate/configs/getConfigFileMigrationsFactory.js +++ b/packages/dashmate/configs/getConfigFileMigrationsFactory.js @@ -124,6 +124,13 @@ function getConfigFileMigrationsFactory(homeDir, defaultConfigs) { }); return configFile; }, + '0.25.0-dev.18': (configFile) => { + Object.entries(configFile.configs) + .forEach(([, options]) => { + delete options.core.sentinel; + }); + return configFile; + }, }; } diff --git a/packages/dashmate/docker-compose.yml b/packages/dashmate/docker-compose.yml index 4058002012..fd338c3e67 100644 --- a/packages/dashmate/docker-compose.yml +++ b/packages/dashmate/docker-compose.yml @@ -38,26 +38,6 @@ services: - WSL2_FIX=${WSL2_FIX:-0} profiles: - core - - masternode - - sentinel: - image: ${CORE_SENTINEL_DOCKER_IMAGE:?err} - labels: - org.dashmate.service.title: "Sentinel" - restart: unless-stopped - depends_on: - - core - environment: - - DEBUG=false - - RPCUSER=${CORE_RPC_USER:?err} - - RPCPASSWORD=${CORE_RPC_PASSWORD:?err} - - RPCHOST=core - - RPCPORT=${CORE_RPC_PORT:?err} - - NETWORK=${NETWORK?:err} - - SENTINEL_ARGS=-b - stop_grace_period: 10s - profiles: - - masternode drive_abci: image: ${PLATFORM_DRIVE_ABCI_DOCKER_IMAGE:?err} diff --git a/packages/dashmate/src/commands/status/index.js b/packages/dashmate/src/commands/status/index.js index 06c857c3d6..ec4267e945 100644 --- a/packages/dashmate/src/commands/status/index.js +++ b/packages/dashmate/src/commands/status/index.js @@ -39,8 +39,6 @@ class StatusCommand extends ConfigBaseCommand { 'Last paid time': 'n/a', 'Payment queue position': 'n/a', 'Next payment time': 'n/a', - 'Sentinel Version': 'n/a', - 'Sentinel Status': 'n/a', 'Platform Enabled': 'n/a', 'Platform Status': 'n/a', 'Platform Version': 'n/a', @@ -92,11 +90,6 @@ class StatusCommand extends ConfigBaseCommand { plain['Payment queue position'] = paymentQueuePosition || 'n/a'; plain['Next payment time'] = nextPaymentTime || 'n/a'; } - - if (masternode.sentinel.version) { - plain['Sentinel Version'] = masternode.sentinel.version || 'n/a'; - plain['Sentinel Status'] = colors.sentinel(masternode.sentinel.state)(masternode.sentinel.state) || 'n/a'; - } } plain['Platform Enabled'] = platform.enabled || 'n/a'; diff --git a/packages/dashmate/src/commands/status/masternode.js b/packages/dashmate/src/commands/status/masternode.js index 79777f52a0..78668440dd 100644 --- a/packages/dashmate/src/commands/status/masternode.js +++ b/packages/dashmate/src/commands/status/masternode.js @@ -28,8 +28,6 @@ class MasternodeStatusCommand extends ConfigBaseCommand { getMasternodeScope, ) { const plain = { - 'Sentinel Version': 'n/a', - 'Sentinel Status': 'n/a', 'Masternode State': 'n/a', 'Masternode Sync Status': 'n/a', 'ProTx Hash': 'n/a', @@ -51,11 +49,6 @@ class MasternodeStatusCommand extends ConfigBaseCommand { const scope = await getMasternodeScope(config); if (flags.format === OUTPUT_FORMATS.PLAIN) { - if (scope.sentinel.version) { - plain['Sentinel Version'] = scope.sentinel.version || 'n/a'; - plain['Sentinel Status'] = colors.sentinel(scope.sentinel.state)(scope.sentinel.state) || 'n/a'; - } - if (scope.syncAsset === MasternodeSyncAssetEnum.MASTERNODE_SYNC_FINISHED) { plain['Masternode State'] = (scope.state === MasternodeStateEnum.READY ? chalk.green : chalk.red)(scope.state) || 'n/a'; diff --git a/packages/dashmate/src/config/configJsonSchema.js b/packages/dashmate/src/config/configJsonSchema.js index 8084f8658d..705f39a8e8 100644 --- a/packages/dashmate/src/config/configJsonSchema.js +++ b/packages/dashmate/src/config/configJsonSchema.js @@ -241,16 +241,6 @@ module.exports = { required: ['enable', 'interval', 'mediantime', 'address'], additionalProperties: false, }, - sentinel: { - type: 'object', - properties: { - docker: { - $ref: '#/definitions/docker', - }, - }, - required: ['docker'], - additionalProperties: false, - }, devnet: { type: 'object', properties: { @@ -308,8 +298,8 @@ module.exports = { type: 'boolean', }, }, - required: ['docker', 'p2p', 'rpc', 'spork', 'masternode', 'miner', 'sentinel', 'devnet', - 'log', 'logIps', 'indexes'], + required: ['docker', 'p2p', 'rpc', 'spork', 'masternode', 'miner', 'devnet', 'log', + 'logIps', 'indexes'], additionalProperties: false, }, platform: { diff --git a/packages/dashmate/src/config/getConfigProfilesFactory.js b/packages/dashmate/src/config/getConfigProfilesFactory.js index a6f85ad294..f5e96bb87c 100644 --- a/packages/dashmate/src/config/getConfigProfilesFactory.js +++ b/packages/dashmate/src/config/getConfigProfilesFactory.js @@ -7,10 +7,6 @@ function getConfigProfilesFactory() { profiles.push('core'); - if (config.get('core.masternode.enable')) { - profiles.push('masternode'); - } - if (config.get('platform.enable')) { profiles.push('platform'); } diff --git a/packages/dashmate/src/status/colors.js b/packages/dashmate/src/status/colors.js index 572793c68d..703b04888d 100644 --- a/packages/dashmate/src/status/colors.js +++ b/packages/dashmate/src/status/colors.js @@ -75,10 +75,4 @@ module.exports = { } return chalk.red; }, - sentinel: (state) => { - if (state === 'ok') { - return chalk.green; - } - return chalk.red; - }, }; diff --git a/packages/dashmate/src/status/scopes/masternode.js b/packages/dashmate/src/status/scopes/masternode.js index b8016226e1..b39ded2ad2 100644 --- a/packages/dashmate/src/status/scopes/masternode.js +++ b/packages/dashmate/src/status/scopes/masternode.js @@ -84,22 +84,6 @@ function getMasternodeScopeFactory(dockerCompose, createRpcClient, getConnection return info; } - async function getSentinelInfo(config) { - // cannot be put in Promise.all, because sentinel will cause exit 1 with simultaneous requests - const sentinelStateResponse = await dockerCompose - .execCommand(config, 'sentinel', 'python bin/sentinel.py'); - const sentinelVersionResponse = await dockerCompose - .execCommand(config, 'sentinel', 'python bin/sentinel.py -v'); - - const [state] = sentinelStateResponse.out.split(/\r?\n/); - - return { - state: state === '' ? 'ok' : state, - version: sentinelVersionResponse.out - .replace(/Dash Sentinel v/, '').trim(), - }; - } - /** * Get masternode status scope * @@ -110,10 +94,6 @@ function getMasternodeScopeFactory(dockerCompose, createRpcClient, getConnection async function getMasternodeScope(config) { const scope = { syncAsset: null, - sentinel: { - state: null, - version: null, - }, proTxHash: null, state: MasternodeStateEnum.UNKNOWN, status: null, @@ -127,30 +107,15 @@ function getMasternodeScopeFactory(dockerCompose, createRpcClient, getConnection }, }; - const basicResult = await Promise.allSettled([ - getSyncAsset(config), - getSentinelInfo(config), - ]); - - if (process.env.DEBUG) { - for (const error of basicResult.filter((e) => e.status === 'rejected')) { + try { + scope.syncAsset = await getSyncAsset(config); + } catch (error) { + if (process.env.DEBUG) { // eslint-disable-next-line no-console - console.error(error.reason); + console.error(error); } } - const [syncAsset, sentinelInfo] = basicResult - .map((result) => (result.status === 'fulfilled' ? result.value : null)); - - if (syncAsset) { - scope.syncAsset = syncAsset; - } - - if (sentinelInfo) { - scope.sentinel.state = sentinelInfo.state; - scope.sentinel.version = sentinelInfo.version; - } - if (scope.syncAsset === MasternodeSyncAssetEnum.MASTERNODE_SYNC_FINISHED) { try { const masternodeInfo = await getMasternodeInfo(config); diff --git a/packages/dashmate/src/status/scopes/overview.js b/packages/dashmate/src/status/scopes/overview.js index 07cea3aec1..cc75ae082f 100644 --- a/packages/dashmate/src/status/scopes/overview.js +++ b/packages/dashmate/src/status/scopes/overview.js @@ -37,10 +37,6 @@ function getOverviewScopeFactory(getCoreScope, proTxHash: null, nodeState: null, state: null, - sentinel: { - version: null, - state: null, - }, }; const platform = { @@ -50,12 +46,11 @@ function getOverviewScopeFactory(getCoreScope, if (masternodeEnabled) { const { - state, proTxHash, sentinel, nodeState, + state, proTxHash, nodeState, } = await getMasternodeScope(config); masternode.state = state; masternode.proTxHash = proTxHash; - masternode.sentinel = sentinel; masternode.nodeState = nodeState; } diff --git a/packages/dashmate/src/test/constants/services.js b/packages/dashmate/src/test/constants/services.js index df40fa295a..649efdaff1 100644 --- a/packages/dashmate/src/test/constants/services.js +++ b/packages/dashmate/src/test/constants/services.js @@ -3,7 +3,6 @@ const services = { dapi_envoy: 'DAPI Envoy', dapi_api: 'DAPI API', drive_tenderdash: 'Drive Tenderdash', - sentinel: 'Sentinel', drive_abci: 'Drive ABCI', dapi_tx_filter_stream: 'DAPI Transactions Filter Stream', core: 'Core', diff --git a/packages/dashmate/src/test/constants/statusOutput.js b/packages/dashmate/src/test/constants/statusOutput.js index bb301c3eb6..10cd7c5075 100644 --- a/packages/dashmate/src/test/constants/statusOutput.js +++ b/packages/dashmate/src/test/constants/statusOutput.js @@ -1,7 +1,6 @@ const preSyncedStatus = { testChain: 'test', testnet: 'testnet', - sentinel_statusNotSynced: 'dashd not synced with network! Awaiting full sync before running Sentinel.', masternode_status: 'Waiting for ProTx to appear on-chain', platform_status: 'Waiting for core sync', }; diff --git a/packages/dashmate/templates/core/dash.conf.dot b/packages/dashmate/templates/core/dash.conf.dot index b6089d14cd..0d4a789585 100644 --- a/packages/dashmate/templates/core/dash.conf.dot +++ b/packages/dashmate/templates/core/dash.conf.dot @@ -17,6 +17,7 @@ server=1 rpcuser={{=it.core.rpc.user}} rpcpassword={{=it.core.rpc.password}} rpcwallet=main +deprecatedrpc=hpmn {{~it.core.rpc.allowIps :host}} rpcallowip={{=host}}{{~}} diff --git a/packages/dashmate/test/unit/status/colors.spec.js b/packages/dashmate/test/unit/status/colors.spec.js index 20b613e4b7..18870934de 100644 --- a/packages/dashmate/test/unit/status/colors.spec.js +++ b/packages/dashmate/test/unit/status/colors.spec.js @@ -94,14 +94,4 @@ describe('colors.js', () => { expect(colors.poSePenalty(20, 2)).to.be.equal(chalk.red); }); }); - - describe('#sentinel', () => { - it('should color green', async () => { - expect(colors.sentinel('ok')).to.be.equal(chalk.green); - }); - - it('should color red', async () => { - expect(colors.sentinel('fake')).to.be.equal(chalk.red); - }); - }); }); diff --git a/packages/dashmate/test/unit/status/scopes/masternode.spec.js b/packages/dashmate/test/unit/status/scopes/masternode.spec.js index 0a1348fd94..95c2b6ee4d 100644 --- a/packages/dashmate/test/unit/status/scopes/masternode.spec.js +++ b/packages/dashmate/test/unit/status/scopes/masternode.spec.js @@ -37,12 +37,6 @@ describe('getMasternodeScopeFactory', () => { AssetName: MasternodeSyncAssetEnum.MASTERNODE_SYNC_FINISHED, }, }); - mockDockerCompose.execCommand - .withArgs(config, 'sentinel', 'python bin/sentinel.py') - .returns({ out: '' }); - mockDockerCompose.execCommand - .withArgs(config, 'sentinel', 'python bin/sentinel.py -v') - .returns({ out: 'Dash Sentinel v1.7.3' }); const mockProTxHash = 'deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef'; const mockDmnState = { @@ -67,10 +61,6 @@ describe('getMasternodeScopeFactory', () => { const expectedScope = { syncAsset: MasternodeSyncAssetEnum.MASTERNODE_SYNC_FINISHED, - sentinel: { - state: 'ok', - version: '1.7.3', - }, proTxHash: mockProTxHash, state: MasternodeStateEnum.READY, status: 'Ready', @@ -93,39 +83,7 @@ describe('getMasternodeScopeFactory', () => { // simulate failed request to dashcore mockRpcClient.mnsync.throws(new Error()); - // and lets say sentinel is working - mockDockerCompose.execCommand - .withArgs(config, 'sentinel', 'python bin/sentinel.py') - .returns({ out: 'Waiting for dash core sync' }); - mockDockerCompose.execCommand - .withArgs(config, 'sentinel', 'python bin/sentinel.py -v') - .returns({ out: 'Dash Sentinel v1.7.3' }); - - const scope = await getMasternodeScope(config); - - // should return scope with no info, but sentinel is in there - const expectedScope = { - syncAsset: null, - sentinel: { - state: 'Waiting for dash core sync', - version: '1.7.3', - }, - proTxHash: null, - state: MasternodeStateEnum.UNKNOWN, - status: null, - nodeState: { - dmnState: null, - poSePenalty: null, - lastPaidHeight: null, - lastPaidTime: null, - paymentQueuePosition: null, - nextPaymentTime: null, - }, - }; - - expect(scope).to.deep.equal(expectedScope); - - // and also should not be trying to obtain masternode info + // it should not be trying to obtain masternode info expect(mockRpcClient.getBlockchainInfo.notCalled).to.be.true(); }); @@ -136,37 +94,6 @@ describe('getMasternodeScopeFactory', () => { }, }); - mockDockerCompose.execCommand - .withArgs(config, 'sentinel', 'python bin/sentinel.py') - .returns({ out: 'Waiting for dash core sync' }); - - mockDockerCompose.execCommand - .withArgs(config, 'sentinel', 'python bin/sentinel.py -v') - .returns({ out: 'Dash Sentinel v1.7.3' }); - - const scope = await getMasternodeScope(config); - - const expectedScope = { - syncAsset: MasternodeSyncAssetEnum.MASTERNODE_SYNC_BLOCKCHAIN, - sentinel: { - state: 'Waiting for dash core sync', - version: '1.7.3', - }, - proTxHash: null, - state: MasternodeStateEnum.UNKNOWN, - status: null, - nodeState: { - dmnState: null, - poSePenalty: null, - lastPaidHeight: null, - lastPaidTime: null, - paymentQueuePosition: null, - nextPaymentTime: null, - }, - }; - - expect(scope).to.deep.equal(expectedScope); - expect(mockRpcClient.getBlockchainInfo.notCalled).to.be.true(); expect(mockRpcClient.masternode.notCalled).to.be.true(); }); diff --git a/packages/dashmate/test/unit/status/scopes/overview.spec.js b/packages/dashmate/test/unit/status/scopes/overview.spec.js index 6fce7913ff..1aa7878ac3 100644 --- a/packages/dashmate/test/unit/status/scopes/overview.spec.js +++ b/packages/dashmate/test/unit/status/scopes/overview.spec.js @@ -43,8 +43,6 @@ describe('getOverviewScopeFactory', () => { lastPaidTime: '23 days ago', paymentQueuePosition: null, nextPaymentTime: 'in 1 day', - sentinelState: '', - sentinelVersion: 'v1.2', }; const mockPlatformScope = { @@ -94,8 +92,6 @@ describe('getOverviewScopeFactory', () => { expect(mockGetMasternodeScope.notCalled).to.be.true(); expect(scope.masternode.state).to.be.equal(null); expect(scope.masternode.proTxHash).to.be.equal(null); - expect(scope.masternode.sentinel.version).to.be.equal(null); - expect(scope.masternode.sentinel.state).to.be.equal(null); expect(scope.masternode.nodeState).to.be.equal(null); expect(mockGetPlatformScope.notCalled).to.be.true();