Documentation ¶
Index ¶
Constants ¶
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.