mapper

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	IndexCommit:       false,
	IndexHeader:       false,
	IndexCollections:  false,
	IndexGuarantees:   false,
	IndexTransactions: false,
	IndexResults:      false,
	IndexEvents:       false,
	IndexPayloads:     false,
	IndexSeals:        false,
	SkipBootstrap:     false,
}

DefaultConfig has the default values of the config set.

Functions

func WithIndexCollections

func WithIndexCollections(b bool) func(*Config)

WithIndexCollections sets up the mapper to build the collections index.

func WithIndexCommit

func WithIndexCommit(b bool) func(*Config)

WithIndexCommit sets up the mapper to build the commits index.

func WithIndexEvents

func WithIndexEvents(b bool) func(*Config)

WithIndexEvents sets up the mapper to build the events index.

func WithIndexGuarantees added in v1.1.0

func WithIndexGuarantees(b bool) func(*Config)

WithIndexGuarantees sets up the mapper to build the guarantees index.

func WithIndexHeader

func WithIndexHeader(b bool) func(*Config)

WithIndexHeader sets up the mapper to build the headers index.

func WithIndexPayloads

func WithIndexPayloads(b bool) func(*Config)

WithIndexPayloads sets up the mapper to build the payloads index.

func WithIndexResults added in v1.1.0

func WithIndexResults(b bool) func(*Config)

WithIndexResults sets up the mapper to build the transaction results index.

func WithIndexSeals added in v1.1.0

func WithIndexSeals(b bool) func(*Config)

WithIndexSeals sets up the mapper to build the seals index.

func WithIndexTransactions

func WithIndexTransactions(b bool) func(*Config)

WithIndexTransactions sets up the mapper to build the transactions index.

func WithSkipBootstrap

func WithSkipBootstrap(b bool) func(*Config)

WithSkipBootstrap sets the mapper up to skip indexing the registers from the initial checkpoint.

func WithTransition

func WithTransition(status Status, transition TransitionFunc) func(*FSM)

Types

type Config

type Config struct {
	IndexCommit       bool
	IndexHeader       bool
	IndexCollections  bool
	IndexGuarantees   bool
	IndexTransactions bool
	IndexResults      bool
	IndexEvents       bool
	IndexPayloads     bool
	IndexSeals        bool
	SkipBootstrap     bool
}

Config contains optional parameters for the mapper.

type FSM

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

func NewFSM

func NewFSM(state *State, options ...func(*FSM)) *FSM

func (*FSM) Run

func (f *FSM) Run() error

func (*FSM) Stop

func (f *FSM) Stop(ctx context.Context) error

type Feeder

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

type Forest

type Forest interface {
	Save(tree *trie.MTrie, paths []ledger.Path, parent flow.StateCommitment)
	Has(commit flow.StateCommitment) bool
	Tree(commit flow.StateCommitment) (*trie.MTrie, bool)
	Paths(commit flow.StateCommitment) ([]ledger.Path, bool)
	Parent(commit flow.StateCommitment) (flow.StateCommitment, bool)
	Reset(finalized flow.StateCommitment)
}

type Loader

type Loader interface {
	Checkpoint() (*trie.MTrie, error)
}

type State

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

func EmptyState

func EmptyState(forest Forest) *State

type Status

type Status uint8
const (
	StatusEmpty Status = iota + 1
	StatusUpdating
	StatusMatched
	StatusCollected
	StatusIndexed
	StatusForwarded
)

func (Status) String

func (s Status) String() string

type TransitionFunc

type TransitionFunc func(*State) error

type Transitions

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

func NewTransitions

func NewTransitions(log zerolog.Logger, load Loader, chain dps.Chain, feed Feeder, index dps.Writer, options ...func(*Config)) *Transitions

func (*Transitions) BootstrapState

func (t *Transitions) BootstrapState(s *State) error

func (*Transitions) CollectRegisters

func (t *Transitions) CollectRegisters(s *State) error

func (*Transitions) ForwardHeight

func (t *Transitions) ForwardHeight(s *State) error

func (*Transitions) IndexChain

func (t *Transitions) IndexChain(s *State) error

func (*Transitions) IndexRegisters

func (t *Transitions) IndexRegisters(s *State) error

func (*Transitions) UpdateTree

func (t *Transitions) UpdateTree(s *State) error

Jump to

Keyboard shortcuts

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