Documentation ¶
Index ¶
- type Local
- func (n *Local) AllPeers(validatorPk []byte) ([]string, error)
- func (n *Local) Broadcast(topicName []byte, signed *proto.SignedMessage) error
- func (n *Local) BroadcastDecided(topicName []byte, msg *proto.SignedMessage) error
- func (n *Local) BroadcastSignature(topicName []byte, msg *proto.SignedMessage) error
- func (n *Local) CopyWithLocalNodeID(id peer.ID) *Local
- func (n *Local) GetDecidedByRange(peerStr string, msg *network.SyncMessage) (*network.SyncMessage, error)
- func (n *Local) GetHighestDecidedInstance(peerStr string, msg *network.SyncMessage) (*network.SyncMessage, error)
- func (n *Local) IsSubscribeToValidatorNetwork(validatorPk *bls.PublicKey) bool
- func (n *Local) ReceivedDecidedChan() <-chan *proto.SignedMessage
- func (n *Local) ReceivedMsgChan() <-chan *proto.SignedMessage
- func (n *Local) ReceivedSignatureChan() <-chan *proto.SignedMessage
- func (n *Local) ReceivedSyncMsgChan() <-chan *network.SyncChanObj
- func (n *Local) RespondToGetDecidedByRange(stream network.SyncStream, msg *network.SyncMessage) error
- func (n *Local) RespondToHighestDecidedInstance(stream network.SyncStream, msg *network.SyncMessage) error
- func (n *Local) SubscribeToValidatorNetwork(validatorPk *bls.PublicKey) error
- type Stream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
Local implements network.Local interface
func NewLocalNetwork ¶
func NewLocalNetwork() *Local
NewLocalNetwork creates a new instance of a local network
func (*Local) Broadcast ¶
func (n *Local) Broadcast(topicName []byte, signed *proto.SignedMessage) error
Broadcast implements network.Local interface
func (*Local) BroadcastDecided ¶
func (n *Local) BroadcastDecided(topicName []byte, msg *proto.SignedMessage) error
BroadcastDecided broadcasts a decided instance with collected signatures
func (*Local) BroadcastSignature ¶
func (n *Local) BroadcastSignature(topicName []byte, msg *proto.SignedMessage) error
BroadcastSignature broadcasts the given signature for the given lambda
func (*Local) CopyWithLocalNodeID ¶
CopyWithLocalNodeID copies the local network instance and adds a unique node id to it this is used for peer specific messages like sync messages to identify each node
func (*Local) GetDecidedByRange ¶
func (n *Local) GetDecidedByRange(peerStr string, msg *network.SyncMessage) (*network.SyncMessage, error)
GetDecidedByRange returns a list of decided signed messages up to 25 in a batch.
func (*Local) GetHighestDecidedInstance ¶
func (n *Local) GetHighestDecidedInstance(peerStr string, msg *network.SyncMessage) (*network.SyncMessage, error)
GetHighestDecidedInstance sends a highest decided request to peers and returns answers. If peer list is nil, broadcasts to all.
func (*Local) IsSubscribeToValidatorNetwork ¶ added in v0.0.3
IsSubscribeToValidatorNetwork checks if there is a subscription to the validator topic
func (*Local) ReceivedDecidedChan ¶
func (n *Local) ReceivedDecidedChan() <-chan *proto.SignedMessage
ReceivedDecidedChan returns the channel for decided messages
func (*Local) ReceivedMsgChan ¶
func (n *Local) ReceivedMsgChan() <-chan *proto.SignedMessage
ReceivedMsgChan implements network.Local interface
func (*Local) ReceivedSignatureChan ¶
func (n *Local) ReceivedSignatureChan() <-chan *proto.SignedMessage
ReceivedSignatureChan returns the channel with signatures
func (*Local) ReceivedSyncMsgChan ¶
func (n *Local) ReceivedSyncMsgChan() <-chan *network.SyncChanObj
ReceivedSyncMsgChan returns the channel for sync messages
func (*Local) RespondToGetDecidedByRange ¶
func (n *Local) RespondToGetDecidedByRange(stream network.SyncStream, msg *network.SyncMessage) error
RespondToGetDecidedByRange responds to a GetDecidedByRange
func (*Local) RespondToHighestDecidedInstance ¶
func (n *Local) RespondToHighestDecidedInstance(stream network.SyncStream, msg *network.SyncMessage) error
RespondToHighestDecidedInstance responds to a GetHighestDecidedInstance
type Stream ¶
type Stream struct { From string To string ReceiveChan chan *network.SyncMessage }
Stream is used by local network
func NewLocalStream ¶
NewLocalStream returs a stream instance
func (*Stream) WriteSynMsg ¶
func (s *Stream) WriteSynMsg(msg *network.SyncMessage) (n int, err error)
WriteSynMsg implementation