Lighthouse: .lighthouse is lighthouse-data when using docker

Created on 3 Aug 2020  路  10Comments  路  Source: sigp/lighthouse

Description

Currently, the book mentions .lighthouse as default for lots of things (validator dir etc...) but it turns out that if people are using the lighthouse-docker then their default directory will be lighthouse-data. This can be a little bit confusing, as new comers could think that they're doing something wrong etc.

This isn't mentioned in the usage section of the README.md.

Steps to resolve

I think mentioning this in the README section and adding a note the md-book would be sufficient. I, personally, looked at those places until I opened the docker-compose and noticed that it was actually the lighthouse-data :)

All 10 comments

Can add a PR for this one tonight or tomorrow (Paris Time) :)

Yes, I changed this. Previously the docker had it set to .lighthouse and was being created in the docker repo. Because it's hidden, makes it even more confusing and hard to find.

If you can redirect to ~/.lighthouse and update the README and book that might be the best way to go

It's an interesting point you made on the docker repo issue.
I'm not sure either how it would work for windows. I think there are current issues with windows using this docker-compose also.

I'll ping some others and see what their thoughts are. Maybe having a local DATA_DIR and making it obvious in the readme and associated docs might be the way to go, for maximal compatibility

What do you guys think @michaelsproul @paulhauner ?

If this is going to be merged sometime soon, what would be the migration path for users currently using the lighthouse-data directory? Is it a simple:

sudo mv ~/lighthouse-docker/lighthouse-data ~/.lighthouse

?

If this is going to be merged sometime soon, what would be the migration path for users currently using the lighthouse-data directory? Is it a simple:

sudo mv ~/lighthouse-docker/lighthouse-data ~/.lighthouse

?

Basically yes. Although not everyone has their lighthouse-docker located in their home directory :)

Is it worth doing this when we are between testnets so that users do not need to worry about moving their directories as they'd need to be deleted anyway?

I personally prefer a visible mount when using docker (that's what I did for my dodgy manual setup that ends up being similar to the docker-compose), but there's the existing Eth1 ~/.ethereum convention and agree it can be confusing to have inconsistency between docker and non-docker setups (even if documenting it carefully!)

Perhaps can take inspiration from geth regarding a default data location based on the platform:
https://geth.ethereum.org/docs/install-and-build/backup-restore

Also with docker, I kinda prefer that docker related mounts are kept isolated within the repo directory, rather than jumping out to the host machine's $HOME.
Might also be reasonable to set it via an environment variable.

Just my 2 cents :slightly_smiling_face:

I tend to agree. And have thought about this a little more.

The current docker set up runs as root. So setting the data directory to ~/.lighthouse could cause a number of issues with users running docker and non-docker set ups. If the docker is ran first, it creates root-owned folders preventing non-docker lighthouse accessing the default data dir.

If non-docker users ran first, then the docker-setup could inadvertently be using the wrong db on the wrong testnet.

I think the best way forward here, is to continue to use the lighthouse-data directory and update all associated documentation so that it is more clear.

@pscott what do you think? Maybe we could also rename it to be something more obvious

I think lighthouse-data is pretty obvious, and this solution is the one I made when I initially created this issue.

After re-reading the book, I've noticed it's actually mentioned. I think making it more obvious / clear to the reader is the way to go :)

Going to consider this closed.

Was this page helpful?
0 / 5 - 0 ratings