Skip to content

Conversation

@AlanRuno
Copy link
Owner

@AlanRuno AlanRuno commented Jan 13, 2026

Summary

Adds a -reset command to the letsgo script that allows users to reset all node data, including:

  • Peer table data
  • Rapid stake table data
  • Blockchain data (blocks, UTXO database)
  • DHT state files

Usage:

./letsgo -reset              # Reset data only (with confirmation prompt)
./letsgo -reset ./data       # Reset data in specified directory
./letsgo testnet -reset      # Reset data, then build and run on testnet
./letsgo mainnet -reset      # Reset data, then build and run on mainnet

The standalone -reset command includes a confirmation prompt before deletion. When used with testnet or mainnet, the confirmation is skipped since the user explicitly requested the reset.

Updates since last revision

  • Added support for ./letsgo testnet -reset syntax to reset data and start the node in one command
  • When used with testnet/mainnet, confirmation prompt is skipped (reset happens automatically after build, before node starts)
  • Refactored reset function to use return instead of exit so it can be called inline
  • Bug fix: Filter out -reset/--reset flags from arguments passed to mxd_node (was causing node to fail with usage error)

Review & Testing Checklist for Human

  • Test ./letsgo testnet -reset workflow: Verify reset happens after build but before node starts, and node initializes fresh (this was broken before the filtering fix)
  • Verify default data directory path: The reset targets ./build/lib/data - confirm this matches where deployed nodes actually store their data (check data_dir in config)
  • Test the glob patterns: Ensure *.json, *.dat, *.bin patterns don't accidentally match config files that should be preserved
  • Verify no-confirmation behavior: When using testnet -reset, confirm that data is deleted without prompting (this is intentional)

Recommended Test Plan

  1. Run a node to generate some data in the data directory
  2. Run ./letsgo testnet -reset and verify:
    • Build completes successfully
    • Data is reset without confirmation prompt
    • Node starts fresh without errors (no "Usage:" error message)
  3. Also test standalone ./letsgo -reset to verify confirmation prompt still works

Notes

  • The script uses rm -rf for database directories - this is intentional but destructive
  • The confirmation prompt is only shown for standalone -reset, not when combined with testnet/mainnet

Link to Devin run: https://app.devin.ai/sessions/f0a6357d898e440ea3745d77dfb91d8d
Requested by: Runo (runonetworks@gmail.com) / @AlanRuno

@devin-ai-integration
Copy link

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@AlanRuno AlanRuno merged commit 26f7537 into main Jan 13, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants