I want to change etherbase in pyethapp, but couldn't find something like setEtherbase in geth. How can I change etherbase (coinbase or eth.coinbase) in pyethapp?


From the code:

The coinbase address is given by the config field pow.coinbase_hex. If this does not exist or is None, the address of the first account is used instead. If there are no accounts, the coinbase is DEFAULT_COINBASE.

For reference, DEFAULT_COINBASE is defined in that file as:

DEFAULT_COINBASE = 'de0b295669a9fd93d5f28d9ec85e40f4cb697bae'.decode('hex')

You have a several options:

  • If you have no accounts created in this instantiation of Pyethapp - nor intend to create any in future - you could redefine DEFAULT_COINBASE in your copy of the code. Probably not the best idea, because you're bound to want to explicitly create accounts at some point...
  • If you haven't set that config variable, then you're just using the first account you created as your coinbase. Removing that account will shuffle everything up one, meaning the second account becomes the new coinbase, etc...
  • If you want to explicitly configure the coinbase using the coinbase_hex flag, you'll need to follow the configuration instructions on the Pyethapp wiki pages: https://github.com/ethereum/pyethapp/wiki/Configuring-and-Logging#command-line-options

As always, make sure your keystore is backed up before playing around with anything.

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.