Versions in this module Expand all Collapse all v0 v0.0.1 May 15, 2020 Changes in this version + type Data interface + Bytes func() []byte + type DataBytes struct + Payload []byte + func (m DataBytes) Bytes() []byte + type DataMsgWrapper struct + MsgType uint32 + Payload []byte + Req bool + ReqID uint64 + func (m DataMsgWrapper) Bytes() []byte + type DirectMessage interface + Bytes func() []byte + Metadata func() P2PMetadata + Sender func() p2pcrypto.PublicKey + type GossipMessage interface + Bytes func() []byte + ReportValidation func(protocol string) + Sender func() p2pcrypto.PublicKey + ValidationCompletedChan func() chan MessageValidation + type MessageValidation struct + func NewMessageValidation(sender p2pcrypto.PublicKey, msg []byte, prot string) MessageValidation + func (mv MessageValidation) Message() []byte + func (mv MessageValidation) Protocol() string + func (mv MessageValidation) Sender() p2pcrypto.PublicKey + type Node struct + func (sn *Node) Broadcast(protocol string, payload []byte) error + func (sn *Node) ProcessDirectProtocolMessage(sender p2pcrypto.PublicKey, protocol string, payload Data, ...) error + func (sn *Node) ProcessGossipProtocolMessage(sender p2pcrypto.PublicKey, protocol string, data Data, ...) error + func (sn *Node) RegisterDirectProtocol(protocol string) chan DirectMessage + func (sn *Node) RegisterDirectProtocolWithChannel(protocol string, ingressChannel chan DirectMessage) chan DirectMessage + func (sn *Node) RegisterGossipProtocol(protocol string, prio priorityq.Priority) chan GossipMessage + func (sn *Node) SendMessage(peerPubkey p2pcrypto.PublicKey, protocol string, payload []byte) error + func (sn *Node) SendWrappedMessage(nodeID p2pcrypto.PublicKey, protocol string, payload *DataMsgWrapper) error + func (sn *Node) Shutdown() + func (sn *Node) Start() error + func (sn *Node) SubscribePeerEvents() (conn chan p2pcrypto.PublicKey, disc chan p2pcrypto.PublicKey) + type P2PMetadata struct + FromAddress net.Addr + type Service interface + Broadcast func(protocol string, payload []byte) error + RegisterDirectProtocol func(protocol string) chan DirectMessage + RegisterGossipProtocol func(protocol string, prio priorityq.Priority) chan GossipMessage + Shutdown func() + Start func() error + SubscribePeerEvents func() (new chan p2pcrypto.PublicKey, del chan p2pcrypto.PublicKey) + type Simulator struct + func NewSimulator() *Simulator + func (s *Simulator) NewFaulty(isRandBehaviour bool, maxBroadcastDelaySec uint32, maxReceiveDelaySec uint32) *Node + func (s *Simulator) NewNode() *Node + func (s *Simulator) NewNodeFrom(n *node.Info) *Node + func (s *Simulator) SubscribeToPeerEvents(myid p2pcrypto.Key) (chan p2pcrypto.PublicKey, chan p2pcrypto.PublicKey)