indexer

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValidatorAggCreatorTaskName      = "ValidatorAggCreator"
	ValidatorGroupAggCreatorTaskName = "ValidatorGroupAggCreator"
)
View Source
const (
	TargetIndexBlockSequences = iota + 1
	TargetIndexValidatorSequences
	TargetIndexValidatorGroupSequences
	TargetIndexValidatorAggregates
	TargetIndexValidatorGroupAggregates
)
View Source
const (
	TaskNameBlockFetcher           = "BlockFetcher"
	TaskNameValidatorsFetcher      = "ValidatorsFetcher"
	TaskNameValidatorGroupsFetcher = "ValidatorGroupsFetcher"
)
View Source
const (
	SyncerPersistorTaskName            = "SyncerPersistor"
	BlockSeqPersistorTaskName          = "BlockSeqPersistor"
	ValidatorSeqPersistorTaskName      = "ValidatorSeqPersistor"
	ValidatorGroupSeqPersistorTaskName = "ValidatorGroupSeqPersistor"
	ValidatorAggPersistorTaskName      = "ValidatorAggPersistor"
	ValidatorGroupAggPersistorTaskName = "ValidatorGroupAggPersistor"
)
View Source
const (
	BlockSeqCreatorTaskName          = "BlockSeqCreator"
	ValidatorSeqCreatorTaskName      = "ValidatorSeqCreator"
	ValidatorGroupSeqCreatorTaskName = "ValidatorGroupSeqCreator"
)
View Source
const (
	CtxReport = "context_report"
)
View Source
const (
	MainSyncerTaskName = "MainSyncer"
)
View Source
const (
	TaskNameHeightMetaRetriever = "HeightMetaRetriever"
)

Variables

View Source
var (
	ErrBlockSequenceNotValid          = errors.New("block sequence not valid")
	ErrValidatorSequenceNotValid      = errors.New("validator sequence not valid")
	ErrValidatorGroupSequenceNotValid = errors.New("validator group sequence not valid")
)
View Source
var (
	ErrIsPristine          = errors.New("cannot run because database is empty")
	ErrIndexCannotBeRun    = errors.New("cannot run index process")
	ErrBackfillCannotBeRun = errors.New("cannot run backfill process")
)
View Source
var (
	ErrNothingToProcess = errors.New("nothing to process")
)

Functions

func NewBackfillSource

func NewBackfillSource(cfg *config.Config, db *store.Store, client client.Client, indexVersion int64) (*backfillSource, error)

func NewBlockFetcherTask

func NewBlockFetcherTask(client figmentclient.Client) pipeline.Task

func NewBlockSeqCreatorTask

func NewBlockSeqCreatorTask(db *store.Store) *blockSeqCreatorTask

NewBlockSeqCreatorTask creates block sequences

func NewBlockSeqPersistorTask

func NewBlockSeqPersistorTask(db *store.Store) pipeline.Task

NewBlockSeqPersistorTask is responsible for storing block to persistence layer

func NewConfigParser

func NewConfigParser(file string) (*configParser, error)

func NewHeightMetaRetrieverTask

func NewHeightMetaRetrieverTask(c figmentclient.Client) *heightMetaRetrieverTask

func NewIndexSource

func NewIndexSource(cfg *config.Config, db *store.Store, client figmentclient.Client, sourceCfg *IndexSourceConfig) (*indexSource, error)

func NewLogger

func NewLogger() pipeline.Logger

func NewMainSyncerTask

func NewMainSyncerTask(db *store.Store) pipeline.Task

func NewPayloadFactory

func NewPayloadFactory() *payloadFactory

func NewPipeline

func NewPipeline(cfg *config.Config, db *store.Store, client figmentclient.Client) (*indexingPipeline, error)

func NewSink

func NewSink(db *store.Store, versionNumber int64) *sink

func NewSyncerPersistorTask

func NewSyncerPersistorTask(db *store.Store) pipeline.Task

NewSyncerPersistorTask is responsible for storing syncable to persistence layer

func NewValidatorAggCreatorTask

func NewValidatorAggCreatorTask(db *store.Store) *validatorAggCreatorTask

func NewValidatorAggPersistorTask

func NewValidatorAggPersistorTask(db *store.Store) pipeline.Task

func NewValidatorFetcherTask

func NewValidatorFetcherTask(client figmentclient.Client) pipeline.Task

func NewValidatorGroupAggCreatorTask

func NewValidatorGroupAggCreatorTask(db *store.Store) *validatorGroupAggCreatorTask

func NewValidatorGroupAggPersistorTask

func NewValidatorGroupAggPersistorTask(db *store.Store) pipeline.Task

func NewValidatorGroupFetcherTask

func NewValidatorGroupFetcherTask(client figmentclient.Client) pipeline.Task

func NewValidatorGroupSeqCreatorTask

func NewValidatorGroupSeqCreatorTask(cfg *config.Config, db *store.Store) *validatorGroupSeqCreatorTask

NewValidatorGroupSeqCreatorTask creates validator era sequences

func NewValidatorGroupSeqPersistorTask

func NewValidatorGroupSeqPersistorTask(db *store.Store) pipeline.Task

NewValidatorGroupSeqPersistorTask is responsible for storing validator era info to persistence layer

func NewValidatorSeqCreatorTask

func NewValidatorSeqCreatorTask(cfg *config.Config, db *store.Store) *validatorSeqCreatorTask

NewValidatorSeqCreatorTask creates validator sequences

func NewValidatorSeqPersistorTask

func NewValidatorSeqPersistorTask(db *store.Store) pipeline.Task

NewValidatorSeqPersistorTask is responsible for storing validator info to persistence layer

func ToBlockSequence

func ToBlockSequence(syncable *model.Syncable, rawBlock *figmentclient.Block) (*model.BlockSeq, error)

func ToValidatorGroupSequence

func ToValidatorGroupSequence(syncable *model.Syncable, rawValidatorGroups []*figmentclient.ValidatorGroup) ([]model.ValidatorGroupSeq, error)

func ToValidatorSequence

func ToValidatorSequence(syncable *model.Syncable, rawValidatorPerformance []*figmentclient.Validator) ([]model.ValidatorSeq, error)

Types

type BackfillConfig

type BackfillConfig struct {
	Parallel  bool
	Force     bool
	TargetIds []int64
}

type BlockFetcherTask

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

func (*BlockFetcherTask) GetName

func (t *BlockFetcherTask) GetName() string

func (*BlockFetcherTask) Run

type ConfigParser

type ConfigParser interface {
	GetCurrentVersionId() int64
	GetAllVersionedVersionIds() []int64
	IsAnyVersionSequential(versionIds []int64) bool
	GetAllAvailableTasks() []pipeline.TaskName
	GetAllVersionedTasks() ([]pipeline.TaskName, error)
	GetTasksByVersionIds([]int64) ([]pipeline.TaskName, error)
	GetTasksByTargetIds([]int64) ([]pipeline.TaskName, error)
}

type HeightMeta

type HeightMeta struct {
	ChainId     uint64
	Height      int64
	Time        *types.Time
	Epoch       *int64
	LastInEpoch *bool
}

type IndexConfig

type IndexConfig struct {
	BatchSize   int64
	StartHeight int64
}

type IndexSourceConfig

type IndexSourceConfig struct {
	BatchSize   int64
	StartHeight int64
}

type PipelineSyncableStore

type PipelineSyncableStore interface {
	FindSmallestIndexVersion() (*int64, error)
}

type ReportStore

type ReportStore interface {
	FindNotCompletedByIndexVersion(int64, ...model.ReportKind) (*model.Report, error)
	Create(interface{}) error
	Save(interface{}) error
}

type RunConfig

type RunConfig struct {
	Height            int64
	DesiredVersionIDs []int64
	DesiredTargetIDs  []int64
	Dry               bool
}

type ValidatorGroupsFetcherTask

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

func (*ValidatorGroupsFetcherTask) GetName

func (t *ValidatorGroupsFetcherTask) GetName() string

func (*ValidatorGroupsFetcherTask) Run

type ValidatorsFetcherTask

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

func (*ValidatorsFetcherTask) GetName

func (t *ValidatorsFetcherTask) GetName() string

func (*ValidatorsFetcherTask) Run

Jump to

Keyboard shortcuts

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