l2

package
v0.0.0-...-eb934a0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConnectionTimeout        = 20 * time.Second
	DefaultConfDepth         uint64 = 20
	DefaultMaxBatchSize             = 50
)

Variables

This section is empty.

Functions

func HeadersByRange

func HeadersByRange(ctx context.Context, client *rpc.Client, startHeight uint64, count int) ([]*types.Header, error)

Types

type ConfirmedHeaderSelector

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

func NewConfirmedHeaderSelector

func NewConfirmedHeaderSelector(cfg HeaderSelectorConfig) (*ConfirmedHeaderSelector, error)

func (*ConfirmedHeaderSelector) NewHead

func (f *ConfirmedHeaderSelector) NewHead(
	ctx context.Context,
	lowest uint64,
	header *types.Header,
	client *rpc.Client,
) ([]*types.Header, error)

type HeaderSelectorConfig

type HeaderSelectorConfig struct {
	ConfDepth    uint64
	MaxBatchSize uint64
}

type IndexerStatus

type IndexerStatus struct {
	Synced  float64         `json:"synced"`
	Highest db.BlockLocator `json:"highest_block"`
}

type Service

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

func NewService

func NewService(cfg ServiceConfig) (*Service, error)

func (*Service) GetIndexerStatus

func (s *Service) GetIndexerStatus(w http.ResponseWriter, r *http.Request)

func (*Service) GetWithdrawalBatch

func (s *Service) GetWithdrawalBatch(w http.ResponseWriter, r *http.Request)

func (*Service) GetWithdrawals

func (s *Service) GetWithdrawals(w http.ResponseWriter, r *http.Request)

func (*Service) Start

func (s *Service) Start() error

func (*Service) Stop

func (s *Service) Stop()

func (*Service) Update

func (s *Service) Update(newHeader *types.Header) error

type ServiceConfig

type ServiceConfig struct {
	Context  context.Context
	Metrics  *metrics.Metrics
	L2RPC    *rpc.Client
	L2Client *ethclient.Client
	ChainID  *big.Int

	ConfDepth          uint64
	MaxHeaderBatchSize uint64
	StartBlockNumber   uint64
	DB                 *db.Database
	Bedrock            bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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