use of org.hyperledger.besu.consensus.clique.CliqueBlockInterface in project besu by hyperledger.
the class CliqueQueryPluginServiceFactory method appendPluginServices.
@Override
public void appendPluginServices(final BesuPluginContextImpl besuContext) {
final BlockInterface blockInterface = new CliqueBlockInterface();
final PoaQueryServiceImpl service = new PoaQueryServiceImpl(blockInterface, blockchain, nodeKey);
besuContext.addService(PoaQueryService.class, service);
besuContext.addService(PoAMetricsService.class, service);
}
use of org.hyperledger.besu.consensus.clique.CliqueBlockInterface in project besu by hyperledger.
the class CliqueJsonRpcMethods method createValidatorProvider.
private ValidatorProvider createValidatorProvider(final ProtocolContext context, final MutableBlockchain blockchain) {
final EpochManager epochManager = context.getConsensusContext(CliqueContext.class).getEpochManager();
final CliqueBlockInterface cliqueBlockInterface = new CliqueBlockInterface();
return BlockValidatorProvider.nonForkingValidatorProvider(blockchain, epochManager, cliqueBlockInterface);
}
use of org.hyperledger.besu.consensus.clique.CliqueBlockInterface in project besu by hyperledger.
the class CliqueJsonRpcMethods method create.
@Override
protected Map<String, JsonRpcMethod> create() {
final MutableBlockchain blockchain = context.getBlockchain();
final WorldStateArchive worldStateArchive = context.getWorldStateArchive();
final BlockchainQueries blockchainQueries = new BlockchainQueries(blockchain, worldStateArchive);
final ValidatorProvider validatorProvider = context.getConsensusContext(CliqueContext.class).getValidatorProvider();
// Must create our own voteTallyCache as using this would pollute the main voteTallyCache
final ValidatorProvider readOnlyValidatorProvider = createValidatorProvider(context, blockchain);
return mapOf(new CliqueGetSigners(blockchainQueries, readOnlyValidatorProvider), new CliqueGetSignersAtHash(blockchainQueries, readOnlyValidatorProvider), new Propose(validatorProvider), new Discard(validatorProvider), new CliqueProposals(validatorProvider), new CliqueGetSignerMetrics(readOnlyValidatorProvider, new CliqueBlockInterface(), blockchainQueries));
}
Aggregations