Search in sources :

Example 6 with BftsmartNodeSettings

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

the class BftsmartNodeServerFactory method getHashcode.

// compute hashcode for consensus nodes
private int getHashcode(NodeSettings[] nodeSettings) {
    int i = 0;
    NetworkAddress[] nodeAddrs = new NetworkAddress[nodeSettings.length];
    for (NodeSettings setting : nodeSettings) {
        nodeAddrs[i++] = ((BftsmartNodeSettings) setting).getNetworkAddress();
    }
    int hashCode = Arrays.hashCode(nodeAddrs);
    return hashCode;
}
Also used : NodeSettings(com.jd.blockchain.consensus.NodeSettings) BftsmartNodeSettings(com.jd.blockchain.consensus.bftsmart.BftsmartNodeSettings) NetworkAddress(utils.net.NetworkAddress)

Aggregations

BftsmartNodeSettings (com.jd.blockchain.consensus.bftsmart.BftsmartNodeSettings)6 NodeSettings (com.jd.blockchain.consensus.NodeSettings)5 HostsConfig (bftsmart.reconfiguration.util.HostsConfig)2 NodeNetwork (bftsmart.reconfiguration.views.NodeNetwork)2 BftsmartConsensusConfig (com.jd.blockchain.consensus.bftsmart.BftsmartConsensusConfig)2 BftsmartConsensusViewSettings (com.jd.blockchain.consensus.bftsmart.BftsmartConsensusViewSettings)2 BftsmartNodeConfig (com.jd.blockchain.consensus.bftsmart.BftsmartNodeConfig)2 ArrayList (java.util.ArrayList)2 NetworkAddress (utils.net.NetworkAddress)2 TOMConfiguration (bftsmart.reconfiguration.util.TOMConfiguration)1 MemoryBasedViewStorage (bftsmart.reconfiguration.views.MemoryBasedViewStorage)1 View (bftsmart.reconfiguration.views.View)1 ServiceProxy (bftsmart.tom.ServiceProxy)1 BftsmartNodeServer (com.jd.blockchain.consensus.bftsmart.service.BftsmartNodeServer)1 BftsmartServerSettingConfig (com.jd.blockchain.consensus.bftsmart.service.BftsmartServerSettingConfig)1 MsgQueueBlockConfig (com.jd.blockchain.consensus.mq.config.MsgQueueBlockConfig)1 MsgQueueConsensusConfig (com.jd.blockchain.consensus.mq.config.MsgQueueConsensusConfig)1 MsgQueueNetworkConfig (com.jd.blockchain.consensus.mq.config.MsgQueueNetworkConfig)1 MsgQueueNodeConfig (com.jd.blockchain.consensus.mq.config.MsgQueueNodeConfig)1 MsgQueueBlockSettings (com.jd.blockchain.consensus.mq.settings.MsgQueueBlockSettings)1