gossip

package
v0.0.0-...-bc2601f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ProtocolName = "/p2p/1.0/gossip"

Variables

This section is empty.

Functions

This section is empty.

Types

type Protocol

type Protocol struct {
	// contains filtered or unexported fields
}

Protocol is the gossip protocol

func NewProtocol

func NewProtocol(config config.SwarmConfig, base baseNetwork, signer signer) *Protocol

NewProtocol creates a new gossip protocol instance. Call Start to start reading peers

func (*Protocol) Broadcast

func (prot *Protocol) Broadcast(payload []byte, nextProt string) error

Broadcast is the actual broadcast procedure, loop on peers and add the message to their queues

func (*Protocol) Close

func (prot *Protocol) Close()

func (*Protocol) Start

func (prot *Protocol) Start()

Start a loop that process peers events

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL