21

I have several accounts I've created in the Geth console using:

personal.newAccount()

I no longer use (nor have any intention of using) the first couple of accounts I created, meaning whenever I reference an active account I have to set the account array index to something other than 0.

How do I remove the unused accounts so I can just reference my active account using eth.accounts[0]?

q9f
  • 32,913
  • 47
  • 156
  • 395
Richard Horrocks
  • 37,835
  • 13
  • 87
  • 144
  • I cannot access the keystore files on Ubuntu. When I type $ geth account list it gives me a list of accounts and the directory of these keystore files but I cannot find this folder anywhere on this machine. Can someone please help and tell me how to access the keystore files? I am new to linux and feel that it has to do with permissions.. – David Alford Jun 24 '17 at 01:39

2 Answers2

20

You can't remove account. You need to remove them directly from your keystore folder.

IT IS IRREVERSIBLE.

~/Library/Ethereum/keystore

I feel the need to repeat that once the file is deleted it's Game over.

jayD
  • 2,462
  • 2
  • 14
  • 25
  • 1
    This removes the reference to those accounts in eth.accounts, but how does eth.coinbase get updated? (It's now pointing to one of the deleted accounts.) – Richard Horrocks Feb 12 '16 at 19:21
  • next account in line should become eth.accounts[0]. What do you get ? – jayD Feb 12 '16 at 19:36
  • Yep, correct - the accounts entries have shuffled up, which is great. But the eth.coinbase variable hasn't updated and now points to the original account[0], which was deleted, and not the new one. – Richard Horrocks Feb 12 '16 at 19:39
  • 1
    Are you trying to mine ? geth -mine --etherbase "youraccountaddress".

    Also you might want to try geth account update "address"

    – jayD Feb 12 '16 at 19:40
  • 1
    Not on this box, but I wanted to know for future reference. I've found the command required for setting it: web3.miner.setEtherbase(web3.eth.accounts[0]) – Richard Horrocks Feb 12 '16 at 19:42
2

for testnet it's in ~/Library/Ethereum/testnet/keystore

smatthewenglish
  • 921
  • 7
  • 21