Search in sources :

Example 1 with ConsensusViewSettings

use of com.jd.blockchain.consensus.ConsensusViewSettings in project jdchain-core by blockchain-jd-com.

the class LedgerInitConfiguration method createConsensusConfig.

private static ConsensusConfig createConsensusConfig(LedgerInitProperties initProps) {
    ConsensusProvider consensusProvider = ConsensusProviders.getProvider(initProps.getConsensusProvider());
    Properties csProps = initProps.getConsensusConfig();
    ConsensusViewSettings protocolSettings = consensusProvider.getSettingsFactory().getConsensusSettingsBuilder().createSettings(csProps, ParticipantReplica.wrap(initProps.getConsensusParticipantNodes()));
    ConsensusConfig config = new ConsensusConfig();
    config.setProvider(consensusProvider);
    config.setProtocolSettings(protocolSettings);
    return config;
}
Also used : ConsensusViewSettings(com.jd.blockchain.consensus.ConsensusViewSettings) ConsensusProvider(com.jd.blockchain.consensus.ConsensusProvider) LedgerInitProperties(com.jd.blockchain.ledger.LedgerInitProperties) ParticipantProperties(com.jd.blockchain.ledger.LedgerInitProperties.ParticipantProperties) Properties(java.util.Properties) CryptoProperties(com.jd.blockchain.ledger.LedgerInitProperties.CryptoProperties)

Aggregations

ConsensusProvider (com.jd.blockchain.consensus.ConsensusProvider)1 ConsensusViewSettings (com.jd.blockchain.consensus.ConsensusViewSettings)1 LedgerInitProperties (com.jd.blockchain.ledger.LedgerInitProperties)1 CryptoProperties (com.jd.blockchain.ledger.LedgerInitProperties.CryptoProperties)1 ParticipantProperties (com.jd.blockchain.ledger.LedgerInitProperties.ParticipantProperties)1 Properties (java.util.Properties)1