Shortest commands
--yes is required regardless — cleanup is destructive enough that it requires for explicit intent.
Options
| Flag | Effect |
|---|---|
--yes | Required to proceed past dry-run. |
--execute | Switch from dry-run to actual deletion. |
--keep-binaries | Preserve <custom_home>/mxnode/ (binstore + git build cache). Re-install reuses cached binaries. |
--keep-config | Preserve ~/.config/mxnode/config.toml. Next install starts from your existing config without auto-init. |
What gets removed
| Path | Why |
|---|---|
Systemd units (/etc/systemd/system/elrond-node-*.service, elrond-proxy.service) | Stopped, disabled, then removed (with sudo) |
<custom_home>/elrond-nodes/ | Per-node workdirs |
<custom_home>/elrond-utils/ | The shared keygenerator binary |
<custom_home>/elrond-proxy/ | Proxy workdir, if installed |
<custom_home>/mxnode/ | Versioned binstore + git build cache (300–500 MB) |
<state>/mxnode/ | state.toml, state.toml.lock, inflight.toml |
<config>/mxnode/config.toml | The auto-init’d config |
Sample dry-run
Cleanup with no state
Ifstate.toml is missing but managed directories still exist (e.g. partial install), cleanup still works:
<custom_home>/elrond-{nodes,utils,proxy} and the mxnode footprint, removes whatever it finds, and exits cleanly.
What cleanup does not touch
- The
mxnodebinary itself (usesudo rm /usr/local/bin/mxnodeto also remove the CLI) /usr/local/go/(even if mxnode installed it)- Other validator zips parked in
<node_keys>outside the workdirs - Apt packages mxnode installed during bootstrap (
build-essential,git, etc.) — those are system tools
When to use what
| Situation | Command |
|---|---|
| Done with this host | mxnode cleanup --yes --execute |
| Switching from validator → multikey | mxnode cleanup --yes --execute then re-install |
| Re-installing after a botched try, want cached rebuild | mxnode cleanup --yes --execute --keep-binaries |
| Just clearing workdirs to free disk, want same config | mxnode cleanup --yes --execute --keep-config --keep-binaries |
Stale inflight.toml blocking an upgrade | Don’t use cleanup — the next upgrade auto-clears stale locks. See troubleshooting. |

