If I set up a development testnet on geth and start mining, what account number gets the rewards?

What command can I use to define the mining account?


geth --dev


geth --dev attach
> miner.start()

In console 1 I get messages like:

I0930 11:14:56.732449 miner/worker.go:339] ??  Mined block (#10 / 4486bfb7). Wait 5 blocks for confirmation 

Should the ?? be an address? What command can I use to define the mining account?


Shut down geth using Control-C for instance #1 and Control-D for instance #2.

Then type geth account new to create a new account. Enter in a passphrase that you will need to remember if you want to unlock the account.

Then restart geth and you should see your first account (or coinbase) listed.

  • For future readers; I also ran miner.setEtherbase("myaccount") - unsure if I needed to and can't tell now...
    – atomh33ls
    Sep 30 '16 at 12:01
  • Should not need to. Your etherbase is the first account listed in eth.accounts, i.e. eth.accounts[0]. If you want to set another account, you can use the miner.setEtherbase(...) command. You can also use the command line parameter --etherbase {account}. Sep 30 '16 at 12:06

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.