Documentation ¶
Index ¶
- Constants
- Variables
- type AccountsStore
- func (s AccountsStore) All() ([]model.Account, error)
- func (s AccountsStore) AllByDelegator(account string) ([]model.Account, error)
- func (s AccountsStore) ByHeight(height int64) ([]model.Account, error)
- func (s AccountsStore) Count() (int, error)
- func (s AccountsStore) Create(record interface{}) error
- func (s AccountsStore) DeleteByHeight(height int64) error
- func (s AccountsStore) FindBy(key string, value interface{}) (*model.Account, error)
- func (s AccountsStore) FindByID(id int64) (*model.Account, error)
- func (s AccountsStore) FindByPublicKey(key string) (*model.Account, error)
- func (s AccountsStore) Import(records []model.Account) error
- func (s AccountsStore) Truncate() error
- func (s AccountsStore) Update(record interface{}) error
- func (s AccountsStore) UpdateStaking() error
- type BlockSearch
- type BlocksStore
- func (s BlocksStore) AvgTimes(limit int64) ([]byte, error)
- func (s BlocksStore) Create(record interface{}) error
- func (s BlocksStore) DeleteByHeight(height int64) error
- func (s BlocksStore) FindBy(key string, value interface{}) (*model.Block, error)
- func (s BlocksStore) FindByHash(hash string) (*model.Block, error)
- func (s BlocksStore) FindByHeight(height uint64) (*model.Block, error)
- func (s BlocksStore) FindByID(id int64) (*model.Block, error)
- func (s BlocksStore) FindLastCalculatedBlockReward(from, to uint64) (*model.Block, error)
- func (s BlocksStore) FindNonCalculatedBlockRewards(from, to uint64) ([]model.Block, error)
- func (s BlocksStore) FindUnsafeBlocks(startingHeight uint64) ([]model.Block, error)
- func (s BlocksStore) FirstBlockOfEpoch(epoch string) (*model.Block, error)
- func (s BlocksStore) LastBlock() (*model.Block, error)
- func (s BlocksStore) MarkBlockCanonical(hash string) error
- func (s BlocksStore) MarkBlocksOrphan(height uint64) error
- func (s BlocksStore) Recent() (*model.Block, error)
- func (s BlocksStore) Search(search *BlockSearch) ([]model.Block, error)
- func (s BlocksStore) Stats(period uint, interval string) ([]byte, error)
- func (s BlocksStore) Truncate() error
- func (s BlocksStore) Update(record interface{}) error
- type FindDelegationsParams
- type JobsStore
- func (s JobsStore) ByHash(hash string) ([]model.SnarkJob, error)
- func (s JobsStore) ByHeight(height uint64) ([]model.SnarkJob, error)
- func (s JobsStore) Create(record interface{}) error
- func (s JobsStore) DeleteByHeight(height int64) error
- func (s JobsStore) Import(jobs []model.SnarkJob) error
- func (s JobsStore) Truncate() error
- func (s JobsStore) Update(record interface{}) error
- type RewardStore
- func (s RewardStore) Create(record interface{}) error
- func (s RewardStore) DeleteByDelegator(account string) error
- func (s RewardStore) DeleteByHeight(height int64) error
- func (s RewardStore) DeleteByValidator(account string) error
- func (s *RewardStore) FetchRewardsByInterval(ownerAccount string, delegate string, from time.Time, to time.Time, ...) ([]model.RewardsSummary, error)
- func (s RewardStore) Import(records []model.BlockReward) error
- func (s RewardStore) Truncate() error
- func (s RewardStore) Update(record interface{}) error
- type SnarkersStore
- func (s SnarkersStore) All() ([]model.Snarker, error)
- func (s SnarkersStore) Create(record interface{}) error
- func (s SnarkersStore) DeleteByHeight(height int64) error
- func (s SnarkersStore) FindSnarker(account string) (*model.Snarker, error)
- func (s SnarkersStore) Import(records []model.Snarker) error
- func (s SnarkersStore) SnarkerInfoFromCanonicalBlocks(account string, start, end uint64) ([]byte, error)
- func (s SnarkersStore) Truncate() error
- func (s SnarkersStore) Update(record interface{}) error
- type StakingStore
- func (s StakingStore) AllLedgers() ([]model.Ledger, error)
- func (s StakingStore) Create(record interface{}) error
- func (s StakingStore) CreateLedger(ledger *model.Ledger) error
- func (s StakingStore) CreateLedgerEntries(records []model.LedgerEntry) error
- func (s StakingStore) DelegateLedgerRecords(ledgerID int, delegate string) ([]model.LedgerEntry, error)
- func (s StakingStore) DeleteByHeight(height int64) error
- func (s StakingStore) FindDelegations(params FindDelegationsParams) ([]model.Delegation, error)
- func (s StakingStore) FindLedger(epoch int) (*model.Ledger, error)
- func (s StakingStore) LastLedger() (*model.Ledger, error)
- func (s StakingStore) LedgerRecords(ledgerID int) ([]model.LedgerEntry, error)
- func (s StakingStore) Truncate() error
- func (s StakingStore) Update(record interface{}) error
- type StatsStore
- func (s StatsStore) Create(record interface{}) error
- func (s StatsStore) CreateChainStats(bucket string, ts time.Time) error
- func (s StatsStore) CreateValidatorStats(validatorPublicKey string, bucket string, ts time.Time) error
- func (s StatsStore) DeleteByHeight(height int64) error
- func (s StatsStore) FindValidatorsForDefaultStats(bucket string, ts time.Time) ([]model.Validator, error)
- func (s StatsStore) SnarkerJobFeesBreakdown(account string) ([]model.SnarkerJobFee, error)
- func (s StatsStore) SnarkerJobsStats(bucket string, limit uint) ([]model.SnarkerJobsStat, error)
- func (s StatsStore) SnarkerStats(account string) (model.SnarkerStat, error)
- func (s StatsStore) SnarkerTimeStats(account string) ([]model.SnarkerTimeStat, error)
- func (s StatsStore) Truncate() error
- func (s StatsStore) Update(record interface{}) error
- func (s StatsStore) ValidatorStats(validator *model.Validator, period uint, interval string) ([]model.ValidatorStat, error)
- type Store
- type TransactionSearch
- type TransactionsStore
- func (s TransactionsStore) ByAccount(account string) ([]model.Transaction, error)
- func (s TransactionsStore) ByHeight(height uint64, limit uint) ([]model.Transaction, error)
- func (s TransactionsStore) Create(record interface{}) error
- func (s TransactionsStore) DeleteByHeight(height int64) error
- func (s TransactionsStore) FindBy(key string, value interface{}) (*model.Transaction, error)
- func (s TransactionsStore) FindByHash(hash string) (*model.Transaction, error)
- func (s TransactionsStore) FindByID(id int64) (*model.Transaction, error)
- func (s TransactionsStore) Import(records []model.Transaction) error
- func (s TransactionsStore) MarkTransactionsCanonical(blockHash string) error
- func (s TransactionsStore) MarkTransactionsOrphan(height uint64) error
- func (s TransactionsStore) Search(search TransactionSearch) ([]model.Transaction, error)
- func (s TransactionsStore) Truncate() error
- func (s TransactionsStore) Update(record interface{}) error
- type ValidatorsEpochsStore
- func (s ValidatorsEpochsStore) Create(record interface{}) error
- func (s ValidatorsEpochsStore) DeleteByHeight(height int64) error
- func (s *ValidatorsEpochsStore) GetLastValidatorEpoch(address string) (*model.ValidatorEpoch, error)
- func (s *ValidatorsEpochsStore) GetValidatorEpochs(epoch string, accountAddress string) ([]model.ValidatorEpoch, error)
- func (s ValidatorsEpochsStore) Import(records []model.ValidatorEpoch) error
- func (s ValidatorsEpochsStore) Truncate() error
- func (s ValidatorsEpochsStore) Update(record interface{}) error
- type ValidatorsStore
- func (s ValidatorsStore) Create(record interface{}) error
- func (s ValidatorsStore) DeleteByHeight(height int64) error
- func (s ValidatorsStore) FindAll() (result []model.Validator, err error)
- func (s ValidatorsStore) FindByPublicKey(key string) (*model.Validator, error)
- func (s ValidatorsStore) Import(records []model.Validator) error
- func (s ValidatorsStore) Index() ([]byte, error)
- func (s ValidatorsStore) Truncate() error
- func (s ValidatorsStore) Update(record interface{}) error
- func (s ValidatorsStore) UpdateFee(key string, value float64) error
- func (s ValidatorsStore) UpdateIdentity(key string, name string) error
- func (s ValidatorsStore) UpdateStaking() error
Constants ¶
const ( BucketHour = "h" BucketDay = "d" )
Variables ¶
var (
ErrNotFound = errors.New("record not found")
)
Functions ¶
This section is empty.
Types ¶
type AccountsStore ¶
type AccountsStore struct {
// contains filtered or unexported fields
}
AccountsStore handles operations on accounts
func NewAccountsStore ¶
func NewAccountsStore(db *gorm.DB) AccountsStore
func (AccountsStore) All ¶
func (s AccountsStore) All() ([]model.Account, error)
All returns all accounts
func (AccountsStore) AllByDelegator ¶
func (s AccountsStore) AllByDelegator(account string) ([]model.Account, error)
AllByDelegator returns all accounts delegated to another account
func (AccountsStore) ByHeight ¶
func (s AccountsStore) ByHeight(height int64) ([]model.Account, error)
ByHeight returns all accounts that were created at a given height
func (AccountsStore) Count ¶
func (s AccountsStore) Count() (int, error)
func (AccountsStore) Create ¶
func (s AccountsStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (AccountsStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (AccountsStore) FindBy ¶
func (s AccountsStore) FindBy(key string, value interface{}) (*model.Account, error)
FindBy returns an account for a matching attribute
func (AccountsStore) FindByID ¶
func (s AccountsStore) FindByID(id int64) (*model.Account, error)
FindByID returns an account for the ID
func (AccountsStore) FindByPublicKey ¶
func (s AccountsStore) FindByPublicKey(key string) (*model.Account, error)
FindByPublicKey returns an account for the public key
func (AccountsStore) Truncate ¶
func (s AccountsStore) Truncate() error
Truncate removes all records from the table
func (AccountsStore) Update ¶
func (s AccountsStore) Update(record interface{}) error
Update updates the existing record. Must pass a pointer.
func (AccountsStore) UpdateStaking ¶
func (s AccountsStore) UpdateStaking() error
type BlockSearch ¶
type BlockSearch struct { Creator string `form:"creator"` Canonical string `form:"canonical"` MinHeight uint `form:"min_height"` MaxHeight uint `form:"max_height"` Sort string `form:"sort"` Order string `form:"order"` Limit uint `form:"limit"` }
BlockSearch contains a block search params
func (*BlockSearch) Validate ¶
func (search *BlockSearch) Validate() error
Validate performs validation on search parameters
type BlocksStore ¶
type BlocksStore struct {
// contains filtered or unexported fields
}
BlocksStore handles operations on blocks
func NewBlocksStore ¶
func NewBlocksStore(db *gorm.DB) BlocksStore
func (BlocksStore) AvgTimes ¶
func (s BlocksStore) AvgTimes(limit int64) ([]byte, error)
AvgTimes returns recent blocks averages
func (BlocksStore) Create ¶
func (s BlocksStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (BlocksStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (BlocksStore) FindBy ¶
func (s BlocksStore) FindBy(key string, value interface{}) (*model.Block, error)
FindBy returns a block for a matching attribute
func (BlocksStore) FindByHash ¶
func (s BlocksStore) FindByHash(hash string) (*model.Block, error)
FindByHash returns a block with the matching hash
func (BlocksStore) FindByHeight ¶
func (s BlocksStore) FindByHeight(height uint64) (*model.Block, error)
FindByHeight returns a canonical block with the matching height
func (BlocksStore) FindByID ¶
func (s BlocksStore) FindByID(id int64) (*model.Block, error)
FindByID returns a block with matching ID
func (BlocksStore) FindLastCalculatedBlockReward ¶ added in v0.11.0
func (s BlocksStore) FindLastCalculatedBlockReward(from, to uint64) (*model.Block, error)
FindLastCalculatedBlockReward returns the last calculated block reward
func (BlocksStore) FindNonCalculatedBlockRewards ¶ added in v0.11.0
func (s BlocksStore) FindNonCalculatedBlockRewards(from, to uint64) ([]model.Block, error)
FindNonCalculatedBlockRewards returns the non calculated blocks for rewards
func (BlocksStore) FindUnsafeBlocks ¶ added in v0.9.3
func (s BlocksStore) FindUnsafeBlocks(startingHeight uint64) ([]model.Block, error)
FindUnsafeBlocks returns the last indexed unsafe blocks that may be orphaned
func (BlocksStore) FirstBlockOfEpoch ¶ added in v0.11.0
func (s BlocksStore) FirstBlockOfEpoch(epoch string) (*model.Block, error)
FirstBlockOfEpoch returns the first block of epoch
func (BlocksStore) LastBlock ¶ added in v0.9.3
func (s BlocksStore) LastBlock() (*model.Block, error)
LastBlock returns the last block
func (BlocksStore) MarkBlockCanonical ¶ added in v0.9.3
func (s BlocksStore) MarkBlockCanonical(hash string) error
MarkBlockCanonical updates canonical at a height
func (BlocksStore) MarkBlocksOrphan ¶ added in v0.9.3
func (s BlocksStore) MarkBlocksOrphan(height uint64) error
MarkBlocksOrphan updates all blocks as non canonical at a height
func (BlocksStore) Recent ¶
func (s BlocksStore) Recent() (*model.Block, error)
Recent returns the most recent block
func (BlocksStore) Search ¶
func (s BlocksStore) Search(search *BlockSearch) ([]model.Block, error)
Search returns blocks that match search filters
func (BlocksStore) Stats ¶
func (s BlocksStore) Stats(period uint, interval string) ([]byte, error)
Stats returns block stats for a given interval
type FindDelegationsParams ¶
type JobsStore ¶
type JobsStore struct {
// contains filtered or unexported fields
}
JobsStore handles operations on jobs
func NewJobsStore ¶
func (JobsStore) Create ¶
func (s JobsStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (JobsStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
type RewardStore ¶ added in v0.11.0
type RewardStore struct {
// contains filtered or unexported fields
}
RewardStore handles operations on rewards
func NewRewardStore ¶ added in v0.11.0
func NewRewardStore(db *gorm.DB) RewardStore
func (RewardStore) Create ¶ added in v0.11.0
func (s RewardStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (RewardStore) DeleteByDelegator ¶ added in v0.17.0
func (s RewardStore) DeleteByDelegator(account string) error
DeleteByDelegator removes all block rewards records for given delegator address
func (RewardStore) DeleteByHeight ¶ added in v0.11.0
DeleteByHeight removes all records associated with a height
func (RewardStore) DeleteByValidator ¶ added in v0.17.0
func (s RewardStore) DeleteByValidator(account string) error
DeleteByValidator removes all block rewards records for a given validator address
func (*RewardStore) FetchRewardsByInterval ¶ added in v0.11.0
func (s *RewardStore) FetchRewardsByInterval( ownerAccount string, delegate string, from time.Time, to time.Time, timeInterval model.TimeInterval, rewardOwnerType model.RewardOwnerType, includeEpoch bool, ) ([]model.RewardsSummary, error)
FetchRewardsByInterval fetches rewards by interval
func (RewardStore) Import ¶ added in v0.11.0
func (s RewardStore) Import(records []model.BlockReward) error
Import creates new rewards
type SnarkersStore ¶
type SnarkersStore struct {
// contains filtered or unexported fields
}
func NewSnarkersStore ¶
func NewSnarkersStore(db *gorm.DB) SnarkersStore
func (SnarkersStore) Create ¶
func (s SnarkersStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (SnarkersStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (SnarkersStore) FindSnarker ¶ added in v0.9.3
func (s SnarkersStore) FindSnarker(account string) (*model.Snarker, error)
FindSnarker returns snarker for a given account
func (SnarkersStore) SnarkerInfoFromCanonicalBlocks ¶ added in v0.9.3
func (s SnarkersStore) SnarkerInfoFromCanonicalBlocks(account string, start, end uint64) ([]byte, error)
SnarkerInfoFromCanonicalBlocks returns snarker info from canonical blocks
type StakingStore ¶
type StakingStore struct {
// contains filtered or unexported fields
}
StakingStore handles operations on staking data
func NewStakingStore ¶
func NewStakingStore(db *gorm.DB) StakingStore
func (StakingStore) AllLedgers ¶ added in v0.7.0
func (s StakingStore) AllLedgers() ([]model.Ledger, error)
AllLedgers returns all existing ledgers
func (StakingStore) Create ¶
func (s StakingStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (StakingStore) CreateLedger ¶
func (s StakingStore) CreateLedger(ledger *model.Ledger) error
CreateLedger creates a new ledger record
func (StakingStore) CreateLedgerEntries ¶
func (s StakingStore) CreateLedgerEntries(records []model.LedgerEntry) error
CreateLedgerEntries create a batch of ledger entries
func (StakingStore) DelegateLedgerRecords ¶ added in v0.11.0
func (s StakingStore) DelegateLedgerRecords(ledgerID int, delegate string) ([]model.LedgerEntry, error)
DelegateLedgerRecords returns delegations' ledger info
func (StakingStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (StakingStore) FindDelegations ¶
func (s StakingStore) FindDelegations(params FindDelegationsParams) ([]model.Delegation, error)
FindDelegations returns delegations for a given ledger ID
func (StakingStore) FindLedger ¶
func (s StakingStore) FindLedger(epoch int) (*model.Ledger, error)
FindLedger returns the most recent ledger of an epoch
func (StakingStore) LastLedger ¶
func (s StakingStore) LastLedger() (*model.Ledger, error)
LastLedger returns the most recent ledger record
func (StakingStore) LedgerRecords ¶
func (s StakingStore) LedgerRecords(ledgerID int) ([]model.LedgerEntry, error)
LedgerRecords returns all ledger records from current epoch
type StatsStore ¶
type StatsStore struct {
// contains filtered or unexported fields
}
func NewStatsStore ¶
func NewStatsStore(db *gorm.DB) StatsStore
func (StatsStore) Create ¶
func (s StatsStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (StatsStore) CreateChainStats ¶
func (s StatsStore) CreateChainStats(bucket string, ts time.Time) error
CreateChainStats creates a new chain stats record
func (StatsStore) CreateValidatorStats ¶
func (s StatsStore) CreateValidatorStats(validatorPublicKey string, bucket string, ts time.Time) error
CreateValidatorStats creates a new validator stats record
func (StatsStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (StatsStore) FindValidatorsForDefaultStats ¶ added in v0.9.3
func (s StatsStore) FindValidatorsForDefaultStats(bucket string, ts time.Time) ([]model.Validator, error)
FindValidatorsForDefaultStats returns validator for default values
func (StatsStore) SnarkerJobFeesBreakdown ¶ added in v0.18.0
func (s StatsStore) SnarkerJobFeesBreakdown(account string) ([]model.SnarkerJobFee, error)
func (StatsStore) SnarkerJobsStats ¶ added in v0.18.0
func (s StatsStore) SnarkerJobsStats(bucket string, limit uint) ([]model.SnarkerJobsStat, error)
func (StatsStore) SnarkerStats ¶ added in v0.18.0
func (s StatsStore) SnarkerStats(account string) (model.SnarkerStat, error)
func (StatsStore) SnarkerTimeStats ¶ added in v0.18.0
func (s StatsStore) SnarkerTimeStats(account string) ([]model.SnarkerTimeStat, error)
func (StatsStore) Truncate ¶
func (s StatsStore) Truncate() error
Truncate removes all records from the table
func (StatsStore) Update ¶
func (s StatsStore) Update(record interface{}) error
Update updates the existing record. Must pass a pointer.
func (StatsStore) ValidatorStats ¶
func (s StatsStore) ValidatorStats(validator *model.Validator, period uint, interval string) ([]model.ValidatorStat, error)
ValidatorStats returns validator stats for a given timeframe
type Store ¶
type Store struct { Blocks BlocksStore Accounts AccountsStore Validators ValidatorsStore ValidatorsEpochs ValidatorsEpochsStore Transactions TransactionsStore Jobs JobsStore Snarkers SnarkersStore Stats StatsStore Staking StakingStore Rewards RewardStore // contains filtered or unexported fields }
Store handles all database operations
func (*Store) SetDebugMode ¶
SetDebugMode enabled detailed query logging
type TransactionSearch ¶
type TransactionSearch struct { AfterID uint `form:"after_id"` BeforeID uint `form:"before_id"` Height uint64 `form:"height"` Type string `form:"type"` BlockHash string `form:"block_hash"` Account string `form:"account"` Sender string `form:"sender"` Receiver string `form:"receiver"` Memo string `form:"memo"` StartTime string `form:"start_time"` EndTime string `form:"end_time"` Status string `form:"status"` Canonical *bool `form:"canonical"` Limit uint `form:"limit"` // contains filtered or unexported fields }
TransactionSearch contains transaction search params
func (*TransactionSearch) Validate ¶
func (s *TransactionSearch) Validate() error
Validate returns an error if search form is invalid
type TransactionsStore ¶
type TransactionsStore struct {
// contains filtered or unexported fields
}
TransactionsStore handles operations on transactions
func NewTransactionsStore ¶
func NewTransactionsStore(db *gorm.DB) TransactionsStore
func (TransactionsStore) ByAccount ¶
func (s TransactionsStore) ByAccount(account string) ([]model.Transaction, error)
ByAccount returns a list of transactions sent or received by the account
func (TransactionsStore) ByHeight ¶
func (s TransactionsStore) ByHeight(height uint64, limit uint) ([]model.Transaction, error)
ByHeight returns transactions for a given height
func (TransactionsStore) Create ¶
func (s TransactionsStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (TransactionsStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (TransactionsStore) FindBy ¶
func (s TransactionsStore) FindBy(key string, value interface{}) (*model.Transaction, error)
FindBy returns transactions by a given key and value
func (TransactionsStore) FindByHash ¶
func (s TransactionsStore) FindByHash(hash string) (*model.Transaction, error)
FindByHash returns a transaction for a given hash
func (TransactionsStore) FindByID ¶
func (s TransactionsStore) FindByID(id int64) (*model.Transaction, error)
FindByID returns a transaction for a given ID
func (TransactionsStore) Import ¶
func (s TransactionsStore) Import(records []model.Transaction) error
func (TransactionsStore) MarkTransactionsCanonical ¶ added in v0.9.3
func (s TransactionsStore) MarkTransactionsCanonical(blockHash string) error
MarkTransactionsCanonical updates transactions canonical for given block hash
func (TransactionsStore) MarkTransactionsOrphan ¶ added in v0.9.3
func (s TransactionsStore) MarkTransactionsOrphan(height uint64) error
MarkTransactionsOrphan updates all transactions as non canonical at a height
func (TransactionsStore) Search ¶
func (s TransactionsStore) Search(search TransactionSearch) ([]model.Transaction, error)
Search returns a list of transactions that matches the filters
type ValidatorsEpochsStore ¶ added in v0.11.0
type ValidatorsEpochsStore struct {
// contains filtered or unexported fields
}
ValidatorsEpochsStore handles operations on validator epochs
func NewValidatorsEpochsStore ¶ added in v0.11.0
func NewValidatorsEpochsStore(db *gorm.DB) ValidatorsEpochsStore
func (ValidatorsEpochsStore) Create ¶ added in v0.11.0
func (s ValidatorsEpochsStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (ValidatorsEpochsStore) DeleteByHeight ¶ added in v0.11.0
DeleteByHeight removes all records associated with a height
func (*ValidatorsEpochsStore) GetLastValidatorEpoch ¶ added in v0.12.0
func (s *ValidatorsEpochsStore) GetLastValidatorEpoch(address string) (*model.ValidatorEpoch, error)
GetLastValidatorEpoch returns the most recent validator epoch record
func (*ValidatorsEpochsStore) GetValidatorEpochs ¶ added in v0.11.0
func (s *ValidatorsEpochsStore) GetValidatorEpochs(epoch string, accountAddress string) ([]model.ValidatorEpoch, error)
GetValidatorEpochs fetches validator epochs
func (ValidatorsEpochsStore) Import ¶ added in v0.11.0
func (s ValidatorsEpochsStore) Import(records []model.ValidatorEpoch) error
Import creates or updates validator records in bulk
type ValidatorsStore ¶
type ValidatorsStore struct {
// contains filtered or unexported fields
}
ValidatorsStore handles operations on validators
func NewValidatorsStore ¶
func NewValidatorsStore(db *gorm.DB) ValidatorsStore
func (ValidatorsStore) Create ¶
func (s ValidatorsStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (ValidatorsStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (ValidatorsStore) FindAll ¶
func (s ValidatorsStore) FindAll() (result []model.Validator, err error)
FindAll returns all available validators
func (ValidatorsStore) FindByPublicKey ¶
func (s ValidatorsStore) FindByPublicKey(key string) (*model.Validator, error)
FindByPublicKey returns a validator record associated with a key
func (ValidatorsStore) Import ¶
func (s ValidatorsStore) Import(records []model.Validator) error
Import creates or updates validator records in bulk
func (ValidatorsStore) Index ¶
func (s ValidatorsStore) Index() ([]byte, error)
func (ValidatorsStore) Truncate ¶
func (s ValidatorsStore) Truncate() error
Truncate removes all records from the table
func (ValidatorsStore) Update ¶
func (s ValidatorsStore) Update(record interface{}) error
Update updates the existing record. Must pass a pointer.
func (ValidatorsStore) UpdateFee ¶ added in v0.14.0
func (s ValidatorsStore) UpdateFee(key string, value float64) error
UpdateFee updates the validator fee
func (ValidatorsStore) UpdateIdentity ¶
func (s ValidatorsStore) UpdateIdentity(key string, name string) error
UpdateIdentity updates the identity name of the validator
func (ValidatorsStore) UpdateStaking ¶
func (s ValidatorsStore) UpdateStaking() error