relay

package
v1.0.6-testnet Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TxnRelayer

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

TxnRelayer relays raw transaction by broadcasting to node pool of different regions to accelerate P2P diffusion.

func MustNewTxnRelayerFromViper

func MustNewTxnRelayerFromViper() *TxnRelayer

func NewTxnRelayer

func NewTxnRelayer(relayConf *TxnRelayerConfig) (*TxnRelayer, error)

func NewTxnRelayerFromViper

func NewTxnRelayerFromViper() (*TxnRelayer, error)

func (*TxnRelayer) AsyncRelay

func (relayer *TxnRelayer) AsyncRelay(signedTx hexutil.Bytes) bool

AsyncRelay relays raw transaction broadcasting asynchronously.

type TxnRelayerConfig

type TxnRelayerConfig struct {
	BufferSize     int           `default:"2000"`
	Concurrency    int           `default:"1"`
	Retry          int           `default:"3"`
	RetryInterval  time.Duration `default:"1s"`
	RequestTimeout time.Duration `default:"3s"`
	NodeUrls       []string
}

Jump to

Keyboard shortcuts

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