How do I prevent mist from ever downloading the blockchain?

I have a small HDD and can't afford the disk space.


Using parity

You can have parity emulate geth's IPC (ie, pretend to be geth), by running:

parity --light --geth

If you want to be lazy, you can add to your configuration file:

light = true
geth = true

Then start mist as:

mist  --syncmode light

If you get a blank screen when mist loads, see here.



Running geth --light will not download the blockchain, but instead query other nodes for any information contained in the blockchain.

It took me quite a bit of investigation to work out how to use mist with geth --light, but the answer is to first start geth:

geth --light

Then start mist, telling it to use the node in light mode:

mist  --syncmode light

You should be able to just run mist --node-light, but this issue is currently preventing it.

As a work-around for linux users, based on @pparent76's script, I came up with:

# Work around for issues:
# https://github.com/ethereum/mist/issues/2254
# https://github.com/ethereum/mist/issues/2372
# https://github.com/ethereum/mist/issues/2999
set -eu # For script robustness
geth=$(which geth)
mist=$(which mist) # Change to explicit path if you call this script "mist"

# Use pidof as procps' pgrep is broken:
# sleep 1& pgrep -ax '^sleep$' should return null
if ! geth_pid=$(pidof geth); then
  echo "Starting $geth."
  "$geth" --syncmode light &
  echo "Geth is already running with PID(s): $geth_pid"

if ! mist_pid=$(pidof mist); then
  echo "Starting $mist."
  "$mist" --light-node
  echo "Mist is already running with PID(s): $mist_pid"

Call the script "emist" so it doesn't recursively call itself :)

Bonus safety seatbelt:

Since geth doesn't support a startup file, you may want to ensure that geth will not start without using --light.

Ensure geth cannot create a lock file on the blockchain database:

rm -rf ~/.ethereum/geth/chaindata/ && mkdir -m 000 ~/.ethereum/geth/chaindata/

This will remove any already downloaded blockchain data, and recreate the directory without write permissions.

In Windows, you can remove the write permissions for the current user by right-clicking on the chaindata directory, selecting "Properties" then "Permissions" and unticking "write" permissions for the current user.

If I then try to run geth without --light, I get:

Fatal: Error starting protocol stack: open /home/ravi/.ethereum/geth/chaindata/LOCK: permission denied

This is desirable because it:

  • Prevents any blockchain download
  • Reminds me to run geth with --light
  • Ensures that I don't need clean up any partially downloaded blockchain data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.