Class GossipConsensusMessageCommunicator
An IConsensusMessageCommunicator implementation using Libplanet.Net.Consensus.GossipConsensusMessageCommunicator.Gossip.
Implements
Inherited Members
Namespace: Libplanet.Net.Consensus
Assembly: Libplanet.Net.dll
Syntax
public class GossipConsensusMessageCommunicator : IConsensusMessageCommunicator
Constructors
| Improve this Doc View SourceGossipConsensusMessageCommunicator(ITransport, ImmutableArray<BoundPeer>, ImmutableArray<BoundPeer>, Action<MessageContent>)
Initializes a new instance of the GossipConsensusMessageCommunicator class.
Declaration
public GossipConsensusMessageCommunicator(ITransport consensusTransport, ImmutableArray<BoundPeer> validatorPeers, ImmutableArray<BoundPeer> seedPeers, Action<MessageContent> processMessage)
Parameters
Type | Name | Description |
---|---|---|
ITransport | consensusTransport | An ITransport for sending the ConsensusMsgs to validators. |
ImmutableArray<BoundPeer> | validatorPeers | A list of validator's BoundPeer, including itself. |
ImmutableArray<BoundPeer> | seedPeers | A list of seed's BoundPeer. |
Action<MessageContent> | processMessage | Action to be called when receiving a new ConsensusMsg. |
Methods
| Improve this Doc View SourceOnStartHeight(Int64)
Method that will be called on the Start(BlockCommit) call.
Declaration
public void OnStartHeight(long height)
Parameters
Type | Name | Description |
---|---|---|
Int64 | height | Height to trigger this method. |
OnStartRound(Int32)
Method that will be called on the Libplanet.Net.Consensus.Context.StartRound(System.Int32) call.
Declaration
public void OnStartRound(int round)
Parameters
Type | Name | Description |
---|---|---|
Int32 | round | Round to trigger this method. |
PublishMessage(ConsensusMsg)
Publish given message
to peers.
Declaration
public void PublishMessage(ConsensusMsg message)
Parameters
Type | Name | Description |
---|---|---|
ConsensusMsg | message | ConsensusMsg to publish. |