Search in sources :

Example 1 with DefaultBlockScheduler

use of org.hyperledger.besu.ethereum.blockcreation.DefaultBlockScheduler 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;
}
Also used : DefaultBlockScheduler(org.hyperledger.besu.ethereum.blockcreation.DefaultBlockScheduler) PoWMiningCoordinator(org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator) PoWMinerExecutor(org.hyperledger.besu.ethereum.blockcreation.PoWMinerExecutor)

Aggregations

DefaultBlockScheduler (org.hyperledger.besu.ethereum.blockcreation.DefaultBlockScheduler)1 PoWMinerExecutor (org.hyperledger.besu.ethereum.blockcreation.PoWMinerExecutor)1 PoWMiningCoordinator (org.hyperledger.besu.ethereum.blockcreation.PoWMiningCoordinator)1