indexer

package
v0.3.1-0...-ee1233d Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Layer1 = "l1"
	Layer2 = "l2"
)
View Source
var (
	ZeroAddress = common.HexToAddress("0x0000000000000000000000000000000000000000")
)

Functions

func InitFromConfig

func InitFromConfig(ctx context.Context, i *Indexer, cfg *Config) error

nolint: funlen

Types

type Config

type Config struct {
	// db configs
	DatabaseUsername        string
	DatabasePassword        string
	DatabaseName            string
	DatabaseHost            string
	DatabaseMaxIdleConns    uint64
	DatabaseMaxOpenConns    uint64
	DatabaseMaxConnLifetime uint64
	RPCUrl                  string
	MetricsHTTPPort         uint64
	ETHClientTimeout        uint64
	L1TaikoAddress          common.Address
	BridgeAddress           common.Address
	AssignmentHookAddress   common.Address
	SwapAddresses           []common.Address
	BlockBatchSize          uint64
	SubscriptionBackoff     uint64
	SyncMode                SyncMode
	WatchMode               WatchMode
	IndexNFTs               bool
	Layer                   string
	OpenDBFunc              func() (DB, error)
}

func NewConfigFromCliContext

func NewConfigFromCliContext(c *cli.Context) (*Config, error)

NewConfigFromCliContext creates a new config instance from command line flags.

type DB

type DB interface {
	DB() (*sql.DB, error)
	GormDB() *gorm.DB
}

type FilterFunc

type FilterFunc func(
	ctx context.Context,
	chainID *big.Int,
	indxr *Indexer,
	filterOpts *bind.FilterOpts,
) error

type Indexer

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

func (*Indexer) Close

func (indxr *Indexer) Close(ctx context.Context)

func (*Indexer) InitFromCli

func (indxr *Indexer) InitFromCli(ctx context.Context, c *cli.Context) error

func (*Indexer) Name

func (indxr *Indexer) Name() string

func (*Indexer) Start

func (indxr *Indexer) Start() error

type SyncMode

type SyncMode string
var (
	Sync   SyncMode = "sync"
	Resync SyncMode = "resync"
	Modes           = []SyncMode{Sync, Resync}
)

type WatchMode

type WatchMode string
var (
	Filter             WatchMode = "filter"
	Subscribe          WatchMode = "subscribe"
	FilterAndSubscribe WatchMode = "filter-and-subscribe"
	WatchModes                   = []WatchMode{Filter, Subscribe, FilterAndSubscribe}
)

Jump to

Keyboard shortcuts

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