indexer

package
v0.0.0-...-ddeaac2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: CC0-1.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGenesisBlock        = 9820210
	DefaultKeepFiles           = false
	DefaultForceReindex        = false
	DefaultFromBlock           = DefaultGenesisBlock
	DefaultToBlock             = 0
	DefaultSubFolderBatchSize  = 10000
	DefaultRetryCountOnFailure = 10
	DefaultWaitForBlockMs      = 500
	DefaultSourceFolder        = "/tmp/relayer/json/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	KeepFiles           bool   `mapstructure:"keepFiles"`
	ForceReindex        bool   `mapstructure:"forceReindex"`
	RetryCountOnFailure uint8  `mapstructure:"retryCountOnFailure"`
	SubFolderBatchSize  uint16 `mapstructure:"subFolderBatchSize"`
	GenesisBlock        uint64 `mapstructure:"genesisBlock"`
	FromBlock           uint64 `mapstructure:"fromBlock"`
	ToBlock             uint64 `mapstructure:"toBlock"`
	SourceFolder        string `mapstructure:"sourceFolder"`
	WaitForBlockMs      uint16 `mapstructure:"waitForBlockMs"`
}

func GetConfig

func GetConfig() *Config

type Indexer

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

func New

func New(dbh db.Handler) (*Indexer, error)

New creates the indexer, the db.Handler should not be nil

func NewWithBroker

func NewWithBroker(dbh db.Handler, b broker.Broker) (*Indexer, error)

NewWithBroker is same as New but also sets broker for indexer. Both db.Handler and broker.Broker should not be nil. Initialize indexer with broker only if the JSON-RPC server supports subscription, otherwise use New instead.

func (*Indexer) Close

func (i *Indexer) Close()

Close gracefully stops indexer state machine

func (*Indexer) Start

func (i *Indexer) Start()

Start indexer state machine as a goroutine, if it's not already started.

Jump to

Keyboard shortcuts

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