mapper

package
v0.0.0-...-9ae4c5c Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCheckpointFile

func WithCheckpointFile(file string) func(*MapperConfig)

WithCheckpointFile will initialize the mapper's internal trie with the trie from the provided checkpoint file.

Types

type Chain

type Chain interface {
	Root() (uint64, error)
	Header(height uint64) (*flow.Header, error)
	Commit(height uint64) (flow.StateCommitment, error)
	Events(height uint64) ([]flow.Event, error)
}

type Feeder

type Feeder interface {
	Update() (*ledger.TrieUpdate, error)
}

type Mapper

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

func New

func New(log zerolog.Logger, chain Chain, feed Feeder, index dps.Index, options ...func(*MapperConfig)) (*Mapper, error)

New creates a new mapper that uses chain data to map trie updates to blocks and then passes on the details to the indexer for indexing.

func (*Mapper) Run

func (m *Mapper) Run() error

func (*Mapper) Stop

func (m *Mapper) Stop(ctx context.Context) error

type MapperConfig

type MapperConfig struct {
	CheckpointFile string
}

MapperOptions contains optional parameters we can set for the mapper.

type Step

type Step struct {
	Commit flow.StateCommitment
	Paths  []ledger.Path
	Tree   *trie.MTrie
}

Jump to

Keyboard shortcuts

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