Documentation ¶
Overview ¶
Package gossip implements simple protocol to send new validated messages to all peers and ignore old or not valid messages.
Index ¶
- type Protocol
- func (prot *Protocol) Broadcast(payload []byte, nextProt string) error
- func (prot *Protocol) Close()
- func (prot *Protocol) Relay(sender p2pcrypto.PublicKey, protocol string, msg service.Data) error
- func (prot *Protocol) SetPriority(protoName string, priority priorityq.Priority)
- func (prot *Protocol) Start()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Protocol ¶
Protocol runs the gossip protocol using the given peers and service.
func NewProtocol ¶
func NewProtocol(config config.SwarmConfig, base baseNetwork, localNodePubkey p2pcrypto.PublicKey, log2 log.Log) *Protocol
NewProtocol creates a new gossip protocol instance.
func (*Protocol) Broadcast ¶
Broadcast is the actual broadcast procedure - process the message internally and loop on peers and add the message to their queues
func (*Protocol) Relay ¶
Relay processes a message, if the message is new, it is passed for the protocol to validate and then propagated.
func (*Protocol) SetPriority ¶
SetPriority sets the priority for protoName in the queue.
Click to show internal directories.
Click to hide internal directories.