safeclient

package
v0.0.0-...-ded9150 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BLOCK_CHUNK_SIZE   = 100
	BLOCK_MAX_RANGE    = 100
	LOG_RESUB_INTERVAL = 5 * time.Minute
	HEADER_TIMEOUT     = 30 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SafeClient

type SafeClient interface {
	eth.Client

	Close()
}

type SafeEthClient

type SafeEthClient struct {
	eth.Client
	// contains filtered or unexported fields
}

func NewSafeEthClient

func NewSafeEthClient(rpcUrl string, logger logging.Logger, opts ...SafeEthClientOption) (*SafeEthClient, error)

func (*SafeEthClient) Close

func (c *SafeEthClient) Close()

func (*SafeEthClient) GetClientAndVersion

func (c *SafeEthClient) GetClientAndVersion() (string, error)

func (*SafeEthClient) SubscribeFilterLogs

func (c *SafeEthClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)

func (*SafeEthClient) SubscribeNewHead

func (c *SafeEthClient) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error)

type SafeEthClientOption

type SafeEthClientOption func(*SafeEthClient)

func WithCustomCreateClient

func WithCustomCreateClient(createClient func(string, logging.Logger) (eth.Client, error)) SafeEthClientOption

func WithHeaderTimeout

func WithHeaderTimeout(timeout time.Duration) SafeEthClientOption

func WithInstrumentedCreateClient

func WithInstrumentedCreateClient(collector *rpccalls.Collector) SafeEthClientOption

func WithLogFilteringParams

func WithLogFilteringParams(chunkSize, maxRange uint64) SafeEthClientOption

func WithLogResubInterval

func WithLogResubInterval(interval time.Duration) SafeEthClientOption

type SafeSubscription

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

func NewSafeSubscription

func NewSafeSubscription(sub ethereum.Subscription) *SafeSubscription

func (*SafeSubscription) Err

func (s *SafeSubscription) Err() <-chan error

func (*SafeSubscription) SetUnderlyingSub

func (s *SafeSubscription) SetUnderlyingSub(sub ethereum.Subscription)

func (*SafeSubscription) Unsubscribe

func (s *SafeSubscription) Unsubscribe()

Directories

Path Synopsis
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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