indexer

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountAggCreatorTaskName   = "AccountAggCreator"
	ValidatorAggCreatorTaskName = "ValidatorAggCreator"
)
View Source
const (
	IndexTargetBlockSequences = iota + 1
	IndexTargetValidatorSequences
	IndexTargetValidatorAggregates
	IndexTargetSystemEvents
)
View Source
const (
	BlockFetcherTaskName        = "BlockFetcher"
	StateFetcherTaskName        = "StateFetcher"
	StakingStateFetcherTaskName = "StakingStateFetcher"
	ValidatorFetcherTaskName    = "ValidatorFetcher"
	TransactionFetcherTaskName  = "TransactionFetcher"
)
View Source
const (
	BlockParserTaskName      = "BlockParser"
	ValidatorsParserTaskName = "ValidatorsParser"
)
View Source
const (
	SyncerPersistorTaskName       = "SyncerPersistor"
	BlockSeqPersistorTaskName     = "BlockSeqPersistor"
	ValidatorSeqPersistorTaskName = "ValidatorSeqPersistor"
	ValidatorAggPersistorTaskName = "ValidatorAggPersistor"
	SystemEventPersistorTaskName  = "SystemEventPersistor"
)
View Source
const (
	CtxReport = "context_report"

	StageAnalyzer = "AnalyzerStage"
)
View Source
const (
	BlockSeqCreatorTaskName               = "BlockSeqCreator"
	ValidatorSeqCreatorTaskName           = "ValidatorSeqCreator"
	TransactionSeqCreatorTaskName         = "TransactionSeqCreator"
	StakingSeqCreatorTaskName             = "StakingSeqCreator"
	DelegationSeqCreatorTaskName          = "DelegationSeqCreator"
	DebondingDelegationSeqCreatorTaskName = "DebondingDelegationSeqCreator"
)
View Source
const (
	HeightMetaRetrieverTaskName = "HeightMetaRetriever"
)
View Source
const (
	MainSyncerTaskName = "MainSyncer"
)
View Source
const (
	SystemEventCreatorTaskName = "SystemEventCreator"
)

Variables

View Source
var (
	ErrActiveEscrowBalanceOutsideOfRange = errors.New("active escrow balance is outside of specified buckets")
	ErrCommissionOutsideOfRange          = errors.New("commission is outside of specified buckets")

	MaxValidatorSequences int64 = 1000
	MissedForMaxThreshold int64 = 50
	MissedInRowThreshold  int64 = 50
)
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 (
	ErrAccountAggNotValid = errors.New("account aggregator not valid")
)
View Source
var (
	ErrNothingToProcess = errors.New("nothing to process")
)

Functions

func BlockToSequence

func BlockToSequence(syncable *model.Syncable, rawBlock *blockpb.Block, blockParsedData ParsedBlockData) (*model.BlockSeq, error)

func DebondingDelegationToSequence

func DebondingDelegationToSequence(syncable *model.Syncable, rawState *statepb.State) ([]model.DebondingDelegationSeq, error)

func DelegationToSequence

func DelegationToSequence(syncable *model.Syncable, rawState *statepb.State) ([]model.DelegationSeq, error)

func NewAccountAggCreatorTask

func NewAccountAggCreatorTask(db *store.Store) *accountAggCreatorTask

func NewBackfillSource added in v0.4.2

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

func NewBlockFetcherTask

func NewBlockFetcherTask(client *client.Client) pipeline.Task

func NewBlockParserTask added in v0.4.0

func NewBlockParserTask() *blockParserTask

func NewBlockSeqCreatorTask

func NewBlockSeqCreatorTask(db *store.Store) *blockSeqCreatorTask

func NewBlockSeqPersistorTask added in v0.4.2

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

func NewConfigParser added in v0.5.0

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

func NewDebondingDelegationsSeqCreatorTask

func NewDebondingDelegationsSeqCreatorTask(db *store.Store) *debondingDelegationSeqCreatorTask

func NewDelegationsSeqCreatorTask

func NewDelegationsSeqCreatorTask(db *store.Store) *delegationSeqCreatorTask

func NewHeightMetaRetrieverTask

func NewHeightMetaRetrieverTask(c *client.Client) pipeline.Task

func NewIndexSource added in v0.4.2

func NewIndexSource(cfg *config.Config, db *store.Store, client *client.Client, startHeight int64, batchSize int64) (*indexSource, error)

func NewLogger added in v0.4.2

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 *client.Client) (*indexingPipeline, error)

func NewSink

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

func NewStakingSeqCreatorTask

func NewStakingSeqCreatorTask(db *store.Store) *stakingSeqCreatorTask

func NewStakingStateFetcherTask added in v0.4.0

func NewStakingStateFetcherTask(client *client.Client) pipeline.Task

func NewStateFetcherTask

func NewStateFetcherTask(client *client.Client) pipeline.Task

func NewSyncerPersistorTask added in v0.4.2

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

func NewSystemEventCreatorTask added in v0.5.0

func NewSystemEventCreatorTask(cfg *config.Config, s SystemEventCreatorStore) *systemEventCreatorTask

NewSystemEventCreatorTask creates system events

func NewSystemEventPersistorTask added in v0.5.0

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

func NewTransactionFetcherTask

func NewTransactionFetcherTask(client *client.Client) pipeline.Task

func NewTransactionSeqCreatorTask

func NewTransactionSeqCreatorTask(db *store.Store) *transactionSeqCreatorTask

func NewValidatorAggCreatorTask

func NewValidatorAggCreatorTask(db *store.Store) *validatorAggCreatorTask

func NewValidatorAggPersistorTask added in v0.4.2

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

func NewValidatorFetcherTask

func NewValidatorFetcherTask(client *client.Client) pipeline.Task

func NewValidatorSeqCreatorTask

func NewValidatorSeqCreatorTask(db *store.Store) *validatorSeqCreatorTask

func NewValidatorSeqPersistorTask added in v0.4.2

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

func NewValidatorsParserTask added in v0.4.0

func NewValidatorsParserTask() *validatorsParserTask

func StakingToSequence

func StakingToSequence(syncable *model.Syncable, rawState *statepb.State) (*model.StakingSeq, error)

func TransactionToSequence

func TransactionToSequence(syncable *model.Syncable, rawTransactions []*transactionpb.Transaction) ([]model.TransactionSeq, error)

func ValidatorToSequence

func ValidatorToSequence(syncable *model.Syncable, rawValidators []*validatorpb.Validator, parsedValidators ParsedValidatorsData) ([]model.ValidatorSeq, error)

Types

type BackfillConfig added in v0.4.2

type BackfillConfig struct {
	Parallel bool
	Force    bool
}

type BlockFetcherTask

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

func (*BlockFetcherTask) GetName added in v0.4.0

func (t *BlockFetcherTask) GetName() string

func (*BlockFetcherTask) Run

type ConfigParser added in v0.5.0

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 {
	Height       int64
	Time         types.Time
	AppVersion   uint64
	BlockVersion uint64
}

type IndexConfig added in v0.5.0

type IndexConfig struct {
	StartHeight int64
	BatchSize   int64
}

type ParsedBlockData

type ParsedBlockData struct {
	TransactionsCount int64
	ProposerEntityUID string
}

type ParsedValidatorsData

type ParsedValidatorsData map[string]parsedValidator

type RunConfig added in v0.4.2

type RunConfig struct {
	Height           int64
	DesiredVersionID int64
	DesiredTargetID  int64
	Dry              bool
}

type StakingStateFetcherTask added in v0.4.0

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

func (*StakingStateFetcherTask) GetName added in v0.4.0

func (t *StakingStateFetcherTask) GetName() string

func (*StakingStateFetcherTask) Run added in v0.4.0

type StateFetcherTask

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

func (*StateFetcherTask) GetName added in v0.4.0

func (t *StateFetcherTask) GetName() string

func (*StateFetcherTask) Run

type SystemEventCreatorStore added in v0.5.0

type SystemEventCreatorStore interface {
	FindByHeight(int64) ([]model.ValidatorSeq, error)
	FindLastByAddress(string, int64) ([]model.ValidatorSeq, error)
}

type TransactionFetcherTask

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

func (*TransactionFetcherTask) GetName added in v0.4.0

func (t *TransactionFetcherTask) GetName() string

func (*TransactionFetcherTask) Run

type ValidatorFetcherTask

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

func (*ValidatorFetcherTask) GetName added in v0.4.0

func (t *ValidatorFetcherTask) GetName() string

func (*ValidatorFetcherTask) Run

Jump to

Keyboard shortcuts

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