broadcaster

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConnTimeout      = 10 * time.Second
	DefaultBroadcastTimeout = 30 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Broadcaster

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

Broadcaster is responsible for broadcasting proofs to a list of Spacemesh-compatible gateway nodes.

func New

func New(gatewayAddresses []string, disableBroadcast bool, connTimeout time.Duration, connAcksThreshold uint, broadcastTimeout time.Duration, broadcastAcksThreshold uint) (*Broadcaster, error)

New instantiate a new Broadcaster for a given list of gateway nodes addresses. disableBroadcast allows to create a disabled Broadcaster instance. connTimeout set the timeout per gRPC connection attempt to a node. connAcksThreshold set the lower-bound of required successful gRPC connections to the nodes. If not met, an error will be returned. broadcastTimeout set the timeout per proof broadcast. broadcastAcksThreshold set the lower-bound of required successful proof broadcasts. If not met, a warning will be logged.

func (*Broadcaster) BroadcastProof

func (b *Broadcaster) BroadcastProof(msg []byte, roundID string, members [][]byte) error

BroadcastProof broadcasts a serialized proof of a given round.

Jump to

Keyboard shortcuts

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