Search in sources :

Example 1 with CliqueBlockInterface

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);
}
Also used : PoaQueryServiceImpl(org.hyperledger.besu.consensus.common.PoaQueryServiceImpl) CliqueBlockInterface(org.hyperledger.besu.consensus.clique.CliqueBlockInterface) CliqueBlockInterface(org.hyperledger.besu.consensus.clique.CliqueBlockInterface) BlockInterface(org.hyperledger.besu.consensus.common.BlockInterface)

Example 2 with CliqueBlockInterface

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);
}
Also used : CliqueBlockInterface(org.hyperledger.besu.consensus.clique.CliqueBlockInterface) EpochManager(org.hyperledger.besu.consensus.common.EpochManager) CliqueContext(org.hyperledger.besu.consensus.clique.CliqueContext)

Example 3 with 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));
}
Also used : CliqueGetSignerMetrics(org.hyperledger.besu.consensus.clique.jsonrpc.methods.CliqueGetSignerMetrics) CliqueProposals(org.hyperledger.besu.consensus.clique.jsonrpc.methods.CliqueProposals) CliqueBlockInterface(org.hyperledger.besu.consensus.clique.CliqueBlockInterface) WorldStateArchive(org.hyperledger.besu.ethereum.worldstate.WorldStateArchive) BlockchainQueries(org.hyperledger.besu.ethereum.api.query.BlockchainQueries) Propose(org.hyperledger.besu.consensus.clique.jsonrpc.methods.Propose) Discard(org.hyperledger.besu.consensus.clique.jsonrpc.methods.Discard) MutableBlockchain(org.hyperledger.besu.ethereum.chain.MutableBlockchain) CliqueGetSigners(org.hyperledger.besu.consensus.clique.jsonrpc.methods.CliqueGetSigners) CliqueGetSignersAtHash(org.hyperledger.besu.consensus.clique.jsonrpc.methods.CliqueGetSignersAtHash) BlockValidatorProvider(org.hyperledger.besu.consensus.common.validator.blockbased.BlockValidatorProvider) ValidatorProvider(org.hyperledger.besu.consensus.common.validator.ValidatorProvider) CliqueContext(org.hyperledger.besu.consensus.clique.CliqueContext)

Aggregations

CliqueBlockInterface (org.hyperledger.besu.consensus.clique.CliqueBlockInterface)3 CliqueContext (org.hyperledger.besu.consensus.clique.CliqueContext)2 CliqueGetSignerMetrics (org.hyperledger.besu.consensus.clique.jsonrpc.methods.CliqueGetSignerMetrics)1 CliqueGetSigners (org.hyperledger.besu.consensus.clique.jsonrpc.methods.CliqueGetSigners)1 CliqueGetSignersAtHash (org.hyperledger.besu.consensus.clique.jsonrpc.methods.CliqueGetSignersAtHash)1 CliqueProposals (org.hyperledger.besu.consensus.clique.jsonrpc.methods.CliqueProposals)1 Discard (org.hyperledger.besu.consensus.clique.jsonrpc.methods.Discard)1 Propose (org.hyperledger.besu.consensus.clique.jsonrpc.methods.Propose)1 BlockInterface (org.hyperledger.besu.consensus.common.BlockInterface)1 EpochManager (org.hyperledger.besu.consensus.common.EpochManager)1 PoaQueryServiceImpl (org.hyperledger.besu.consensus.common.PoaQueryServiceImpl)1 ValidatorProvider (org.hyperledger.besu.consensus.common.validator.ValidatorProvider)1 BlockValidatorProvider (org.hyperledger.besu.consensus.common.validator.blockbased.BlockValidatorProvider)1 BlockchainQueries (org.hyperledger.besu.ethereum.api.query.BlockchainQueries)1 MutableBlockchain (org.hyperledger.besu.ethereum.chain.MutableBlockchain)1 WorldStateArchive (org.hyperledger.besu.ethereum.worldstate.WorldStateArchive)1