blockmeta

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBlockNotFound = errors.New("block not found")

Functions

func GetStartBlock

func GetStartBlock(ctx context.Context, blockMetaStoreURL string, logger *zap.Logger, tracer logging.Tracer) (uint64, error)

Types

type Indexer

type Indexer struct {
	*shutter.Shutter
	// contains filtered or unexported fields
}

func NewIndexer

func NewIndexer(logger *zap.Logger, grpcListenAddr string, startBlockNum, stopBlockNum uint64, mergedBlocksStore dstore.Store, blockMetaStore *Store) *Indexer

func (*Indexer) Check

Check is basic GRPC Healthcheck

func (*Indexer) Launch

func (app *Indexer) Launch()

func (*Indexer) Watch

Watch is basic GRPC Healthcheck as a stream

type Store

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

func NewStore

func NewStore(metaDataStoreURL string, logger *zap.Logger, tracer logging.Tracer) (*Store, error)

func (*Store) GetBlockMetaByHash

func (s *Store) GetBlockMetaByHash(ctx context.Context, blockHash string) (*pbbstream.BlockMeta, error)

GetBlockMetaByHash returns the block meta for the given block hash. If the block hash cannot be found in the store, it returns ErrBlockNotFound.

func (*Store) GetBlockMetaByNumber

func (s *Store) GetBlockMetaByNumber(ctx context.Context, blockNum uint64) (*pbbstream.BlockMeta, error)

GetBlockMetaByNumber returns the block meta for the given block number. If the block number cannot be found in the store, it returns ErrBlockNotFound.

func (*Store) GetLastWrittenBlockNum

func (s *Store) GetLastWrittenBlockNum(ctx context.Context) (uint64, error)

func (*Store) WriteBlockMeta

func (s *Store) WriteBlockMeta(ctx context.Context, blockMeta *pbbstream.BlockMeta) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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