Documentation ¶
Index ¶
- Variables
- type ActivityPeriodRow
- type BlockSeqStore
- func (s BlockSeqStore) Create(record interface{}) error
- func (s BlockSeqStore) CreateIfNotExists(block *model.BlockSeq) error
- func (s BlockSeqStore) DeleteByHeight(height int64) error
- func (s *BlockSeqStore) DeleteOlderThan(purgeThreshold time.Time, activityPeriods []ActivityPeriodRow) (*int64, error)
- func (s BlockSeqStore) FindBy(key string, value interface{}) (*model.BlockSeq, error)
- func (s BlockSeqStore) FindByHeight(height int64) (*model.BlockSeq, error)
- func (s BlockSeqStore) FindByID(id int64) (*model.BlockSeq, error)
- func (s *BlockSeqStore) FindMostRecent() (*model.BlockSeq, error)
- func (s *BlockSeqStore) GetAvgRecentTimes(limit int64) GetAvgRecentTimesResult
- func (s BlockSeqStore) Save(record interface{}) error
- func (s *BlockSeqStore) Summarize(interval types.SummaryInterval, activityPeriods []ActivityPeriodRow) ([]BlockSeqSummary, error)
- func (s BlockSeqStore) Truncate() error
- func (s BlockSeqStore) Update(record interface{}) error
- type BlockSeqSummary
- type BlockSummaryStore
- func (s BlockSummaryStore) Create(record interface{}) error
- func (s BlockSummaryStore) DeleteByHeight(height int64) error
- func (s *BlockSummaryStore) DeleteOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)
- func (s BlockSummaryStore) Find(query *model.BlockSummary) (*model.BlockSummary, error)
- func (s *BlockSummaryStore) FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]ActivityPeriodRow, error)
- func (s *BlockSummaryStore) FindMostRecent() (*model.BlockSummary, error)
- func (s *BlockSummaryStore) FindMostRecentByInterval(interval types.SummaryInterval) (*model.BlockSummary, error)
- func (s *BlockSummaryStore) FindSummary(interval types.SummaryInterval, period string) ([]model.BlockSummary, error)
- func (s BlockSummaryStore) Save(record interface{}) error
- func (s BlockSummaryStore) Truncate() error
- func (s BlockSummaryStore) Update(record interface{}) error
- type DatabaseStore
- type EventSeqStore
- func (s EventSeqStore) Create(record interface{}) error
- func (s EventSeqStore) DeleteByHeight(height int64) error
- func (s *EventSeqStore) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
- func (s EventSeqStore) FindBalanceDeposits(address string) ([]model.EventSeq, error)
- func (s EventSeqStore) FindBalanceTransfers(address string) ([]model.EventSeq, error)
- func (s EventSeqStore) FindBonded(address string) ([]model.EventSeq, error)
- func (s EventSeqStore) FindByHeight(height int64) ([]model.EventSeq, error)
- func (s EventSeqStore) FindByHeightAndIndex(height int64, index int64) (*model.EventSeq, error)
- func (s *EventSeqStore) FindMostRecent() (*model.EventSeq, error)
- func (s EventSeqStore) FindUnbonded(address string) ([]model.EventSeq, error)
- func (s EventSeqStore) FindWithdrawn(address string) ([]model.EventSeq, error)
- func (s EventSeqStore) Save(record interface{}) error
- func (s EventSeqStore) Truncate() error
- func (s EventSeqStore) Update(record interface{}) error
- type GetAvgRecentTimesResult
- type GetAvgTimesForIntervalRow
- type GetTotalSizeResult
- type ReportsStore
- func (s ReportsStore) Create(record interface{}) error
- func (s ReportsStore) DeleteByHeight(height int64) error
- func (s *ReportsStore) DeleteReindexing() error
- func (s ReportsStore) FindNotCompletedByIndexVersion(indexVersion int64, kinds ...model.ReportKind) (*model.Report, error)
- func (s ReportsStore) FindNotCompletedByKind(kinds ...model.ReportKind) (*model.Report, error)
- func (s ReportsStore) Last() (*model.Report, error)
- func (s ReportsStore) Save(record interface{}) error
- func (s ReportsStore) Truncate() error
- func (s ReportsStore) Update(record interface{}) error
- type Store
- type SyncablesStore
- func (s SyncablesStore) Create(record interface{}) error
- func (s SyncablesStore) CreateOrUpdate(val *model.Syncable) error
- func (s SyncablesStore) DeleteByHeight(height int64) error
- func (s SyncablesStore) FindByHeight(height int64) (syncable *model.Syncable, err error)
- func (s SyncablesStore) FindFirstByDifferentIndexVersion(indexVersion int64) (*model.Syncable, error)
- func (s SyncablesStore) FindLastInEra(era int64) (syncable *model.Syncable, err error)
- func (s SyncablesStore) FindLastInSession(session int64) (syncable *model.Syncable, err error)
- func (s SyncablesStore) FindMostRecent() (*model.Syncable, error)
- func (s SyncablesStore) FindMostRecentByDifferentIndexVersion(indexVersion int64) (*model.Syncable, error)
- func (s SyncablesStore) Save(record interface{}) error
- func (s SyncablesStore) SetProcessedAtForRange(reportID types.ID, startHeight int64, endHeight int64) error
- func (s SyncablesStore) Truncate() error
- func (s SyncablesStore) Update(record interface{}) error
- type ValidatorAggStore
- func (s ValidatorAggStore) All() ([]model.ValidatorAgg, error)
- func (s ValidatorAggStore) Create(record interface{}) error
- func (s ValidatorAggStore) CreateOrUpdate(val *model.ValidatorAgg) error
- func (s ValidatorAggStore) DeleteByHeight(height int64) error
- func (s ValidatorAggStore) FindBy(key string, value interface{}) (*model.ValidatorAgg, error)
- func (s ValidatorAggStore) FindByID(id int64) (*model.ValidatorAgg, error)
- func (s *ValidatorAggStore) FindByStashAccount(key string) (*model.ValidatorAgg, error)
- func (s *ValidatorAggStore) GetAllForHeightGreaterThan(height int64) ([]model.ValidatorAgg, error)
- func (s ValidatorAggStore) Save(record interface{}) error
- func (s ValidatorAggStore) Truncate() error
- func (s ValidatorAggStore) Update(record interface{}) error
- type ValidatorEraSeqStore
- func (s ValidatorEraSeqStore) Create(record interface{}) error
- func (s ValidatorEraSeqStore) CreateIfNotExists(validator *model.ValidatorEraSeq) error
- func (s ValidatorEraSeqStore) DeleteByHeight(height int64) error
- func (s *ValidatorEraSeqStore) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
- func (s ValidatorEraSeqStore) FindByEra(session int64) ([]model.ValidatorEraSeq, error)
- func (s ValidatorEraSeqStore) FindByEraAndStashAccount(session int64, stash string) (*model.ValidatorEraSeq, error)
- func (s ValidatorEraSeqStore) FindByHeight(h int64) ([]model.ValidatorEraSeq, error)
- func (s ValidatorEraSeqStore) FindByHeightAndStashAccount(height int64, stash string) (*model.ValidatorEraSeq, error)
- func (s ValidatorEraSeqStore) FindLastByStashAccount(stashAccount string, limit int64) ([]model.ValidatorEraSeq, error)
- func (s *ValidatorEraSeqStore) FindMostRecent() (*model.ValidatorEraSeq, error)
- func (s ValidatorEraSeqStore) Save(record interface{}) error
- func (s *ValidatorEraSeqStore) Summarize(interval types.SummaryInterval, activityPeriods []ActivityPeriodRow) ([]ValidatorEraSeqSummary, error)
- func (s ValidatorEraSeqStore) Truncate() error
- func (s ValidatorEraSeqStore) Update(record interface{}) error
- type ValidatorEraSeqSummary
- type ValidatorSessionSeqStore
- func (s ValidatorSessionSeqStore) Create(record interface{}) error
- func (s ValidatorSessionSeqStore) CreateIfNotExists(validator *model.ValidatorSessionSeq) error
- func (s ValidatorSessionSeqStore) DeleteByHeight(height int64) error
- func (s *ValidatorSessionSeqStore) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
- func (s ValidatorSessionSeqStore) FindByHeight(h int64) ([]model.ValidatorSessionSeq, error)
- func (s ValidatorSessionSeqStore) FindByHeightAndStashAccount(height int64, stash string) (*model.ValidatorSessionSeq, error)
- func (s ValidatorSessionSeqStore) FindBySession(session int64) ([]model.ValidatorSessionSeq, error)
- func (s ValidatorSessionSeqStore) FindBySessionAndStashAccount(session int64, stash string) (*model.ValidatorSessionSeq, error)
- func (s ValidatorSessionSeqStore) FindLastByStashAccount(stashAccount string, limit int64) ([]model.ValidatorSessionSeq, error)
- func (s *ValidatorSessionSeqStore) FindMostRecent() (*model.ValidatorSessionSeq, error)
- func (s ValidatorSessionSeqStore) Save(record interface{}) error
- func (s *ValidatorSessionSeqStore) Summarize(interval types.SummaryInterval, activityPeriods []ActivityPeriodRow) ([]ValidatorSessionSeqSummary, error)
- func (s ValidatorSessionSeqStore) Truncate() error
- func (s ValidatorSessionSeqStore) Update(record interface{}) error
- type ValidatorSessionSeqSummary
- type ValidatorSummaryRow
- type ValidatorSummaryStore
- func (s ValidatorSummaryStore) Create(record interface{}) error
- func (s ValidatorSummaryStore) DeleteByHeight(height int64) error
- func (s *ValidatorSummaryStore) DeleteOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)
- func (s ValidatorSummaryStore) Find(query *model.ValidatorSummary) (*model.ValidatorSummary, error)
- func (s *ValidatorSummaryStore) FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]ActivityPeriodRow, error)
- func (s *ValidatorSummaryStore) FindMostRecent() (*model.ValidatorSummary, error)
- func (s *ValidatorSummaryStore) FindMostRecentByInterval(interval types.SummaryInterval) (*model.ValidatorSummary, error)
- func (s *ValidatorSummaryStore) FindSummary(interval types.SummaryInterval, period string) ([]ValidatorSummaryRow, error)
- func (s *ValidatorSummaryStore) FindSummaryByStashAccount(stashAccount string, interval types.SummaryInterval, period string) ([]model.ValidatorSummary, error)
- func (s ValidatorSummaryStore) Save(record interface{}) error
- func (s ValidatorSummaryStore) Truncate() error
- func (s ValidatorSummaryStore) Update(record interface{}) error
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotFound = errors.New("record not found")
)
Functions ¶
This section is empty.
Types ¶
type ActivityPeriodRow ¶
type BlockSeqStore ¶
type BlockSeqStore struct {
// contains filtered or unexported fields
}
BlockSeqStore handles operations on blocks
func NewBlockSeqStore ¶
func NewBlockSeqStore(db *gorm.DB) *BlockSeqStore
func (BlockSeqStore) Create ¶
func (s BlockSeqStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (BlockSeqStore) CreateIfNotExists ¶
func (s BlockSeqStore) CreateIfNotExists(block *model.BlockSeq) error
CreateIfNotExists creates the block if it does not exist
func (BlockSeqStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (*BlockSeqStore) DeleteOlderThan ¶
func (s *BlockSeqStore) DeleteOlderThan(purgeThreshold time.Time, activityPeriods []ActivityPeriodRow) (*int64, error)
DeleteOlderThan deletes block sequence older than given threshold
func (BlockSeqStore) FindBy ¶
func (s BlockSeqStore) FindBy(key string, value interface{}) (*model.BlockSeq, error)
FindBy returns a block for a matching attribute
func (BlockSeqStore) FindByHeight ¶
func (s BlockSeqStore) FindByHeight(height int64) (*model.BlockSeq, error)
FindByHeight returns a block with the matching height
func (BlockSeqStore) FindByID ¶
func (s BlockSeqStore) FindByID(id int64) (*model.BlockSeq, error)
FindByID returns a block with matching ID
func (*BlockSeqStore) FindMostRecent ¶
func (s *BlockSeqStore) FindMostRecent() (*model.BlockSeq, error)
FindMostRecent finds most recent block sequence
func (*BlockSeqStore) GetAvgRecentTimes ¶
func (s *BlockSeqStore) GetAvgRecentTimes(limit int64) GetAvgRecentTimesResult
GetAvgRecentTimes Gets average block times for recent blocks by limit
func (BlockSeqStore) Save ¶
func (s BlockSeqStore) Save(record interface{}) error
Save saves record to database
func (*BlockSeqStore) Summarize ¶
func (s *BlockSeqStore) Summarize(interval types.SummaryInterval, activityPeriods []ActivityPeriodRow) ([]BlockSeqSummary, error)
Summarize gets the summarized version of block sequences
type BlockSeqSummary ¶
type BlockSummaryStore ¶
type BlockSummaryStore struct {
// contains filtered or unexported fields
}
BlockSummaryStore handles operations on block summary
func NewBlockSummaryStore ¶
func NewBlockSummaryStore(db *gorm.DB) *BlockSummaryStore
func (BlockSummaryStore) Create ¶
func (s BlockSummaryStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (BlockSummaryStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (*BlockSummaryStore) DeleteOlderThan ¶
func (s *BlockSummaryStore) DeleteOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)
DeleteOlderThan deletes block summary records older than given threshold
func (BlockSummaryStore) Find ¶
func (s BlockSummaryStore) Find(query *model.BlockSummary) (*model.BlockSummary, error)
Find find block summary by query
func (*BlockSummaryStore) FindActivityPeriods ¶
func (s *BlockSummaryStore) FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]ActivityPeriodRow, error)
FindActivityPeriods Finds activity periods
func (*BlockSummaryStore) FindMostRecent ¶
func (s *BlockSummaryStore) FindMostRecent() (*model.BlockSummary, error)
FindMostRecent finds most recent block summary
func (*BlockSummaryStore) FindMostRecentByInterval ¶
func (s *BlockSummaryStore) FindMostRecentByInterval(interval types.SummaryInterval) (*model.BlockSummary, error)
FindMostRecentByInterval finds most recent block summary for given time interval
func (*BlockSummaryStore) FindSummary ¶
func (s *BlockSummaryStore) FindSummary(interval types.SummaryInterval, period string) ([]model.BlockSummary, error)
FindSummary Gets summary of block sequences
func (BlockSummaryStore) Save ¶
func (s BlockSummaryStore) Save(record interface{}) error
Save saves record to database
type DatabaseStore ¶
type DatabaseStore struct {
// contains filtered or unexported fields
}
DatabaseStore handles operations on blocks
func NewDatabaseStore ¶
func NewDatabaseStore(db *gorm.DB) *DatabaseStore
func (*DatabaseStore) GetTotalSize ¶
func (s *DatabaseStore) GetTotalSize() (*GetTotalSizeResult, error)
FindSummary Gets average block times for interval
type EventSeqStore ¶ added in v0.1.2
type EventSeqStore struct {
// contains filtered or unexported fields
}
EventSeqStore handles operations on events
func NewEventSeqStore ¶ added in v0.1.2
func NewEventSeqStore(db *gorm.DB) *EventSeqStore
func (EventSeqStore) Create ¶ added in v0.1.2
func (s EventSeqStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (EventSeqStore) DeleteByHeight ¶ added in v0.1.2
DeleteByHeight removes all records associated with a height
func (*EventSeqStore) DeleteOlderThan ¶ added in v0.1.2
func (s *EventSeqStore) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
DeleteOlderThan deletes event sequence older than given threshold
func (EventSeqStore) FindBalanceDeposits ¶ added in v0.1.2
func (s EventSeqStore) FindBalanceDeposits(address string) ([]model.EventSeq, error)
FindBalanceDeposits finds balance deposits event sequences for given address
func (EventSeqStore) FindBalanceTransfers ¶ added in v0.1.2
func (s EventSeqStore) FindBalanceTransfers(address string) ([]model.EventSeq, error)
FindBalanceTransfers finds balance transfers event sequences for given address
func (EventSeqStore) FindBonded ¶ added in v0.1.2
func (s EventSeqStore) FindBonded(address string) ([]model.EventSeq, error)
FindBonded finds bonded event sequences for given address
func (EventSeqStore) FindByHeight ¶ added in v0.1.2
func (s EventSeqStore) FindByHeight(height int64) ([]model.EventSeq, error)
FindByHeight finds event sequences by height
func (EventSeqStore) FindByHeightAndIndex ¶ added in v0.1.2
FindByHeightAndStashAccount finds event by height and index
func (*EventSeqStore) FindMostRecent ¶ added in v0.1.2
func (s *EventSeqStore) FindMostRecent() (*model.EventSeq, error)
FindMostRecent finds most recent event session sequence
func (EventSeqStore) FindUnbonded ¶ added in v0.1.2
func (s EventSeqStore) FindUnbonded(address string) ([]model.EventSeq, error)
FindBonded finds unbonded event sequences for given address
func (EventSeqStore) FindWithdrawn ¶ added in v0.1.2
func (s EventSeqStore) FindWithdrawn(address string) ([]model.EventSeq, error)
FindBonded finds withdrawn event sequences for given address
func (EventSeqStore) Save ¶ added in v0.1.2
func (s EventSeqStore) Save(record interface{}) error
Save saves record to database
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"` }
GetAvgRecentTimesResult Contains results for GetAvgRecentTimes query
type GetAvgTimesForIntervalRow ¶
type GetAvgTimesForIntervalRow struct { TimeInterval string `json:"time_interval"` Count int64 `json:"count"` Avg float64 `json:"avg"` }
GetAvgTimesForIntervalRow Contains row of data for FindSummary query
type GetTotalSizeResult ¶
type GetTotalSizeResult struct {
Size float64 `json:"size"`
}
GetAvgTimesForIntervalRow Contains row of data for FindSummary query
type ReportsStore ¶
type ReportsStore struct {
// contains filtered or unexported fields
}
ReportsStore handles operations on reports
func NewReportsStore ¶
func NewReportsStore(db *gorm.DB) *ReportsStore
func (ReportsStore) Create ¶
func (s ReportsStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (ReportsStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (*ReportsStore) DeleteReindexing ¶
func (s *ReportsStore) DeleteReindexing() error
DeleteReindexing deletes reports with kind reindexing sequential or parallel
func (ReportsStore) FindNotCompletedByIndexVersion ¶
func (s ReportsStore) FindNotCompletedByIndexVersion(indexVersion int64, kinds ...model.ReportKind) (*model.Report, error)
FindNotCompletedByIndexVersion returns the report by index version and kind
func (ReportsStore) FindNotCompletedByKind ¶
func (s ReportsStore) FindNotCompletedByKind(kinds ...model.ReportKind) (*model.Report, error)
Last returns the last report
func (ReportsStore) Last ¶
func (s ReportsStore) Last() (*model.Report, error)
Last returns the last report
func (ReportsStore) Save ¶
func (s ReportsStore) Save(record interface{}) error
Save saves record to database
type Store ¶
type Store struct { Database *DatabaseStore Syncables *SyncablesStore Reports *ReportsStore BlockSeq *BlockSeqStore ValidatorSessionSeq *ValidatorSessionSeqStore ValidatorEraSeq *ValidatorEraSeqStore EventSeq *EventSeqStore ValidatorAgg *ValidatorAggStore BlockSummary *BlockSummaryStore ValidatorSummary *ValidatorSummaryStore // contains filtered or unexported fields }
Store handles all database operations
func (*Store) SetDebugMode ¶
SetDebugMode enabled detailed query logging
type SyncablesStore ¶
type SyncablesStore struct {
// contains filtered or unexported fields
}
SyncablesStore handles operations on syncables
func NewSyncablesStore ¶
func NewSyncablesStore(db *gorm.DB) *SyncablesStore
func (SyncablesStore) Create ¶
func (s SyncablesStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (SyncablesStore) CreateOrUpdate ¶
func (s SyncablesStore) CreateOrUpdate(val *model.Syncable) error
CreateOrUpdate creates a new syncable or updates an existing one
func (SyncablesStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (SyncablesStore) FindByHeight ¶
func (s SyncablesStore) FindByHeight(height int64) (syncable *model.Syncable, err error)
Exists returns true if a syncable exists at give height
func (SyncablesStore) FindFirstByDifferentIndexVersion ¶
func (s SyncablesStore) FindFirstByDifferentIndexVersion(indexVersion int64) (*model.Syncable, error)
FindFirstByDifferentIndexVersion returns first syncable with different index version
func (SyncablesStore) FindLastInEra ¶ added in v0.1.2
func (s SyncablesStore) FindLastInEra(era int64) (syncable *model.Syncable, err error)
FindLastInEra finds last syncable in given era
func (SyncablesStore) FindLastInSession ¶ added in v0.1.2
func (s SyncablesStore) FindLastInSession(session int64) (syncable *model.Syncable, err error)
FindLastInSession finds last syncable in given session
func (SyncablesStore) FindMostRecent ¶
func (s SyncablesStore) FindMostRecent() (*model.Syncable, error)
FindMostRecent returns the most recent syncable
func (SyncablesStore) FindMostRecentByDifferentIndexVersion ¶
func (s SyncablesStore) FindMostRecentByDifferentIndexVersion(indexVersion int64) (*model.Syncable, error)
FindMostRecentByDifferentIndexVersion returns the most recent syncable with different index version
func (SyncablesStore) Save ¶
func (s SyncablesStore) Save(record interface{}) error
Save saves record to database
func (SyncablesStore) SetProcessedAtForRange ¶
func (s SyncablesStore) SetProcessedAtForRange(reportID types.ID, startHeight int64, endHeight int64) error
CreateOrUpdate creates a new syncable or updates an existing one
type ValidatorAggStore ¶ added in v0.1.2
type ValidatorAggStore struct {
// contains filtered or unexported fields
}
ValidatorAgg handles operations on validators
func NewValidatorAggStore ¶ added in v0.1.2
func NewValidatorAggStore(db *gorm.DB) *ValidatorAggStore
func (ValidatorAggStore) All ¶ added in v0.1.2
func (s ValidatorAggStore) All() ([]model.ValidatorAgg, error)
All returns all validators
func (ValidatorAggStore) Create ¶ added in v0.1.2
func (s ValidatorAggStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (ValidatorAggStore) CreateOrUpdate ¶ added in v0.1.2
func (s ValidatorAggStore) CreateOrUpdate(val *model.ValidatorAgg) error
CreateOrUpdate creates a new validator or updates an existing one
func (ValidatorAggStore) DeleteByHeight ¶ added in v0.1.2
DeleteByHeight removes all records associated with a height
func (ValidatorAggStore) FindBy ¶ added in v0.1.2
func (s ValidatorAggStore) FindBy(key string, value interface{}) (*model.ValidatorAgg, error)
FindBy returns an validator for a matching attribute
func (ValidatorAggStore) FindByID ¶ added in v0.1.2
func (s ValidatorAggStore) FindByID(id int64) (*model.ValidatorAgg, error)
FindByID returns an validator for the ID
func (*ValidatorAggStore) FindByStashAccount ¶ added in v0.1.2
func (s *ValidatorAggStore) FindByStashAccount(key string) (*model.ValidatorAgg, error)
FindByStashAccount return validator by stash account
func (*ValidatorAggStore) GetAllForHeightGreaterThan ¶ added in v0.1.2
func (s *ValidatorAggStore) GetAllForHeightGreaterThan(height int64) ([]model.ValidatorAgg, error)
GetAllForHeightGreaterThan returns validators who have been validating since given height
func (ValidatorAggStore) Save ¶ added in v0.1.2
func (s ValidatorAggStore) Save(record interface{}) error
Save saves record to database
type ValidatorEraSeqStore ¶ added in v0.1.2
type ValidatorEraSeqStore struct {
// contains filtered or unexported fields
}
ValidatorEraSeqStore handles operations on validators
func NewValidatorEraSeqStore ¶ added in v0.1.2
func NewValidatorEraSeqStore(db *gorm.DB) *ValidatorEraSeqStore
func (ValidatorEraSeqStore) Create ¶ added in v0.1.2
func (s ValidatorEraSeqStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (ValidatorEraSeqStore) CreateIfNotExists ¶ added in v0.1.2
func (s ValidatorEraSeqStore) CreateIfNotExists(validator *model.ValidatorEraSeq) error
CreateIfNotExists creates the validator if it does not exist
func (ValidatorEraSeqStore) DeleteByHeight ¶ added in v0.1.2
DeleteByHeight removes all records associated with a height
func (*ValidatorEraSeqStore) DeleteOlderThan ¶ added in v0.1.2
func (s *ValidatorEraSeqStore) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
DeleteOlderThan deletes validator sequence older than given threshold
func (ValidatorEraSeqStore) FindByEra ¶ added in v0.1.2
func (s ValidatorEraSeqStore) FindByEra(session int64) ([]model.ValidatorEraSeq, error)
FindByHeight finds validator session sequences by session
func (ValidatorEraSeqStore) FindByEraAndStashAccount ¶ added in v0.1.2
func (s ValidatorEraSeqStore) FindByEraAndStashAccount(session int64, stash string) (*model.ValidatorEraSeq, error)
FindByEraAndStashAccount finds validator by session and stash account
func (ValidatorEraSeqStore) FindByHeight ¶ added in v0.1.2
func (s ValidatorEraSeqStore) FindByHeight(h int64) ([]model.ValidatorEraSeq, error)
FindByHeight finds validator session sequences by height
func (ValidatorEraSeqStore) FindByHeightAndStashAccount ¶ added in v0.1.2
func (s ValidatorEraSeqStore) FindByHeightAndStashAccount(height int64, stash string) (*model.ValidatorEraSeq, error)
FindByHeightAndStashAccount finds validator by height and stash account
func (ValidatorEraSeqStore) FindLastByStashAccount ¶ added in v0.1.2
func (s ValidatorEraSeqStore) FindLastByStashAccount(stashAccount string, limit int64) ([]model.ValidatorEraSeq, error)
FindLastByStashAccount finds last validator session sequences for given stash account
func (*ValidatorEraSeqStore) FindMostRecent ¶ added in v0.1.2
func (s *ValidatorEraSeqStore) FindMostRecent() (*model.ValidatorEraSeq, error)
FindMostRecent finds most recent validator session sequence
func (ValidatorEraSeqStore) Save ¶ added in v0.1.2
func (s ValidatorEraSeqStore) Save(record interface{}) error
Save saves record to database
func (*ValidatorEraSeqStore) Summarize ¶ added in v0.1.2
func (s *ValidatorEraSeqStore) Summarize(interval types.SummaryInterval, activityPeriods []ActivityPeriodRow) ([]ValidatorEraSeqSummary, error)
Summarize gets the summarized version of validator sequences
type ValidatorEraSeqSummary ¶ added in v0.1.2
type ValidatorEraSeqSummary struct { StashAccount string `json:"stash_account"` TimeBucket types.Time `json:"time_bucket"` 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"` }
type ValidatorSessionSeqStore ¶ added in v0.1.2
type ValidatorSessionSeqStore struct {
// contains filtered or unexported fields
}
ValidatorSessionSeqStore handles operations on validators
func NewValidatorSessionSeqStore ¶ added in v0.1.2
func NewValidatorSessionSeqStore(db *gorm.DB) *ValidatorSessionSeqStore
func (ValidatorSessionSeqStore) Create ¶ added in v0.1.2
func (s ValidatorSessionSeqStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (ValidatorSessionSeqStore) CreateIfNotExists ¶ added in v0.1.2
func (s ValidatorSessionSeqStore) CreateIfNotExists(validator *model.ValidatorSessionSeq) error
CreateIfNotExists creates the validator if it does not exist
func (ValidatorSessionSeqStore) DeleteByHeight ¶ added in v0.1.2
DeleteByHeight removes all records associated with a height
func (*ValidatorSessionSeqStore) DeleteOlderThan ¶ added in v0.1.2
func (s *ValidatorSessionSeqStore) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
DeleteOlderThan deletes validator sequence older than given threshold
func (ValidatorSessionSeqStore) FindByHeight ¶ added in v0.1.2
func (s ValidatorSessionSeqStore) FindByHeight(h int64) ([]model.ValidatorSessionSeq, error)
FindByHeight finds validator session sequences by height
func (ValidatorSessionSeqStore) FindByHeightAndStashAccount ¶ added in v0.1.2
func (s ValidatorSessionSeqStore) FindByHeightAndStashAccount(height int64, stash string) (*model.ValidatorSessionSeq, error)
FindByHeightAndStashAccount finds validator by height and stash account
func (ValidatorSessionSeqStore) FindBySession ¶ added in v0.1.2
func (s ValidatorSessionSeqStore) FindBySession(session int64) ([]model.ValidatorSessionSeq, error)
FindByHeight finds validator session sequences by session
func (ValidatorSessionSeqStore) FindBySessionAndStashAccount ¶ added in v0.1.2
func (s ValidatorSessionSeqStore) FindBySessionAndStashAccount(session int64, stash string) (*model.ValidatorSessionSeq, error)
FindBySessionAndStashAccount finds validator by session and stash account
func (ValidatorSessionSeqStore) FindLastByStashAccount ¶ added in v0.1.2
func (s ValidatorSessionSeqStore) FindLastByStashAccount(stashAccount string, limit int64) ([]model.ValidatorSessionSeq, error)
FindLastByStashAccount finds last validator session sequences for given stash account
func (*ValidatorSessionSeqStore) FindMostRecent ¶ added in v0.1.2
func (s *ValidatorSessionSeqStore) FindMostRecent() (*model.ValidatorSessionSeq, error)
FindMostRecent finds most recent validator session sequence
func (ValidatorSessionSeqStore) Save ¶ added in v0.1.2
func (s ValidatorSessionSeqStore) Save(record interface{}) error
Save saves record to database
func (*ValidatorSessionSeqStore) Summarize ¶ added in v0.1.2
func (s *ValidatorSessionSeqStore) Summarize(interval types.SummaryInterval, activityPeriods []ActivityPeriodRow) ([]ValidatorSessionSeqSummary, error)
Summarize gets the summarized version of validator sequences
type ValidatorSessionSeqSummary ¶ added in v0.1.2
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"` }
type ValidatorSummaryStore ¶ added in v0.1.2
type ValidatorSummaryStore struct {
// contains filtered or unexported fields
}
ValidatorSummaryStore handles operations on validators
func NewValidatorSummaryStore ¶ added in v0.1.2
func NewValidatorSummaryStore(db *gorm.DB) *ValidatorSummaryStore
func (ValidatorSummaryStore) Create ¶ added in v0.1.2
func (s ValidatorSummaryStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (ValidatorSummaryStore) DeleteByHeight ¶ added in v0.1.2
DeleteByHeight removes all records associated with a height
func (*ValidatorSummaryStore) DeleteOlderThan ¶ added in v0.1.2
func (s *ValidatorSummaryStore) DeleteOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)
DeleteOlderThan deleted validator summary records older than given threshold
func (ValidatorSummaryStore) Find ¶ added in v0.1.2
func (s ValidatorSummaryStore) Find(query *model.ValidatorSummary) (*model.ValidatorSummary, error)
Find find validator summary by query
func (*ValidatorSummaryStore) FindActivityPeriods ¶ added in v0.1.2
func (s *ValidatorSummaryStore) FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]ActivityPeriodRow, error)
FindActivityPeriods Finds activity periods
func (*ValidatorSummaryStore) FindMostRecent ¶ added in v0.1.2
func (s *ValidatorSummaryStore) FindMostRecent() (*model.ValidatorSummary, error)
FindMostRecent finds most recent validator summary
func (*ValidatorSummaryStore) FindMostRecentByInterval ¶ added in v0.1.2
func (s *ValidatorSummaryStore) FindMostRecentByInterval(interval types.SummaryInterval) (*model.ValidatorSummary, error)
FindMostRecentByInterval finds most recent validator summary for interval
func (*ValidatorSummaryStore) FindSummary ¶ added in v0.1.2
func (s *ValidatorSummaryStore) FindSummary(interval types.SummaryInterval, period string) ([]ValidatorSummaryRow, error)
FindSummary gets summary for validator summary
func (*ValidatorSummaryStore) FindSummaryByStashAccount ¶ added in v0.1.2
func (s *ValidatorSummaryStore) FindSummaryByStashAccount(stashAccount string, interval types.SummaryInterval, period string) ([]model.ValidatorSummary, error)
FindSummaryByStashAccount gets summary for given validator
func (ValidatorSummaryStore) Save ¶ added in v0.1.2
func (s ValidatorSummaryStore) Save(record interface{}) error
Save saves record to database
Source Files ¶
- base_store.go
- block_seq_queries.go
- block_seq_store.go
- block_summary_queries.go
- block_summary_store.go
- database_store.go
- event_seq_queries.go
- event_seq_store.go
- reports_store.go
- store.go
- syncables_store.go
- validator_agg_store.go
- validator_era_seq_queries.go
- validator_era_seq_store.go
- validator_session_seq_queries.go
- validator_session_seq_store.go
- validator_summary_queries.go
- validator_summary_store.go