ether-camp / ethereum-harmony

DEPRECATED! Ethereum Independent Peer
GNU General Public License v3.0
253 stars 89 forks source link

Added miner statuses #88

Closed zilm13 closed 6 years ago

zilm13 commented 6 years ago

@mkalinin we need to think out how to solve miner issue: EthereumJ is parsing configs on very early stage, after that BlockMiner @Autowired gets in and starts mining and generating dataset. So we have no simple way to add listener before dataset generation starts. Even if we have something on our side with @Autowired, not postInit like we have now, we couldn't guarantee order. So I've solved this issue in very stinky way: take a look at Application.java and PrivateMinerService.java (116 - 119 lines). Also I appreciate any UX comments!

mkalinin commented 6 years ago

The possible ways are: pass a list of pre-defined listeners to the miner constructor, probably listeners could be defined in a Spring config and overridden in the clients Spring configs; or start miner manually in case if sync is off, that is actually what you did. The problem is that user configures ethereumj directly, it would be less tricky if user configured Harmony in conf files and then Harmony would create ethereumj instance according to user needs. This is more about EthereumJ config issue. Generally I am ok with that PR, let's merge it