-
Notifications
You must be signed in to change notification settings - Fork 58
feat(dashmate): add core reindex command
#533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
8f1321d
fix(dashmate): update v18 for the mainnet nodes
pshenmic a9527a6
Merge remote-tracking branch 'origin/master'
pshenmic 278e656
Merge remote-tracking branch 'origin/master'
pshenmic 1ddd2e6
feat(dashmate): add reindex command (wip)
pshenmic 06c8079
chore(dashmate): bump migration version
pshenmic 4916283
chore(dashmate): bump migration version
pshenmic c4e620b
fix(dashmate): start only core nodes during reindex
pshenmic ba785e2
feat(dashmate): change running core strategy
pshenmic 06816e3
chore(dashmate): wip
pshenmic c217e46
fix(dashmate): fix naming
pshenmic 5ebf64e
feat(dashmate): migrate wait job to observer
pshenmic 071aca8
feat(dashmate): add healthcheck in the waitForCoreSync.js
pshenmic 1da2f0d
feat(dashmate): move out upper
pshenmic 63fa8c2
docs(dashmate): add reindex documentation
pshenmic 397a456
chore(dashmate): lower dashcore
pshenmic 0ca2433
chore(dashmate): code review fix
pshenmic 4d1043a
chore(dashmate): remove outdated const
pshenmic 6c33916
chore(dashmate): fix
pshenmic 2fcc431
chore(dashmate): migrate to v23-dev
pshenmic 9af5109
chore(dashmate): migrate to v23-dev
pshenmic 20b97b4
Merge branch 'v0.23-dev' into feat/dashmate-reindex
pshenmic 0e59322
docs(dashmate): fix code review fixes
pshenmic 8ec03ef
chore(dashmate): update docs
pshenmic ba6b9d2
fix(dashmate): code review fixes
pshenmic 975d33d
Merge branch 'v0.23-dev' into feat/dashmate-reindex
pshenmic a4f0586
fix(dashmate): fix typo
pshenmic e25207a
fix(dashmate): fix typo
pshenmic 6d9df64
chore(dashmate): remove healthcheck
pshenmic 7a1534e
chore(dashmate): typo fix
pshenmic 3916d94
chore(dashmate): fix lint
pshenmic 2df92b5
chore(dashmate): fix eslint
pshenmic 754ee98
chore(dashmate): code review fixes
pshenmic 1a27d86
feat(dashmate): make reindex as a core subscommand
pshenmic fcc6e42
fix(dashmate): Remove -masternodeblsprivkey from docker arguments (#538)
pshenmic 3ccabdc
feat(dashmate): check for docker container existence
pshenmic 47e46f7
Merge branch 'master' into feat/dashmate-reindex
pshenmic 7fa29dd
chore(dashmate): code review text fixes
pshenmic 60edd37
fix(dashmate): code review fix
pshenmic a7edbfc
chore(dashmate): fix code review
pshenmic c4d855a
fix(dashmate): reuse container info
pshenmic 9430c87
chore(dashmate): some minor imprvmnts
pshenmic 149d9cb
chore(dashmate): fix missing semicolon
pshenmic 1f3e9b1
chore(dashmate): fix linting and some bugs
pshenmic d7a5d20
chore: combine migrations
shumkov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| const { Listr } = require('listr2'); | ||
|
|
||
| const { Flags } = require('@oclif/core'); | ||
|
|
||
| const ConfigBaseCommand = require('../../oclif/command/ConfigBaseCommand'); | ||
|
|
||
| const MuteOneLineError = require('../../oclif/errors/MuteOneLineError'); | ||
|
|
||
| class ReindexCommand extends ConfigBaseCommand { | ||
| /** | ||
| * @param {Object} args | ||
| * @param {Object} flags | ||
| * @param {isSystemConfig} isSystemConfig | ||
| * @param {Config} config | ||
| * @param {reindexNodeTask} reindexNodeTask | ||
| * | ||
| * @return {Promise<void>} | ||
| */ | ||
| async runWithDependencies( | ||
| args, | ||
| { | ||
| verbose: isVerbose, | ||
| }, | ||
| isSystemConfig, | ||
| config, | ||
| reindexNodeTask, | ||
| ) { | ||
| const tasks = new Listr([ | ||
| { | ||
| title: `Reindex ${config.getName()} node`, | ||
| task: () => reindexNodeTask(config), | ||
| }, | ||
| ], | ||
| { | ||
| renderer: isVerbose ? 'verbose' : 'default', | ||
| rendererOptions: { | ||
| showTimer: isVerbose, | ||
| clearOutput: false, | ||
| collapse: false, | ||
| showSubtasks: true, | ||
| }, | ||
| }); | ||
|
|
||
| try { | ||
| await tasks.run({ | ||
| isVerbose, | ||
| }); | ||
| } catch (e) { | ||
| throw new MuteOneLineError(e); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| ReindexCommand.description = `Reindex Core | ||
|
|
||
| Reindex Core data | ||
| `; | ||
|
|
||
| ReindexCommand.flags = { | ||
| ...ConfigBaseCommand.flags, | ||
| verbose: Flags.boolean({ char: 'v', description: 'use verbose mode for output', default: false }), | ||
| }; | ||
|
|
||
| module.exports = ReindexCommand; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| const { Listr } = require('listr2'); | ||
|
|
||
| const { Flags } = require('@oclif/core'); | ||
|
|
||
| const MuteOneLineError = require('../../../oclif/errors/MuteOneLineError'); | ||
| const GroupBaseCommand = require('../../../oclif/command/GroupBaseCommand'); | ||
|
|
||
| class GroupReindexCommand extends GroupBaseCommand { | ||
| /** | ||
| * @param {Object} args | ||
| * @param {Object} flags | ||
| * @param {isSystemConfig} isSystemConfig | ||
| * @param {reindexNodeTask} reindexNodeTask | ||
| * @param {createRpcClient} createRpcClient | ||
| * @param {dockerCompose} dockerCompose | ||
| * @param {Config[]} configGroup | ||
| * @return {Promise<void>} | ||
| */ | ||
| async runWithDependencies( | ||
| args, | ||
| { | ||
| verbose: isVerbose, | ||
| }, | ||
| isSystemConfig, | ||
| reindexNodeTask, | ||
| createRpcClient, | ||
| dockerCompose, | ||
| configGroup, | ||
| ) { | ||
| const groupName = configGroup[0].get('group'); | ||
|
|
||
| const tasks = new Listr({ | ||
| title: `Reindex ${groupName} nodes`, | ||
| task: async () => ( | ||
| new Listr([ | ||
| { | ||
| title: 'Reindex core nodes', | ||
| task: () => ( | ||
| new Listr(configGroup.map((config) => ({ | ||
| task: () => reindexNodeTask(config), | ||
| }))) | ||
| ), | ||
| }, | ||
| ]) | ||
| ), | ||
| }, | ||
| { | ||
| renderer: isVerbose ? 'verbose' : 'default', | ||
| rendererOptions: { | ||
| showTimer: isVerbose, | ||
| clearOutput: false, | ||
| collapse: false, | ||
| showSubtasks: true, | ||
| }, | ||
| }); | ||
|
|
||
| try { | ||
| await tasks.run({ | ||
| isVerbose, | ||
| }); | ||
| } catch (e) { | ||
| throw new MuteOneLineError(e); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| GroupReindexCommand.description = `Reindex group of Core services | ||
|
|
||
| Reindex group Core data | ||
| `; | ||
|
|
||
| GroupReindexCommand.flags = { | ||
| ...GroupBaseCommand.flags, | ||
| verbose: Flags.boolean({ char: 'v', description: 'use verbose mode for output', default: false }), | ||
| }; | ||
|
|
||
| module.exports = GroupReindexCommand; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.