Closed zilm13 closed 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
@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 atApplication.java
andPrivateMinerService.java
(116 - 119 lines). Also I appreciate any UX comments!