service

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 16 Imported by: 2

Documentation

Overview

Package service runs the scribe service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainIndexer

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

ChainIndexer is an indexer that fetches logs for a chain. It aggregates logs from a slice of ContractIndexers.

func NewChainIndexer

func NewChainIndexer(eventDB db.EventDB, client []backend.ScribeBackend, chainConfig config.ChainConfig, handler metrics.Handler) (*ChainIndexer, error)

NewChainIndexer creates a new indexer for a chain. This is done by passing through all the function parameters into the ChainIndexer struct, as well as iterating through all the contracts in the chain config & creating ContractIndexers for each contract.

func (*ChainIndexer) Index

func (c *ChainIndexer) Index(parentContext context.Context) error

Index iterates over each contract indexer and calls Index concurrently on each one. If `onlyOneBlock` is true, the indexer will only index the block at `currentBlock`.

func (*ChainIndexer) IndexToBlock

func (c *ChainIndexer) IndexToBlock(parentContext context.Context, configStart uint64, configEnd *uint64, indexer *indexer.Indexer) error

IndexToBlock takes a contract indexer and indexes a contract up until it reaches the livefill threshold. This function should be generally used for calling a indexer with a single contract.

type Scribe

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

Scribe is a live scribe that logs all event data.

func NewScribe

func NewScribe(eventDB db.EventDB, clients map[uint32][]backend.ScribeBackend, config config.Config, handler metrics.Handler) (*Scribe, error)

NewScribe creates a new scribe.

func (Scribe) Start

func (s Scribe) Start(ctx context.Context) error

Start starts the scribe. A chain indexer is spun up for each chain, and a indexer is spun up for each contract on that chain. There is an indexer for livefilling all contracts and indexer for livefilling at the tip as well.

Directories

Path Synopsis
Package indexer takes a range of blocks, fetches logs, gets txs, receipts, and block headers, and stores them.
Package indexer takes a range of blocks, fetches logs, gets txs, receipts, and block headers, and stores them.

Jump to

Keyboard shortcuts

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