feat(dashmate): add core reindex command - #533
Merged
Merged
Conversation
* makes it show the progress in group mode
pshenmic
marked this pull request as draft
September 22, 2022 09:30
|
This pull request introduces 5 alerts when merging 397a456 into 0102380 - view on LGTM.com new alerts:
|
strophy
reviewed
Sep 23, 2022
strophy
reviewed
Sep 23, 2022
strophy
reviewed
Sep 23, 2022
strophy
reviewed
Sep 23, 2022
pshenmic
marked this pull request as ready for review
September 23, 2022 07:32
|
This pull request introduces 5 alerts when merging 0ca2433 into 0102380 - view on LGTM.com new alerts:
|
reindex command
reindex commandcore reindex command
|
This pull request introduces 2 alerts when merging 1a27d86 into dbf3560 - view on LGTM.com new alerts:
|
shumkov
approved these changes
Sep 30, 2022
shumkov
self-requested a review
September 30, 2022 13:55
|
This pull request introduces 2 alerts when merging 47e46f7 into dbf3560 - view on LGTM.com new alerts:
|
Co-authored-by: Ivan Shumkov <ivan@shumkov.ru>
|
This pull request introduces 3 alerts when merging 60edd37 into dbf3560 - view on LGTM.com new alerts:
|
shumkov
requested changes
Sep 30, 2022
|
This pull request introduces 3 alerts when merging a7edbfc into dbf3560 - view on LGTM.com new alerts:
|
|
This pull request introduces 3 alerts when merging c4d855a into dbf3560 - view on LGTM.com new alerts:
|
shumkov
requested changes
Oct 3, 2022
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue being fixed or feature implemented
Sometimes, dashcore nodes require reindex (rescan of blockchain) in order to recover or find missing transactions.
When you are using standalone dashcore, you have to manually edit dashcore configuration files and run nodes in reindex mode. Then get it back after the operation succeeded.
Using dashmate, we run everything in docker and it is hard to achieve that without dropping the whole chain and messing with containers. To accomplish that, you need to edit templates, and do some tricky stuff.
What was done?
Added new command
reindexfor both regular and local configurations, which runs core nodes from your configuration in the reindex mode. It modifies the configuration of dashcore, start the core, wait until it finishes sync, and turn configuration back again.Implementation Details
New configuration keys are introduced in the config: core.reindex, core.reindexContainerId. When reindex command is called, it sets core.reindex to 1, which renders new dash.conf file in your dashmate folder, and start the core via startCore function. Container id of started container saved in the configuration under
core.reindexContainerIdpath. It is used for the command interruption. You can ctrl + c any time, it will pick up container next run. Then the command will connect to the core and wait until the blockchain is fully synced. Once dashcore reach the head of blockchain, the command will stop it back, and reset core mode back to 0.You cannot start configartion until resync is fully complete
How Has This Been Tested?
Locally
Breaking Changes
core.reindexand optionslcore.reindexContainerIdconfiguration keyChecklist:
For repository code-owners and collaborators only