store

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("record not found")
)

Functions

This section is empty.

Types

type AccountEraSeq added in v0.4.5

type AccountEraSeq interface {
	BulkUpsert(records []model.AccountEraSeq) error
	FindByEra(era int64) ([]model.AccountEraSeq, error)
	FindLastByStashAccount(stashAccount string) ([]model.AccountEraSeq, error)
	FindLastByValidatorStashAccount(validatorStashAccount string) ([]model.AccountEraSeq, error)
	GetAllByTime(stash string, start, end types.Time) ([]model.AccountEraSeq, error)
}

type Accounts added in v0.4.5

type Accounts interface {
	AccountEraSeq
}

type ActivityPeriodRow

type ActivityPeriodRow struct {
	Period int64
	Min    types.Time
	Max    types.Time
}

type BlockSeq added in v0.4.5

type BlockSeq interface {
	CreateSeq(*model.BlockSeq) error
	DeleteSeqOlderThan(purgeThreshold time.Time, activityPeriods []ActivityPeriodRow) (*int64, error)
	FindSeqByHeight(height int64) (*model.BlockSeq, error)
	// FindByID(id int64) (*model.BlockSeq, error)
	FindMostRecentSeq() (*model.BlockSeq, error)
	GetAvgRecentTimes(limit int64) GetAvgRecentTimesResult
	SaveSeq(*model.BlockSeq) error
	Summarize(interval types.SummaryInterval, activityPeriods []ActivityPeriodRow) ([]model.BlockSeqSummary, error)
}

type BlockSummary added in v0.4.5

type BlockSummary interface {
	CreateSummary(val *model.BlockSummary) error
	DeleteOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)
	FindSummary(query *model.BlockSummary) (*model.BlockSummary, error)
	FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]ActivityPeriodRow, error)
	FindMostRecentSummary() (*model.BlockSummary, error)
	FindMostRecentByInterval(interval types.SummaryInterval) (*model.BlockSummary, error)
	FindSummaries(interval types.SummaryInterval, period string) ([]model.BlockSummary, error)
	SaveSummary(val *model.BlockSummary) error
}

type Blocks added in v0.4.5

type Blocks interface {
	BlockSeq
	BlockSummary
}

type Database added in v0.4.5

type Database interface {
	GetTotalSize() (*GetTotalSizeResult, error)
}

type EventSeq added in v0.4.5

type EventSeq interface {
	BulkUpsert(records []model.EventSeq) error
	FindByHeightAndIndex(height int64, index int64) (*model.EventSeq, error)
	FindBalanceDeposits(address string) ([]model.EventSeqWithTxHash, error)
	FindBalanceTransfers(address string) ([]model.EventSeqWithTxHash, error)
	FindBonded(address string) ([]model.EventSeqWithTxHash, error)
	FindRewardsForTimePeriod(address string, start, end time.Time) ([]model.EventSeq, error)
	FindUnbonded(address string) ([]model.EventSeqWithTxHash, error)
	FindWithdrawn(address string) ([]model.EventSeqWithTxHash, error)
}

type Events added in v0.4.5

type Events interface {
	EventSeq
}

type FindMostRecenter added in v0.4.5

type FindMostRecenter interface {
	FindMostRecent() (*model.Syncable, error)
}

type GetAvgRecentTimesResult

type GetAvgRecentTimesResult struct {
	StartHeight int64   `json:"start_height"`
	EndHeight   int64   `json:"end_height"`
	StartTime   string  `json:"start_time"`
	EndTime     string  `json:"end_time"`
	Count       int64   `json:"count"`
	Diff        float64 `json:"diff"`
	Avg         float64 `json:"avg"`
}

swagger:response BlockTimesView GetAvgRecentTimesResult Contains results for GetAvgRecentTimes query

type GetTotalSizeResult

type GetTotalSizeResult struct {
	Size float64 `json:"size"`
}

type Reports added in v0.4.5

type Reports interface {
	DeleteByKinds(kinds []model.ReportKind) error
	FindNotCompletedByIndexVersion(indexVersion int64, kinds ...model.ReportKind) (*model.Report, error)
	FindNotCompletedByKind(kinds ...model.ReportKind) (*model.Report, error)
	Last() (*model.Report, error)
	// contains filtered or unexported methods
}

type Rewards added in v0.6.0

type Rewards interface {
	BulkUpsert(records []model.RewardEraSeq) error
	GetAll(stash, validatorStash string, start, end int64) ([]model.RewardEraSeq, error)
	GetAllByTime(stash string, start, end types.Time) ([]model.RewardEraSeq, error)
	GetByStashAndEra(validatorStash, stash string, era int64) ([]model.RewardEraSeq, error)
}

type Syncables added in v0.4.5

type Syncables interface {
	FindMostRecenter
	// contains filtered or unexported methods
}

type SystemEvents added in v0.5.0

type SystemEvents interface {
	BulkUpsert(records []model.SystemEvent) error
	FindByActor(actorAddress string, kind *model.SystemEventKind, minHeight *int64) ([]model.SystemEvent, error)
}

type TransactionSeq added in v0.4.5

type TransactionSeq interface {
	BulkUpsert(records []model.TransactionSeq) error
	GetTransactionsByTransactionKind(kind model.TransactionKind, start, end int64) ([]model.TransactionSeq, error)
}

type Transactions added in v0.4.5

type Transactions interface {
	TransactionSeq
}

type ValidatorAgg added in v0.4.5

type ValidatorAgg interface {
	CreateAgg(*model.ValidatorAgg) error
	FindBy(key string, value interface{}) (*model.ValidatorAgg, error)
	FindByID(id int64) (*model.ValidatorAgg, error)
	FindAggByStashAccount(key string) (*model.ValidatorAgg, error)
	GetAllForHeightGreaterThan(height int64) ([]model.ValidatorAgg, error)
	SaveAgg(*model.ValidatorAgg) error
}

type ValidatorEraSeq added in v0.4.5

type ValidatorEraSeq interface {
	BulkUpsertEraSeqs(records []model.ValidatorEraSeq) error
	DeleteEraSeqsOlderThan(purgeThreshold time.Time) (*int64, error)
	FindByEraAndStashAccount(era int64, stash string) (*model.ValidatorEraSeq, error)
	FindEraSeqsByHeight(h int64) ([]model.ValidatorEraSeq, error)
	FindByEra(era int64) ([]model.ValidatorEraSeq, error)
	FindMostRecentEraSeq() (*model.ValidatorEraSeq, error)
	FindLastEraSeqByStashAccount(stashAccount string, limit int64) ([]model.ValidatorEraSeq, error)
	SummarizeEraSeqs(interval types.SummaryInterval, activityPeriods []ActivityPeriodRow) ([]model.ValidatorEraSeqSummary, error)
}

type ValidatorSeq added in v0.5.0

type ValidatorSeq interface {
	BulkUpsertSeqs(records []model.ValidatorSeq) error
	DeleteSeqsOlderThan(purgeThreshold time.Time) (*int64, error)
	FindAllByHeight(height int64) ([]model.ValidatorSeq, error)
	FindMostRecentSeq() (*model.ValidatorSeq, error)
}

type ValidatorSessionSeq added in v0.4.5

type ValidatorSessionSeq interface {
	BulkUpsertSessionSeqs(records []model.ValidatorSessionSeq) error
	DeleteSessionSeqsOlderThan(purgeThreshold time.Time) (*int64, error)
	FindSessionSeqsByHeight(h int64) ([]model.ValidatorSessionSeq, error)
	FindBySession(h int64) ([]model.ValidatorSessionSeq, error)
	FindBySessionAndStashAccount(session int64, stash string) (*model.ValidatorSessionSeq, error)
	FindLastSessionSeqByStashAccount(stashAccount string, limit int64) ([]model.ValidatorSessionSeq, error)
	FindMostRecentSessionSeq() (*model.ValidatorSessionSeq, error)
	SummarizeSessionSeqs(interval types.SummaryInterval, activityPeriods []ActivityPeriodRow) ([]model.ValidatorSessionSeqSummary, error)
}

type ValidatorSummary added in v0.4.5

type ValidatorSummary interface {
	CreateSummary(*model.ValidatorSummary) error
	DeleteSummaryOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)
	FindSummary(query *model.ValidatorSummary) (*model.ValidatorSummary, error)
	FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]ActivityPeriodRow, error)
	FindMostRecentSummary() (*model.ValidatorSummary, error)
	FindMostRecentByInterval(interval types.SummaryInterval) (*model.ValidatorSummary, error)
	FindSummaries(interval types.SummaryInterval, period string) ([]ValidatorSummaryRow, error)
	FindSummaryByStashAccount(stashAccount string, interval types.SummaryInterval, period string) ([]ValidatorSummaryRow, error)
	SaveSummary(*model.ValidatorSummary) error
}

type ValidatorSummaryRow added in v0.1.2

type ValidatorSummaryRow struct {
	TimeBucket      string         `json:"time_bucket"`
	TimeInterval    string         `json:"time_interval"`
	TotalStakeAvg   types.Quantity `json:"total_stake_avg"`
	TotalStakeMin   types.Quantity `json:"total_stake_min"`
	TotalStakeMax   types.Quantity `json:"total_stake_max"`
	OwnStakeAvg     types.Quantity `json:"own_stake_avg"`
	OwnStakeMin     types.Quantity `json:"own_stake_min"`
	OwnStakeMax     types.Quantity `json:"own_stake_max"`
	StakersStakeAvg types.Quantity `json:"stakers_stake_avg"`
	StakersStakeMin types.Quantity `json:"stakers_stake_min"`
	StakersStakeMax types.Quantity `json:"stakers_stake_max"`
	RewardPointsAvg float64        `json:"reward_points_avg"`
	RewardPointsMin int64          `json:"reward_points_min"`
	RewardPointsMax int64          `json:"reward_points_max"`
	CommissionAvg   float64        `json:"commission_avg"`
	CommissionMin   int64          `json:"commission_min"`
	CommissionMax   int64          `json:"commission_max"`
	StakersCountAvg float64        `json:"stakers_count_avg"`
	StakersCountMin int64          `json:"stakers_count_min"`
	StakersCountMax int64          `json:"stakers_count_max"`
	UptimeAvg       float64        `json:"uptime_avg"`
}

type Validators added in v0.4.5

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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