Documentation ¶
Index ¶
- func Broadcast(ctx sdkClient.Context, txBytes []byte, options ...BroadcasterOption) (*sdk.TxResponse, error)
- func PrepareTx(ctx sdkClient.Context, txf tx.Factory, msgs ...sdk.Msg) ([]byte, error)
- type Broadcaster
- func Batched(broadcaster Broadcaster, batchThreshold, batchSizeLimit int) Broadcaster
- func SuppressExecutionErrs(broadcaster Broadcaster) Broadcaster
- func WithRefund(b Broadcaster) Broadcaster
- func WithRetry(broadcaster Broadcaster, maxRetries int, minSleep time.Duration) Broadcaster
- func WithStateManager(clientCtx sdkClient.Context, txf tx.Factory, options ...BroadcasterOption) Broadcaster
- type BroadcasterOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Broadcast ¶
func Broadcast(ctx sdkClient.Context, txBytes []byte, options ...BroadcasterOption) (*sdk.TxResponse, error)
Broadcast sends the given tx to the blockchain and blocks until it is added to a block (or timeout).
Types ¶
type Broadcaster ¶
type Broadcaster interface {
Broadcast(ctx context.Context, msgs ...sdk.Msg) (*sdk.TxResponse, error)
}
Broadcaster broadcasts msgs to the blockchain
func Batched ¶
func Batched(broadcaster Broadcaster, batchThreshold, batchSizeLimit int) Broadcaster
Batched returns a broadcaster that batches msgs together if there is high traffic to increase throughput
func SuppressExecutionErrs ¶
func SuppressExecutionErrs(broadcaster Broadcaster) Broadcaster
SuppressExecutionErrs logs errors when msg executions fail and then suppresses them
func WithRefund ¶
func WithRefund(b Broadcaster) Broadcaster
WithRefund wraps a broadcaster into a refundableBroadcaster
func WithRetry ¶
func WithRetry(broadcaster Broadcaster, maxRetries int, minSleep time.Duration) Broadcaster
WithRetry returns a broadcaster that retries the broadcast up to the given number of times if the broadcast fails
func WithStateManager ¶
func WithStateManager(clientCtx sdkClient.Context, txf tx.Factory, options ...BroadcasterOption) Broadcaster
WithStateManager tracks sequence numbers, so it can be used to broadcast consecutive txs
type BroadcasterOption ¶
type BroadcasterOption func(broadcaster broadcastParams) broadcastParams
BroadcasterOption modifies broadcaster behaviour
func WithPollingInterval ¶
func WithPollingInterval(interval time.Duration) BroadcasterOption
WithPollingInterval modifies how often the broadcaster checks the blockchain for tx responses
func WithResponseTimeout ¶
func WithResponseTimeout(timeout time.Duration) BroadcasterOption
WithResponseTimeout sets the time to wait for a tx response