Fix -reset command to properly wipe all node data #229
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.
Summary
The
-resetcommand was not properly wiping blockchain data, DHT peer table, and rapid stake table data because it was looking in the wrong directory (build/lib/data) instead of the actual data directory (./data) where the node stores all persistent data.This PR fixes the issue by:
build/lib/datato./data(matching the config'sdata_dirsetting)Review & Testing Checklist for Human
./datais indeed where the node stores its data when running from the mxdlib root directory (checkdefault_config.jsonhasdata_dir: "./data")./letsgo -resetand verify it removes the./datadirectory contents./letsgo testnet -resetand verify the node starts fresh with a new identity after the resetdata/node_keys.v2on startupRecommended Test Plan
ls -la data/to see current contents./letsgo -reset(answer 'y' to confirm)./letsgo testnetand verify the node starts fresh and regenerates its identityNotes
data/node_keys.v2), which will be regenerated on next startup. This is intentional per the "wipe everything" requirement.blockchain.db,blocks.db,peers.dbwhich don't actually exist - all data is stored inutxo.dbwithin the data directory.Link to Devin run: https://app.devin.ai/sessions/02b7aca7d4b047d2911c624c278ccaaa
Requested by: Runo (@AlanRuno)