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?
Asked
Active
Viewed 145 times
2
jrbedard
- 524
- 1
- 6
- 15
Satoshi Nakanishi
- 5,749
- 7
- 38
- 57
1 Answers
2
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 isDEFAULT_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_COINBASEin 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_hexflag, 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.
Richard Horrocks
- 37,835
- 13
- 87
- 144