2

Running geth console with and without the --dev option seems to expose the same accounts.

Is it safe to use same accounts when developing? If not, what is the recommendation?

1 Answer 1

7

Q: Is it safe to use same accounts when developing?

No.

The amounts associated with the same account in Dev and Mainnet will be stored in their respective blockchains, so you won't lose any ethers.

However you will be using the same password in Dev as in Mainnet to unlock your accounts, and the use of your Mainnet password should be minimised.

Q: If not, what is the recommendation?

I would use the --dev with a different --datadir {devdatadir} to keep the Dev and Mainnet accounts separate, therefore reducing the risk of exposing my Mainnet account passwords.

Your Dev keystore will then be in {devdatadir}/keystore and this will be separate from your Mainnet accounts.

Here is my Dev startup script:

#!/bin/sh

geth --datadir ~/EtherDev/data --dev --nodiscover    \
  --mine --minerthreads 1 --maxpeers 0 --verbosity 3 \
  --unlock 0 --password ~/EtherDev/etc/passwordfile  \
  --rpc console

And here is the Dev script I use to create my passwords:

#!/bin/sh

mkdir ~/EtherDev/data
geth --datadir ~/EtherDev/data           \
  --password ~/EtherDev/etc/passwordfile \
  account new

And I just use a simple password in ~/EtherDev/etc/passwordfile.

2
  • 2
    To add to this great answer: they are deprecating the --dev option. The advice is to use a custom genesis block and data directory.
    – randomguy
    Commented May 25, 2016 at 8:12
  • 1
    Any idea why they are depreciating --dev? Seems like one of the reasons they created it was avoiding the hassle of custom genesis blocks. Commented Jun 1, 2016 at 7:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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