Skip to main content
Remove every byte mxnode wrote. Stop and disable units, delete workdirs, wipe the binstore, drop state and config.

Shortest commands

mxnode cleanup --yes                       # dry-run (default)
mxnode cleanup --yes --execute             # actually delete
--yes is required regardless — cleanup is destructive enough that it requires for explicit intent.

Options

FlagEffect
--yesRequired to proceed past dry-run.
--executeSwitch from dry-run to actual deletion.
--keep-binariesPreserve <custom_home>/mxnode/ (binstore + git build cache). Re-install reuses cached binaries.
--keep-configPreserve ~/.config/mxnode/config.toml. Next install starts from your existing config without auto-init.

What gets removed

PathWhy
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.tomlThe auto-init’d config

Sample dry-run

$ mxnode cleanup --yes
cleanup plan (dry-run):
  stop elrond-node-0.service
  disable elrond-node-0.service
  sudo rm /etc/systemd/system/elrond-node-0.service
  rm -rf /home/<you>/elrond-nodes/node-0
  ...
  rm -rf /home/<you>/mxnode
  rm -rf /home/<you>/.local/state/mxnode
  rm /home/<you>/.config/mxnode/config.toml

No changes made. Re-run with --execute to actually delete.

Cleanup with no state

If state.toml is missing but managed directories still exist (e.g. partial install), cleanup still works:
mxnode cleanup --yes --execute
It scans for <custom_home>/elrond-{nodes,utils,proxy} and the mxnode footprint, removes whatever it finds, and exits cleanly.

What cleanup does not touch

  • The mxnode binary itself (use sudo rm /usr/local/bin/mxnode to 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

SituationCommand
Done with this hostmxnode cleanup --yes --execute
Switching from validator → multikeymxnode cleanup --yes --execute then re-install
Re-installing after a botched try, want cached rebuildmxnode cleanup --yes --execute --keep-binaries
Just clearing workdirs to free disk, want same configmxnode cleanup --yes --execute --keep-config --keep-binaries
Stale inflight.toml blocking an upgradeDon’t use cleanup — the next upgrade auto-clears stale locks. See troubleshooting.