Documentation
¶
Index ¶
- Constants
- func CalcClusterOnChainBalance(curBlock uint64, clusterInfo *ClusterInfo) string
- func GetStatusDescription(status string) string
- type AlarmInfo
- type BlockChange
- type BlockInfo
- type ChartData
- type ClusterInfo
- type CumulativeValue
- type EventInfo
- type FeeAddressInfo
- type NetworkInfo
- type OperatorInfo
- type SSVReward
- type ScanPoint
- type Store
- func (s *Store) AdminGetValidators(page int, itemsPerPage int) ([]ValidatorInfo, int64, error)
- func (s *Store) BatchUpdateOperatorValidatorCount(operatorIds []uint64, increment bool) error
- func (s *Store) BatchUpdateOperatorValidatorCounts(operatorIds []uint64, count uint32, increment bool) error
- func (s *Store) CalculateChartData() ([]ChartData, error)
- func (s *Store) CancelUpdateOperatorFee(operatorId uint64) error
- func (s *Store) ClusterLiquidation(clusterID string, liquidationBlock uint64) error
- func (s *Store) CreateBlock(info *BlockInfo) error
- func (s *Store) CreateEvent(events []*EventInfo) error
- func (s *Store) CreateOperator(info *OperatorInfo) error
- func (s *Store) CreateOrUpdateAlarmInfo(info *AlarmInfo) error
- func (s *Store) CreateOrUpdateCluster(info *ClusterInfo) error
- func (s *Store) CreateOrUpdateClusterFeeAddress(info *FeeAddressInfo) error
- func (s *Store) CreateOrUpdateSSVReward(merkleRoot, account string, amountInt *big.Int, proofs string) error
- func (s *Store) CreateValidator(info *ValidatorInfo) error
- func (s *Store) DeleteAlarmByEoaOwner(eoaOwner string) error
- func (s *Store) ExitValidator(publicKey string, exitBlock int64) error
- func (s *Store) Get30DayLiquidationRankingClusters(page int, itemsPerPage int, curBlock uint64) ([]ClusterInfo, int64, error)
- func (s *Store) Get30DaySimulatedLiquidationRankingClusters(page int, itemsPerPage int, curBlock uint64) ([]ClusterInfo, int64, error)
- func (s *Store) GetActiveButExitedValidatorCount(clusterId string) (int64, error)
- func (s *Store) GetActiveButExitedValidators(page int, itemsPerPage int) ([]ValidatorInfo, int64, error)
- func (s *Store) GetActiveButExitedValidatorsByClusterId(clusterId string) ([]ValidatorInfo, error)
- func (s *Store) GetActiveClusterCount() (int64, error)
- func (s *Store) GetActiveClusters() ([]ClusterInfo, error)
- func (s *Store) GetActiveOperatorCount() (int64, error)
- func (s *Store) GetActiveValidatorCount() (int64, error)
- func (s *Store) GetAlarmByEoaOwner(eoaOwner string) (*AlarmInfo, error)
- func (s *Store) GetAllAlarmInfos() ([]AlarmInfo, error)
- func (s *Store) GetAllBlocks() ([]BlockInfo, error)
- func (s *Store) GetAllClusterByEoaOwner(owner string) ([]ClusterInfo, error)
- func (s *Store) GetAllClusters() ([]ClusterInfo, error)
- func (s *Store) GetAllSSVRewardAccount() ([]string, error)
- func (s *Store) GetAllValidatorsByClusterId(clusterId string) ([]ValidatorInfo, error)
- func (s *Store) GetBlockByClusterId(page int, itemsPerPage int, clusterID string) ([]BlockInfo, int64, error)
- func (s *Store) GetBlockInfoByClusterId(clusterId string) (int64, int64, error)
- func (s *Store) GetClusterByClusterId(clusterId string) (*ClusterInfo, error)
- func (s *Store) GetClusterByOwner(page, itemsPerPage int, owner string) ([]ClusterInfo, int64, error)
- func (s *Store) GetClusterFeeAddress(owner string) (FeeAddressInfo, error)
- func (s *Store) GetClusterOfflineValidatorCount(clusterId string) (int64, error)
- func (s *Store) GetClusters(page int, itemsPerPage int) ([]ClusterInfo, int64, error)
- func (s *Store) GetEventByAccount(page int, itemsPerPage int, owner string) ([]EventInfo, int64, error)
- func (s *Store) GetEventByClusterId(page int, itemsPerPage int, clusterID string) ([]EventInfo, int64, error)
- func (s *Store) GetLatestBlocks() ([]BlockInfo, error)
- func (s *Store) GetLatestEvents() ([]EventInfo, error)
- func (s *Store) GetLatestValidators() ([]ValidatorInfo, error)
- func (s *Store) GetMaxOperatorId() (uint64, error)
- func (s *Store) GetMerkleRoot() (string, error)
- func (s *Store) GetNetworkInfo() (*NetworkInfo, error)
- func (s *Store) GetNoUpdatedClustersOwner() ([]string, error)
- func (s *Store) GetOperatorByOperatorId(operatorId uint64) (*OperatorInfo, error)
- func (s *Store) GetOperatorByOperatorName(page, itemsPerPage int, operatorName string) ([]OperatorInfo, int64, error)
- func (s *Store) GetOperatorByOwner(page, itemsPerPage int, owner string) ([]OperatorInfo, int64, error)
- func (s *Store) GetOperatorValidatorCount(clusterIdsStr string) (uint32, error)
- func (s *Store) GetOperators(page int, itemsPerPage int) ([]OperatorInfo, int64, error)
- func (s *Store) GetSSVReward(account string) SSVReward
- func (s *Store) GetScanPoint() (uint64, uint64, error)
- func (s *Store) GetTotalBlockCount() (int64, error)
- func (s *Store) GetValidatorByClusterId(page int, itemsPerPage int, clusterId string) ([]ValidatorInfo, int64, error)
- func (s *Store) GetValidatorByOwner(page int, itemsPerPage int, owner string) ([]ValidatorInfo, int64, error)
- func (s *Store) GetValidatorByPubKeyAndBlock(publicKey string, block uint64) (*ValidatorInfo, error)
- func (s *Store) GetValidatorByPublicKey(publicKey string) (*ValidatorInfo, error)
- func (s *Store) GetValidatorByValidatorIndex(validatorIndex int64) (*ValidatorInfo, error)
- func (s *Store) GetValidatorTotalBlockCount(pubKey string) (int64, error)
- func (s *Store) GetValidators(page int, itemsPerPage int) ([]ValidatorInfo, int64, error)
- func (s *Store) RemoveOperator(operatorId uint64, removeBlock int64) error
- func (s *Store) RemoveValidator(publicKey, clusterId string, removeBlock int64) error
- func (s *Store) TxHashLogIndexIsExist(txHash string, logIndex uint) bool
- func (s *Store) UpdateClusterEoaOwner(owner string, eoaOwner string) error
- func (s *Store) UpdateClusterLiquidationInfo(clusterID string, liquidationBlock uint64, calculateLiquidationBlock uint64, ...) error
- func (s *Store) UpdateClusterStatus(clusterID string, status string) error
- func (s *Store) UpdateOperatorClusterIds(operatorId uint64, clusterId string, increment bool) error
- func (s *Store) UpdateOperatorEarning(operatorId uint64, earning string) error
- func (s *Store) UpdateOperatorFee(operatorId uint64, fee string) error
- func (s *Store) UpdateOperatorName(operatorId uint64, name string) error
- func (s *Store) UpdateOperatorPrivacyStatus(operatorId uint64, status bool) error
- func (s *Store) UpdateOperatorValidatorCount(operatorId uint64, count uint32) error
- func (s *Store) UpdatePendingOperator(operatorId uint64, pendingFee string, beginTime, endTime uint64) error
- func (s *Store) UpdateScanEth1Block(block uint64) error
- func (s *Store) UpdateScanEth2Slot(slot uint64) error
- func (s *Store) UpdateUpcomingClusterLiquidationInfo(clusterID string, upcomingLiquidationBlock uint64, upcomingCalcTime int64, ...) error
- func (s *Store) UpdateUpcomingNetworkFee(fee uint64) error
- func (s *Store) UpdateValidatorIndex(publicKey string, index int64) error
- func (s *Store) UpdateValidatorOnlineStatus(validatorIndex int64, status bool) error
- func (s *Store) UpdateValidatorOnlineStatusByPubKey(pubKey string, status bool) error
- func (s *Store) UpdateValidatorStatus(publicKey string, status string) error
- func (s *Store) UpdateWhitelistedAddress(operatorId uint64, whitelistedAddress string) error
- func (s *Store) UpdateWhitelistingContract(operatorId uint64, whitelistingContract string) error
- func (s *Store) ValidatorSlash(publicKey string) error
- type ValidatorInfo
Constants ¶
View Source
const ( PendingInitialized = "pending_initialized" // Pending PendingQueued = "pending_queued" // Pending ActiveOngoing = "active_ongoing" // Active ActiveExiting = "active_exiting" // Active ActiveSlashed = "active_slashed" // Slashed ExitedUnSlashed = "exited_unslashed" // Exited ExitedSlashed = "exited_slashed" // Slashed WithdrawalPossible = "withdrawal_possible" // Withdrawal WithdrawalDone = "withdrawal_done" // Withdrawal )
View Source
const ( ValidatorPending = "Pending" ValidatorActive = "Active" ValidatorSlashed = "Slashed" ValidatorExited = "Exited" ValidatorUnknown = "Unknown" )
View Source
const DefaultValidatorIndex = int64(-1)
Variables ¶
This section is empty.
Functions ¶
func CalcClusterOnChainBalance ¶
func CalcClusterOnChainBalance(curBlock uint64, clusterInfo *ClusterInfo) string
func GetStatusDescription ¶
Types ¶
type AlarmInfo ¶
type AlarmInfo struct {
gorm.Model
EoaOwner string `gorm:"type:VARCHAR(64); uniqueIndex" json:"eoa_owner"`
AlarmType int `json:"alarm_type"`
AlarmChannel string `json:"alarm_channel"`
AlarmChannelHash string `json:"alarm_channel_hash"`
ReportLiquidationThreshold uint64 `json:"report_liquidation_threshold"`
ReportOperatorFeeChange bool `json:"report_operator_fee_change"`
ReportNetworkFeeChange bool `json:"report_network_fee_change"`
ReportProposeBlock bool `json:"report_propose_block"`
ReportMissedBlock bool `json:"report_missed_block"`
ReportBalanceDecrease bool `json:"report_balance_decrease"`
ReportExitedButNotRemoved bool `json:"report_exited_but_not_removed"`
ReportWeekly bool `json:"report_weekly"`
}
type BlockChange ¶
type BlockInfo ¶
type BlockInfo struct {
gorm.Model
ClusterID string `gorm:"type:VARCHAR(64); index" json:"cluster_id"`
BlockNumber uint64 `json:"block_number"`
Epoch uint64 `json:"epoch"`
Slot uint64 `gorm:"uniqueIndex" json:"slot"`
Proposer uint64 `json:"proposer"`
PublicKey string `json:"public_key"`
IsMissed bool `gorm:"index" json:"is_missed"`
}
type ClusterInfo ¶
type ClusterInfo struct {
gorm.Model
ClusterID string `gorm:"type:VARCHAR(64); uniqueIndex" json:"cluster_id"`
Owner string `gorm:"type:VARCHAR(64); index" json:"owner"`
EoaOwner string `gorm:"type:VARCHAR(64); index" json:"eoa_owner"`
OperatorIds string `json:"operator_ids"`
ValidatorCount uint32 `gorm:"index" json:"validator_count"`
NetworkFeeIndex uint64 `json:"network_fee_index"`
Index uint64 `json:"cluster_index"`
Active bool `json:"active"`
Balance string `json:"balance"`
BurnFee uint64 `json:"burn_fee"`
OnChainBalance string `json:"on_chain_balance"`
LiquidationBlock uint64 `json:"liquidation_block"`
CalcLiquidationBlock uint64 `json:"calc_liquidation_block"`
UpcomingBurnFee uint64 `gorm:"default:0" json:"upcoming_burn_fee"`
UpcomingLiquidationBlock uint64 `gorm:"default:0" json:"upcoming_liquidation_block"`
UpcomingCalcTime int64 `gorm:"default:0" json:"upcoming_calc_time"`
}
func (*ClusterInfo) TableName ¶
func (s *ClusterInfo) TableName() string
type CumulativeValue ¶
type CumulativeValue struct {
// contains filtered or unexported fields
}
type EventInfo ¶
type EventInfo struct {
gorm.Model
BlockNumber uint64 `gorm:"block_number"`
Owner string `gorm:"type:VARCHAR(64); index" json:"owner"`
TxHash string `gorm:"type:VARCHAR(70); uniqueIndex:txhash_logindex" json:"tx_hash"`
LogIndex uint `gorm:"uniqueIndex:txhash_logindex" json:"log_index"`
Action string `json:"action"`
ClusterID string `gorm:"index" json:"cluster_id"`
}
type FeeAddressInfo ¶
type FeeAddressInfo struct {
gorm.Model
Owner string `gorm:"type:VARCHAR(64); uniqueIndex" json:"owner"`
FeeAddress string `json:"fee_address"`
}
func (*FeeAddressInfo) TableName ¶
func (s *FeeAddressInfo) TableName() string
type NetworkInfo ¶
func (*NetworkInfo) TableName ¶
func (s *NetworkInfo) TableName() string
type OperatorInfo ¶
type OperatorInfo struct {
gorm.Model
Owner string `json:"owner"`
OperatorId uint64 `gorm:"uniqueIndex" json:"operator_id"`
PubKey string `json:"pub_key"`
OperatorName string `json:"operator_name"`
ValidatorCount uint32 `json:"validator_count"`
ClusterIds string `json:"cluster_ids"`
OperatorFee string `json:"operator_fee"`
OperatorEarnings string `gorm:"default:-" json:"operator_earnings"`
PrivacyStatus bool `json:"privacy_status"`
WhitelistedAddress string `json:"whitelisted_address"`
WhitelistingContract string `json:"whitelisting_contract"`
RegistrationBlock int64 `gorm:"index" json:"registration_block"`
RemoveBlock int64 `gorm:"index" json:"remove_block"`
PendingOperatorFee string `gorm:"default:0;index" json:"pending_operator_fee"`
ApprovalBeginTime int64 `gorm:"default:0" json:"approval_begin_time"`
ApprovalEndTime int64 `gorm:"default:0" json:"approval_end_time"`
}
func (*OperatorInfo) TableName ¶
func (s *OperatorInfo) TableName() string
type SSVReward ¶
type ScanPoint ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AdminGetValidators ¶
func (*Store) BatchUpdateOperatorValidatorCount ¶
func (*Store) BatchUpdateOperatorValidatorCounts ¶
func (*Store) CalculateChartData ¶
func (*Store) CancelUpdateOperatorFee ¶
func (*Store) ClusterLiquidation ¶
func (*Store) CreateBlock ¶
func (*Store) CreateEvent ¶
func (*Store) CreateOperator ¶
func (s *Store) CreateOperator(info *OperatorInfo) error
func (*Store) CreateOrUpdateAlarmInfo ¶
func (*Store) CreateOrUpdateCluster ¶
func (s *Store) CreateOrUpdateCluster(info *ClusterInfo) error
func (*Store) CreateOrUpdateClusterFeeAddress ¶
func (s *Store) CreateOrUpdateClusterFeeAddress(info *FeeAddressInfo) error
func (*Store) CreateOrUpdateSSVReward ¶
func (*Store) CreateValidator ¶
func (s *Store) CreateValidator(info *ValidatorInfo) error
func (*Store) DeleteAlarmByEoaOwner ¶
DeleteAlarmByEoaOwner Unscoped delete
func (*Store) ExitValidator ¶
func (*Store) Get30DayLiquidationRankingClusters ¶
func (*Store) Get30DaySimulatedLiquidationRankingClusters ¶
func (*Store) GetActiveButExitedValidatorCount ¶
func (*Store) GetActiveButExitedValidators ¶
func (*Store) GetActiveButExitedValidatorsByClusterId ¶
func (s *Store) GetActiveButExitedValidatorsByClusterId(clusterId string) ([]ValidatorInfo, error)
func (*Store) GetActiveClusterCount ¶
func (*Store) GetActiveClusters ¶
func (s *Store) GetActiveClusters() ([]ClusterInfo, error)
func (*Store) GetActiveOperatorCount ¶
func (*Store) GetActiveValidatorCount ¶
func (*Store) GetAlarmByEoaOwner ¶
func (*Store) GetAllAlarmInfos ¶
func (*Store) GetAllBlocks ¶
func (*Store) GetAllClusterByEoaOwner ¶
func (s *Store) GetAllClusterByEoaOwner(owner string) ([]ClusterInfo, error)
func (*Store) GetAllClusters ¶
func (s *Store) GetAllClusters() ([]ClusterInfo, error)
func (*Store) GetAllSSVRewardAccount ¶
func (*Store) GetAllValidatorsByClusterId ¶
func (s *Store) GetAllValidatorsByClusterId(clusterId string) ([]ValidatorInfo, error)
GetAllValidatorsByClusterId should check is_slashed == false
func (*Store) GetBlockByClusterId ¶
func (*Store) GetBlockInfoByClusterId ¶
func (*Store) GetClusterByClusterId ¶
func (s *Store) GetClusterByClusterId(clusterId string) (*ClusterInfo, error)
func (*Store) GetClusterByOwner ¶
func (*Store) GetClusterFeeAddress ¶
func (s *Store) GetClusterFeeAddress(owner string) (FeeAddressInfo, error)
func (*Store) GetClusterOfflineValidatorCount ¶
func (*Store) GetClusters ¶
func (*Store) GetEventByAccount ¶
func (*Store) GetEventByClusterId ¶
func (*Store) GetLatestBlocks ¶
func (*Store) GetLatestEvents ¶
func (*Store) GetLatestValidators ¶
func (s *Store) GetLatestValidators() ([]ValidatorInfo, error)
func (*Store) GetMaxOperatorId ¶
func (*Store) GetMerkleRoot ¶
func (*Store) GetNetworkInfo ¶
func (s *Store) GetNetworkInfo() (*NetworkInfo, error)
func (*Store) GetNoUpdatedClustersOwner ¶
func (*Store) GetOperatorByOperatorId ¶
func (s *Store) GetOperatorByOperatorId(operatorId uint64) (*OperatorInfo, error)
func (*Store) GetOperatorByOperatorName ¶
func (*Store) GetOperatorByOwner ¶
func (*Store) GetOperatorValidatorCount ¶
func (*Store) GetOperators ¶
func (*Store) GetSSVReward ¶
func (*Store) GetTotalBlockCount ¶
func (*Store) GetValidatorByClusterId ¶
func (*Store) GetValidatorByOwner ¶
func (*Store) GetValidatorByPubKeyAndBlock ¶
func (s *Store) GetValidatorByPubKeyAndBlock(publicKey string, block uint64) (*ValidatorInfo, error)
func (*Store) GetValidatorByPublicKey ¶
func (s *Store) GetValidatorByPublicKey(publicKey string) (*ValidatorInfo, error)
func (*Store) GetValidatorByValidatorIndex ¶
func (s *Store) GetValidatorByValidatorIndex(validatorIndex int64) (*ValidatorInfo, error)
func (*Store) GetValidatorTotalBlockCount ¶
func (*Store) GetValidators ¶
func (*Store) RemoveOperator ¶
func (*Store) RemoveValidator ¶
func (*Store) TxHashLogIndexIsExist ¶
func (*Store) UpdateClusterEoaOwner ¶
func (*Store) UpdateClusterLiquidationInfo ¶
func (*Store) UpdateClusterStatus ¶
func (*Store) UpdateOperatorClusterIds ¶
func (*Store) UpdateOperatorEarning ¶
func (*Store) UpdateOperatorFee ¶
func (*Store) UpdateOperatorName ¶
func (*Store) UpdateOperatorPrivacyStatus ¶
func (*Store) UpdateOperatorValidatorCount ¶
func (*Store) UpdatePendingOperator ¶
func (*Store) UpdateScanEth1Block ¶
func (*Store) UpdateScanEth2Slot ¶
func (*Store) UpdateUpcomingClusterLiquidationInfo ¶
func (*Store) UpdateUpcomingNetworkFee ¶
func (*Store) UpdateValidatorIndex ¶
func (*Store) UpdateValidatorOnlineStatus ¶
func (*Store) UpdateValidatorOnlineStatusByPubKey ¶
func (*Store) UpdateValidatorStatus ¶
func (*Store) UpdateWhitelistedAddress ¶
func (*Store) UpdateWhitelistingContract ¶
func (*Store) ValidatorSlash ¶
type ValidatorInfo ¶
type ValidatorInfo struct {
gorm.Model
ClusterID string `gorm:"type:VARCHAR(64); uniqueIndex:clusterid_pubkey_registration_block; index" json:"cluster_id"`
Owner string `gorm:"type:VARCHAR(64); index" json:"owner"`
OperatorIds string `json:"operator_ids"`
PublicKey string `gorm:"type:VARCHAR(255); uniqueIndex:clusterid_pubkey_registration_block; index" json:"public_key"`
ValidatorIndex int64 `gorm:"index" json:"validator_index"`
RegistrationBlock int64 `gorm:"uniqueIndex:clusterid_pubkey_registration_block; index" json:"registration_block"`
RemoveBlock int64 `gorm:"index" json:"remove_block"`
ExitedBlock int64 `gorm:"index" json:"exited_block"`
IsSlashed bool `gorm:"default:false" json:"is_slashed"`
IsOnline bool `gorm:"default:true" json:"is_online"`
Status string `json:"status"`
}
func (*ValidatorInfo) TableName ¶
func (s *ValidatorInfo) TableName() string
Click to show internal directories.
Click to hide internal directories.