Documentation ¶
Index ¶
- Constants
- type Repository
- func (r *Repository) AddPk(id uint, pk string) error
- func (r *Repository) AddUnbond(unbond *models.Unbond) error
- func (r *Repository) DeleteFromWaitList(addressId, validatorId uint, coins []uint64) error
- func (r *Repository) DeleteStakesByValidatorIds(idList []uint64) error
- func (r *Repository) DeleteStakesNotInListIds(idList []uint64) error
- func (r *Repository) FindIdByPk(pk string) (uint, error)
- func (r *Repository) FindIdByPkOrCreate(pk string) (uint, error)
- func (r *Repository) FindPkId(pk string) (uint, error)
- func (r *Repository) GetById(id uint) (*models.Validator, error)
- func (r *Repository) RemoveFromWaitList(addressId, validatorId uint) error
- func (r *Repository) ResetAllStatuses() error
- func (r *Repository) SaveAllIfNotExist(validators map[string]struct{}) error
- func (r *Repository) SaveAllStakes(stakes []*models.Stake) error
- func (r *Repository) SaveBan(ban *models.ValidatorBan) error
- func (r *Repository) Update(validator *models.Validator) error
- func (r *Repository) UpdateAll(validators []*models.Validator) error
- func (r *Repository) UpdateStake(s *models.Stake) error
- func (r *Repository) UpdateStakes(list []*models.Stake) error
- type Service
- func (s *Service) GetStakesFromCandidateResponse(response *api_pb.CandidateResponse) ([]*models.Stake, error)
- func (s *Service) GetUnbondSaverJobChannel() chan *models.Transaction
- func (s *Service) GetUpdateStakesJobChannel() chan int
- func (s *Service) GetUpdateValidatorsJobChannel() chan int
- func (s *Service) GetUpdateWaitListJobChannel() chan *models.Transaction
- func (s *Service) HandleBlockResponse(response *api_pb.BlockResponse) error
- func (s *Service) HandleCandidateResponse(response *api_pb.CandidateResponse) (*models.Validator, []*models.Stake, error)
- func (s *Service) SetChasingMode(chasingMode bool)
- func (s *Service) UnbondSaverWorker(data <-chan *models.Transaction)
- func (s *Service) UpdateStakesWorker(jobs <-chan int)
- func (s *Service) UpdateValidatorsWorker(jobs <-chan int)
- func (s *Service) UpdateWaitList(adr, pk string) error
- func (s *Service) UpdateWaitListWorker(data <-chan *models.Transaction)
Constants ¶
View Source
const UnbondBlockCount = 518400
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *pg.DB, logger *logrus.Entry) *Repository
func (*Repository) DeleteFromWaitList ¶
func (r *Repository) DeleteFromWaitList(addressId, validatorId uint, coins []uint64) error
func (*Repository) DeleteStakesByValidatorIds ¶
func (r *Repository) DeleteStakesByValidatorIds(idList []uint64) error
func (*Repository) DeleteStakesNotInListIds ¶
func (r *Repository) DeleteStakesNotInListIds(idList []uint64) error
func (*Repository) FindIdByPk ¶
func (r *Repository) FindIdByPk(pk string) (uint, error)
Find validator with public key. Return Validator ID
func (*Repository) FindIdByPkOrCreate ¶
func (r *Repository) FindIdByPkOrCreate(pk string) (uint, error)
Find validator with public key or create if not exist. Return Validator ID
func (*Repository) RemoveFromWaitList ¶
func (r *Repository) RemoveFromWaitList(addressId, validatorId uint) error
func (*Repository) ResetAllStatuses ¶
func (r *Repository) ResetAllStatuses() error
func (*Repository) SaveAllIfNotExist ¶
func (r *Repository) SaveAllIfNotExist(validators map[string]struct{}) error
Save list of validators if not exist
func (*Repository) SaveAllStakes ¶
func (r *Repository) SaveAllStakes(stakes []*models.Stake) error
func (*Repository) SaveBan ¶ added in v2.12.0
func (r *Repository) SaveBan(ban *models.ValidatorBan) error
func (*Repository) UpdateStake ¶
func (r *Repository) UpdateStake(s *models.Stake) error
func (*Repository) UpdateStakes ¶ added in v2.12.7
func (r *Repository) UpdateStakes(list []*models.Stake) error
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(env *env.ExtenderEnvironment, nodeApi *grpc_client.Client, repository *Repository, addressRepository *address.Repository, coinRepository *coin.Repository, logger *logrus.Entry) *Service
func (*Service) GetStakesFromCandidateResponse ¶
func (*Service) GetUnbondSaverJobChannel ¶
func (s *Service) GetUnbondSaverJobChannel() chan *models.Transaction
func (*Service) GetUpdateStakesJobChannel ¶
func (*Service) GetUpdateValidatorsJobChannel ¶
func (*Service) GetUpdateWaitListJobChannel ¶
func (s *Service) GetUpdateWaitListJobChannel() chan *models.Transaction
func (*Service) HandleBlockResponse ¶
func (s *Service) HandleBlockResponse(response *api_pb.BlockResponse) error
Get validators PK from response and store it to validators table if not exist
func (*Service) HandleCandidateResponse ¶
func (*Service) SetChasingMode ¶
func (*Service) UnbondSaverWorker ¶
func (s *Service) UnbondSaverWorker(data <-chan *models.Transaction)
func (*Service) UpdateStakesWorker ¶
func (*Service) UpdateValidatorsWorker ¶
func (*Service) UpdateWaitList ¶
func (*Service) UpdateWaitListWorker ¶
func (s *Service) UpdateWaitListWorker(data <-chan *models.Transaction)
Click to show internal directories.
Click to hide internal directories.