broadcaster

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Broadcast

func Broadcast(ctx sdkClient.Context, txf tx.Factory, msgs []sdk.Msg) (*sdk.TxResponse, error)

Broadcast bundles the given messages into a single transaction and submits it to the blockchain. If there are more than one message, all messages must have the single same signer

Types

type Broadcaster

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

Broadcaster submits transactions to a tendermint node

func NewBroadcaster

func NewBroadcaster(txf tx.Factory, clientCtx sdkClient.Context, pipeline types.Pipeline, batchThreshold, batchSizeLimit int, logger log.Logger) *Broadcaster

NewBroadcaster returns a broadcaster to submit transactions to the blockchain. Only one instance of a broadcaster should be run for a given account, otherwise risk conflicting sequence numbers for submitted transactions.

func (*Broadcaster) Broadcast

func (b *Broadcaster) Broadcast(ctx context.Context, msgs ...sdk.Msg) (*sdk.TxResponse, error)

Broadcast queues up the given messages for broadcast to the network. This function in thread-safe, blocks until it gets a response.

type RefundableBroadcaster added in v0.14.0

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

RefundableBroadcaster only sends RefundMsgRequest msgs

func WithRefund added in v0.14.0

func WithRefund(b *Broadcaster) *RefundableBroadcaster

WithRefund wraps a broadcaster into a RefundableBroadcaster

func (*RefundableBroadcaster) Broadcast added in v0.14.0

func (b *RefundableBroadcaster) Broadcast(ctx context.Context, msgs ...sdk.Msg) (*sdk.TxResponse, error)

Broadcast wraps all given msgs into RefundMsgRequest msgs before broadcasting them

type RetryPipeline

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

RetryPipeline manages serialized execution of functions with retry on error

func NewPipelineWithRetry

func NewPipelineWithRetry(cap int, maxRetries int, backOffStrategy utils.BackOff, logger log.Logger) *RetryPipeline

NewPipelineWithRetry returns a retryPipeline with the given configuration

func (RetryPipeline) Close

func (p RetryPipeline) Close()

Close closes the retryPipeline

func (RetryPipeline) Push

func (p RetryPipeline) Push(f func() error, retryOnError func(error) bool) error

Push adds the given function to the serialized execution retryPipeline

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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