Search in sources :

Example 1 with IbftGetValidatorsByBlockHash

use of org.hyperledger.besu.consensus.ibft.jsonrpc.methods.IbftGetValidatorsByBlockHash in project besu by hyperledger.

the class IbftJsonRpcMethods method create.

@Override
protected Map<String, JsonRpcMethod> create() {
    final MutableBlockchain blockchain = context.getBlockchain();
    final BlockchainQueries blockchainQueries = new BlockchainQueries(blockchain, context.getWorldStateArchive());
    final BftContext bftContext = context.getConsensusContext(BftContext.class);
    final BlockInterface blockInterface = bftContext.getBlockInterface();
    final ValidatorProvider validatorProvider = context.getConsensusContext(BftContext.class).getValidatorProvider();
    // Must create our own voteTallyCache as using this would pollute the main voteTallyCache
    final ValidatorProvider readOnlyValidatorProvider = createValidatorProvider(context, blockchain);
    return mapOf(new IbftProposeValidatorVote(validatorProvider), new IbftGetValidatorsByBlockNumber(blockchainQueries, blockInterface), new IbftDiscardValidatorVote(validatorProvider), new IbftGetValidatorsByBlockHash(blockchain, blockInterface), new IbftGetSignerMetrics(readOnlyValidatorProvider, blockInterface, blockchainQueries), new IbftGetPendingVotes(validatorProvider));
}
Also used : IbftGetPendingVotes(org.hyperledger.besu.consensus.ibft.jsonrpc.methods.IbftGetPendingVotes) IbftGetValidatorsByBlockHash(org.hyperledger.besu.consensus.ibft.jsonrpc.methods.IbftGetValidatorsByBlockHash) BftContext(org.hyperledger.besu.consensus.common.bft.BftContext) IbftGetValidatorsByBlockNumber(org.hyperledger.besu.consensus.ibft.jsonrpc.methods.IbftGetValidatorsByBlockNumber) IbftGetSignerMetrics(org.hyperledger.besu.consensus.ibft.jsonrpc.methods.IbftGetSignerMetrics) BlockchainQueries(org.hyperledger.besu.ethereum.api.query.BlockchainQueries) IbftProposeValidatorVote(org.hyperledger.besu.consensus.ibft.jsonrpc.methods.IbftProposeValidatorVote) IbftDiscardValidatorVote(org.hyperledger.besu.consensus.ibft.jsonrpc.methods.IbftDiscardValidatorVote) MutableBlockchain(org.hyperledger.besu.ethereum.chain.MutableBlockchain) BlockInterface(org.hyperledger.besu.consensus.common.BlockInterface) BftBlockInterface(org.hyperledger.besu.consensus.common.bft.BftBlockInterface) BlockValidatorProvider(org.hyperledger.besu.consensus.common.validator.blockbased.BlockValidatorProvider) ValidatorProvider(org.hyperledger.besu.consensus.common.validator.ValidatorProvider)

Aggregations

BlockInterface (org.hyperledger.besu.consensus.common.BlockInterface)1 BftBlockInterface (org.hyperledger.besu.consensus.common.bft.BftBlockInterface)1 BftContext (org.hyperledger.besu.consensus.common.bft.BftContext)1 ValidatorProvider (org.hyperledger.besu.consensus.common.validator.ValidatorProvider)1 BlockValidatorProvider (org.hyperledger.besu.consensus.common.validator.blockbased.BlockValidatorProvider)1 IbftDiscardValidatorVote (org.hyperledger.besu.consensus.ibft.jsonrpc.methods.IbftDiscardValidatorVote)1 IbftGetPendingVotes (org.hyperledger.besu.consensus.ibft.jsonrpc.methods.IbftGetPendingVotes)1 IbftGetSignerMetrics (org.hyperledger.besu.consensus.ibft.jsonrpc.methods.IbftGetSignerMetrics)1 IbftGetValidatorsByBlockHash (org.hyperledger.besu.consensus.ibft.jsonrpc.methods.IbftGetValidatorsByBlockHash)1 IbftGetValidatorsByBlockNumber (org.hyperledger.besu.consensus.ibft.jsonrpc.methods.IbftGetValidatorsByBlockNumber)1 IbftProposeValidatorVote (org.hyperledger.besu.consensus.ibft.jsonrpc.methods.IbftProposeValidatorVote)1 BlockchainQueries (org.hyperledger.besu.ethereum.api.query.BlockchainQueries)1 MutableBlockchain (org.hyperledger.besu.ethereum.chain.MutableBlockchain)1