Documentation ¶
Index ¶
- Constants
- Variables
- func BuildBlockDistributionKey() []byte
- func BuildCommunityFeePoolKey() []byte
- func BuildDelegatorEarningStartInfoKey(validatorAddr btypes.ValAddress, delegatorAddress btypes.AccAddress) []byte
- func BuildDelegatorPeriodIncomeKey(validatorAddr btypes.ValAddress, delegatorAddress btypes.AccAddress, ...) []byte
- func BuildDelegatorPeriodIncomePrefixKey(height int64) []byte
- func BuildLastProposerKey() []byte
- func BuildQueryDelegatorIncomeInfoCustomQueryPath(delegator btypes.AccAddress, valAddr btypes.ValAddress) string
- func BuildQueryValidatorPeriodInfoCustomQueryPath(valAddr btypes.ValAddress) string
- func BuildValidatorCurrentPeriodSummaryKey(validatorAddr btypes.ValAddress) []byte
- func BuildValidatorEcoFeePoolKey(validatorAddr btypes.ValAddress) []byte
- func BuildValidatorHistoryPeriodSummaryKey(validatorAddr btypes.ValAddress, period int64) []byte
- func BuildValidatorHistoryPeriodSummaryPrefixKey(validatorAddr btypes.ValAddress) []byte
- func GetDelegatorEarningStartInfoAddr(key []byte) (valAddr btypes.ValAddress, deleAddr btypes.AccAddress)
- func GetDelegatorEarningsStartInfoPrefixKey() []byte
- func GetDelegatorPeriodIncomeHeightAddr(key []byte) (valAddr btypes.ValAddress, deleAddr btypes.AccAddress, height int64)
- func GetDelegatorPeriodIncomePrefixKey() []byte
- func GetValidatorCurrentPeriodSummaryAddr(key []byte) btypes.ValAddress
- func GetValidatorCurrentPeriodSummaryPrefixKey() []byte
- func GetValidatorEcoFeePoolPrefixKey() []byte
- func GetValidatorEcoPoolAddress(key []byte) btypes.ValAddress
- func GetValidatorHistoryPeriodSummaryAddrPeriod(key []byte) (valAddr btypes.ValAddress, period int64)
- func GetValidatorHistoryPeriodSummaryPrefixKey() []byte
- func RegisterCodec(cdc *amino.Codec)
- func ValidateGenesis(data GenesisState) error
- type DelegatorEarningStartState
- type DelegatorEarningsStartInfo
- type DelegatorIncomeHeightState
- type GenesisState
- type Params
- type ValidatorCurrentPeriodState
- type ValidatorCurrentPeriodSummary
- type ValidatorEcoFeePool
- type ValidatorEcoFeePoolState
- type ValidatorHistoryPeriodState
Constants ¶
View Source
const ( AddrLen = 20 MapperName = "distribution" Distribution = "distribution" ValidatorPeriodInfo = "validatorPeriodInfo" DelegatorIncomeInfo = "delegatorIncomeInfo" )
Variables ¶
View Source
var ( // 事件类型 EventTypeProposerReward = "proposer_reward" // 提议奖励 EventTypeDelegatorRewards = "delegator_rewards" // 所有委托奖励 EventTypeCommunity = "community" // 社区费池 EventTypeCommission = "commission" // 佣金 EventTypeDelegatorReward = "delegator_reward" // 委托奖励 EventTypeDelegate = "delegate" // 委托 // 事件参数 AttributeKeyTokens = "tokens" // tokens数量 AttributeKeyValidator = "validator" // 验证节点 AttributeKeyDelegator = "delegator" // 委托账户 )
Distribution module event types
View Source
var ( ParamSpace = "distribution" // keys for distribution p KeyProposerRewardRate = []byte("proposer_reward_rate") KeyCommunityRewardRate = []byte("community_reward_rate") KeyDelegatorsIncomePeriodHeight = []byte("delegator_income_period_height") KeyGasPerUnitCost = []byte("gas_per_unit_cost") )
View Source
var Cdc = baseabci.MakeQBaseCodec()
Functions ¶
func BuildBlockDistributionKey ¶
func BuildBlockDistributionKey() []byte
func BuildCommunityFeePoolKey ¶
func BuildCommunityFeePoolKey() []byte
func BuildDelegatorEarningStartInfoKey ¶
func BuildDelegatorEarningStartInfoKey(validatorAddr btypes.ValAddress, delegatorAddress btypes.AccAddress) []byte
func BuildDelegatorPeriodIncomeKey ¶
func BuildDelegatorPeriodIncomeKey(validatorAddr btypes.ValAddress, delegatorAddress btypes.AccAddress, height int64) []byte
func BuildLastProposerKey ¶
func BuildLastProposerKey() []byte
func BuildQueryDelegatorIncomeInfoCustomQueryPath ¶
func BuildQueryDelegatorIncomeInfoCustomQueryPath(delegator btypes.AccAddress, valAddr btypes.ValAddress) string
func BuildQueryValidatorPeriodInfoCustomQueryPath ¶
func BuildQueryValidatorPeriodInfoCustomQueryPath(valAddr btypes.ValAddress) string
func BuildValidatorCurrentPeriodSummaryKey ¶
func BuildValidatorCurrentPeriodSummaryKey(validatorAddr btypes.ValAddress) []byte
func BuildValidatorEcoFeePoolKey ¶
func BuildValidatorEcoFeePoolKey(validatorAddr btypes.ValAddress) []byte
func BuildValidatorHistoryPeriodSummaryKey ¶
func BuildValidatorHistoryPeriodSummaryKey(validatorAddr btypes.ValAddress, period int64) []byte
func BuildValidatorHistoryPeriodSummaryPrefixKey ¶
func BuildValidatorHistoryPeriodSummaryPrefixKey(validatorAddr btypes.ValAddress) []byte
func GetDelegatorEarningStartInfoAddr ¶
func GetDelegatorEarningStartInfoAddr(key []byte) (valAddr btypes.ValAddress, deleAddr btypes.AccAddress)
func GetDelegatorEarningsStartInfoPrefixKey ¶
func GetDelegatorEarningsStartInfoPrefixKey() []byte
func GetDelegatorPeriodIncomeHeightAddr ¶
func GetDelegatorPeriodIncomeHeightAddr(key []byte) (valAddr btypes.ValAddress, deleAddr btypes.AccAddress, height int64)
func GetDelegatorPeriodIncomePrefixKey ¶
func GetDelegatorPeriodIncomePrefixKey() []byte
func GetValidatorCurrentPeriodSummaryAddr ¶
func GetValidatorCurrentPeriodSummaryAddr(key []byte) btypes.ValAddress
func GetValidatorCurrentPeriodSummaryPrefixKey ¶
func GetValidatorCurrentPeriodSummaryPrefixKey() []byte
func GetValidatorEcoFeePoolPrefixKey ¶
func GetValidatorEcoFeePoolPrefixKey() []byte
func GetValidatorEcoPoolAddress ¶
func GetValidatorEcoPoolAddress(key []byte) btypes.ValAddress
func GetValidatorHistoryPeriodSummaryAddrPeriod ¶
func GetValidatorHistoryPeriodSummaryAddrPeriod(key []byte) (valAddr btypes.ValAddress, period int64)
func GetValidatorHistoryPeriodSummaryPrefixKey ¶
func GetValidatorHistoryPeriodSummaryPrefixKey() []byte
func RegisterCodec ¶
func RegisterCodec(cdc *amino.Codec)
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
Types ¶
type DelegatorEarningStartState ¶
type DelegatorEarningStartState struct { OperatorAddress btypes.ValAddress `json:"validator_address"` ConsPubKey string `json:"consensus_pubkey"` DeleAddress btypes.AccAddress `json:"delegator_address"` DelegatorEarningsStartInfo DelegatorEarningsStartInfo `json:"earning_start_info"` }
type DelegatorEarningsStartInfo ¶
type DelegatorEarningsStartInfo struct { PreviousPeriod int64 `json:"previous_period"` // 前收益计算点 BondToken btypes.BigInt `json:"bond_token"` // 绑定tokens CurrentStartingHeight int64 `json:"earns_starting_height"` // 当前计算周期起始高度 FirstDelegateHeight int64 `json:"first_delegate_height"` // 首次委托高度 HistoricalRewardFees btypes.BigInt `json:"historical_rewards"` // 累计未发放奖励 LastIncomeCalHeight int64 `json:"last_income_calHeight"` // 最后收益计算高度 LastIncomeCalFees btypes.BigInt `json:"last_income_calFees"` // 最后一次发放收益 }
DelegatorEarningsStartInfo delegator计算收益信息
type DelegatorIncomeHeightState ¶
type DelegatorIncomeHeightState struct { OperatorAddress btypes.ValAddress `json:"validator_address"` ConsPubKey string `json:"consensus_pubkey"` DeleAddress btypes.AccAddress `json:"delegator_address"` Height int64 `json:"height"` }
type GenesisState ¶
type GenesisState struct { CommunityFeePool btypes.BigInt `json:"community_fee_pool"` // 社区费池 LastBlockProposer btypes.ConsAddress `json:"last_block_proposer"` // 最新区块提议验证节点共识地址 PreDistributionQOSAmount btypes.BigInt `json:"pre_distribute_amount"` // 代分发奖励 ValidatorHistoryPeriods []ValidatorHistoryPeriodState `json:"validators_history_period"` // 验证节点收益历史节点信息 ValidatorCurrentPeriods []ValidatorCurrentPeriodState `json:"validators_current_period"` // 验证节点当前收益信息 DelegatorEarningInfos []DelegatorEarningStartState `json:"delegator_earning_info"` // 委托收益信息 DelegatorIncomeHeights []DelegatorIncomeHeightState `json:"delegator_income_height"` // 委托收益发放高度 ValidatorEcoFeePools []ValidatorEcoFeePoolState `json:"validator_eco_fee_pools"` // 验证节点委托共享费池 Params Params `json:"params"` // 参数 }
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
func NewGenesisState ¶
func NewGenesisState(communityFeePool btypes.BigInt, lastBlockProposer btypes.ConsAddress, preDistributionQOSAmount btypes.BigInt, validatorHistoryPeriods []ValidatorHistoryPeriodState, validatorCurrentPeriods []ValidatorCurrentPeriodState, delegatorEarningInfos []DelegatorEarningStartState, delegatorIncomeHeights []DelegatorIncomeHeightState, validatorEcoFeePools []ValidatorEcoFeePoolState, params Params) GenesisState
type Params ¶
type Params struct { ProposerRewardRate qtypes.Dec `json:"proposer_reward_rate"` // 块提议者奖励比例 CommunityRewardRate qtypes.Dec `json:"community_reward_rate"` // 社区奖励比例 DelegatorsIncomePeriodHeight int64 `json:"delegator_income_period_height"` // 奖励发放周期 GasPerUnitCost int64 `json:"gas_per_unit_cost"` // 1QOS折算Gas量 }
func DefaultParams ¶
func DefaultParams() Params
func (*Params) SetKeyValue ¶ added in v0.0.8
设置单个参数,不同数据类型对应不同处理
type ValidatorCurrentPeriodState ¶
type ValidatorCurrentPeriodState struct { OperatorAddress btypes.ValAddress `json:"validator_address"` ConsPubKey string `json:"consensus_pubkey"` CurrentPeriodSummary ValidatorCurrentPeriodSummary `json:"current_period_summary"` }
type ValidatorCurrentPeriodSummary ¶
type ValidatorCurrentPeriodSummary struct { Fees btypes.BigInt `json:"fees"` Period int64 `json:"period"` }
ValidatorCurrentPeriodSummary validator当前周期收益信息
type ValidatorEcoFeePool ¶
type ValidatorEcoFeePool struct { ProposerTotalRewardFee btypes.BigInt `json:"proposerTotalRewardFee"` //validator 通过proposer获取的总收益 CommissionTotalRewardFee btypes.BigInt `json:"commissionTotalRewardFee"` //validator 通过投票获取的佣金总收益 PreDistributeTotalRewardFee btypes.BigInt `json:"preDistributeTotalRewardFee"` //validator 通过投票获取的待分配金额总收益 PreDistributeRemainTotalFee btypes.BigInt `json:"preDistributeRemainTotalFee"` //validator 待分配金额中剩余的收益 }
ValidatorEcoFeePool validator收益信息
func NewValidatorEcoFeePool ¶
func NewValidatorEcoFeePool() ValidatorEcoFeePool
type ValidatorEcoFeePoolState ¶
type ValidatorEcoFeePoolState struct { OperatorAddress btypes.ValAddress `json:"validator_address"` EcoFeePool ValidatorEcoFeePool `json:"eco_fee_pool"` }
Click to show internal directories.
Click to hide internal directories.