broadcaster

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package broadcaster contains code for interacting with the scorum blockchain.

Index

Constants

This section is empty.

Variables

View Source
var ErrTxInMempoolCache = errors.New("tx is already in mempool cache")

ErrTxInMempoolCache is returned when tx is already broadcast and exists in mempool cache.

Functions

func New

func New(cfg Config) (*broadcaster, error)

New returns new instance of broadcaster

Types

type Broadcaster

type Broadcaster interface {
	// From returns address of broadcaster.
	From() sdk.AccAddress
	// GetHeight returns current height.
	GetHeight(ctx context.Context) (uint64, error)
	// BroadcastMsg broadcasts alone message.
	BroadcastMsg(msg sdk.Msg, memo string) (*sdk.TxResponse, error)
	// Broadcast broadcasts messages.
	Broadcast(msgs []sdk.Msg, memo string) (*sdk.TxResponse, error)

	// PingContext pings node.
	PingContext(ctx context.Context) error
}

Broadcaster provides functionality to broadcast messages to cosmos based blockchain node.

type Config

type Config struct {
	Client *http.Client

	KeyringRootDir     string
	KeyringBackend     string
	KeyringPromptInput string

	NodeURI       string
	BroadcastMode string

	WaitBlock              bool
	WaitBlockRetriesCount  int
	WaitBlockRetryInterval time.Duration

	From    string
	ChainID string

	Fees      sdk.Coins
	Gas       uint64
	GasAdjust float64
}

Config ...

Jump to

Keyboard shortcuts

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