indexer

package
v0.0.0-...-385fed2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitFromConfig

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

InitFromConfig inits a new Indexer from a provided Config struct

Types

type BeaconClient

type BeaconClient struct {
	*http.Client
	// contains filtered or unexported fields
}

func NewBeaconClient

func NewBeaconClient(cfg *Config, timeout time.Duration) (*BeaconClient, error)

type BlobsResponse

type BlobsResponse struct {
	Data []struct {
		Index            string `json:"index"`
		Blob             string `json:"blob"`
		KzgCommitment    string `json:"kzg_commitment"`
		KzgCommitmentHex []byte `json:"-"`
	} `json:"data"`
}

type Config

type Config struct {
	StartingBlockID         *uint64
	RPCURL                  string
	BeaconURL               string
	ContractAddress         common.Address
	DatabaseUsername        string
	DatabasePassword        string
	DatabaseName            string
	DatabaseHost            string
	DatabaseMaxIdleConns    uint64
	DatabaseMaxOpenConns    uint64
	DatabaseMaxConnLifetime uint64
	BackOffMaxRetries       uint64
	BackOffRetryInterval    time.Duration
	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
}

DB is a local interface that lets us narrow down a database type for testing.

type GenesisResponse

type GenesisResponse struct {
	Data struct {
		GenesisTime string `json:"genesis_time"`
	} `json:"data"`
}

type GetSpecResponse

type GetSpecResponse struct {
	Data map[string]string `json:"data"`
}

type Indexer

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

Indexer struct holds the configuration and state for the Ethereum chain listener.

func (*Indexer) Close

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

func (*Indexer) InitFromCli

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

func (*Indexer) Name

func (i *Indexer) Name() string

func (*Indexer) Start

func (i *Indexer) Start() error

Jump to

Keyboard shortcuts

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