use of org.hyperledger.besu.ethereum.blockcreation.PoWMinerExecutor in project besu by hyperledger.
the class MainnetBesuControllerBuilder method createMiningCoordinator.
@Override
protected MiningCoordinator createMiningCoordinator(final ProtocolSchedule protocolSchedule, final ProtocolContext protocolContext, final TransactionPool transactionPool, final MiningParameters miningParameters, final SyncState syncState, final EthProtocolManager ethProtocolManager) {
final PoWMinerExecutor executor = new PoWMinerExecutor(protocolContext, protocolSchedule, transactionPool.getPendingTransactions(), miningParameters, new DefaultBlockScheduler(MainnetBlockHeaderValidator.MINIMUM_SECONDS_SINCE_PARENT, MainnetBlockHeaderValidator.TIMESTAMP_TOLERANCE_S, clock), epochCalculator, miningParameters.getPowJobTimeToLive(), miningParameters.getMaxOmmerDepth());
final PoWMiningCoordinator miningCoordinator = new PoWMiningCoordinator(protocolContext.getBlockchain(), executor, syncState, miningParameters.getRemoteSealersLimit(), miningParameters.getRemoteSealersTimeToLive());
miningCoordinator.addMinedBlockObserver(ethProtocolManager);
miningCoordinator.setStratumMiningEnabled(miningParameters.isStratumMiningEnabled());
if (miningParameters.isMiningEnabled()) {
miningCoordinator.enable();
}
return miningCoordinator;
}
Aggregations