backup

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBatchSize = 1000

Variables

This section is empty.

Functions

func ValidateConfig

func ValidateConfig(cfg Config) error

ValidateConfig validates the base backup configuration

Types

type Config

type Config struct {
	ToBlock   *uint64 // the right bound for the block range; latest if not specified
	FromBlock uint64  // the left bound for the block range

	Watch        bool // flag indicating if incoming tx data should be backed up
	SkipFailedTx bool // flag indicating if failed txs should be ignored
}

Config is the base chain backup configuration

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default backup configuration

type Option

type Option func(s *Service)

func WithBatchSize added in v0.5.0

func WithBatchSize(size uint) Option

WithBatchSize specifies the number of requests to batch

func WithLogger

func WithLogger(l log.Logger) Option

WithLogger specifies the logger for the backup service

func WithSkipFailedTxs added in v0.5.0

func WithSkipFailedTxs(skip bool) Option

WithSkipFailedTxs specifies if failed txs should be backed up

type Service

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

Service is the chain backup service

func NewService

func NewService(client client.Client, writer writer.Writer, opts ...Option) *Service

NewService creates a new backup service

func (*Service) ExecuteBackup

func (s *Service) ExecuteBackup(ctx context.Context, cfg Config) error

ExecuteBackup executes the node backup process

Directories

Path Synopsis
rpc

Jump to

Keyboard shortcuts

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