Documentation ¶
Index ¶
- Constants
- 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 ¶
View Source
const ProtocolName = "/p2p/1.0/gossip"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Protocol ¶
Protocol is the gossip protocol
func NewProtocol ¶
func NewProtocol(config config.SwarmConfig, base baseNetwork, localNodePubkey p2pcrypto.PublicKey, log2 log.Log) *Protocol
NewProtocol creates a new gossip protocol instance. Call Start to start reading peers
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) SetPriority ¶
Click to show internal directories.
Click to hide internal directories.