Documentation ¶
Index ¶
- Constants
- func FilteredPaginate(cdc codec.Codec, prefixStore storetypes.KVStore, ...) (*pagiquery.PageResponse, error)
- func GetIterator(prefixStore storetypes.KVStore, start []byte, reverse bool) db.Iterator
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func Paginate(prefixStore storetypes.KVStore, pageRequest *pagiquery.PageRequest, ...) (*pagiquery.PageResponse, error)
- func UnmarshalIndividualReward(cdc codec.Codec, value []byte) (v types.Reward, err error)
- type Keeper
- func (k Keeper) BondDenom(ctx sdk.Context) (res string)
- func (k Keeper) CalcCommunityTax(ctx sdk.Context, rewardBeforeTax sdkmath.LegacyDec) (reward sdk.Coin, tax sdkmath.LegacyDec)
- func (k Keeper) CalcMiningRewardInTotal(ctx sdk.Context, distributeGoal types.DistributeGoal) (types.DistributeGoal, error)
- func (k Keeper) CalcRewardForMetaNode(ctx sdk.Context, distributeGoalBalance types.DistributeGoal, ...) map[string]types.Reward
- func (k Keeper) CalcRewardForResourceNode(ctx sdk.Context, totalConsumedNoz sdkmath.LegacyDec, ...) map[string]types.Reward
- func (k Keeper) CalcTrafficRewardInTotal(ctx sdk.Context, distributeGoal types.DistributeGoal, ...) (types.DistributeGoal, error)
- func (k Keeper) DistributePotReward(ctx sdk.Context, trafficList []types.SingleWalletVolume, epoch sdkmath.Int) (err error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) (data *types.GenesisState)
- func (k Keeper) FoundationDeposit(ctx sdk.Context, amount sdk.Coins, from sdk.AccAddress) (err error)
- func (k Keeper) GetCirculationSupply(ctx sdk.Context) (circulationSupply sdk.Coins)
- func (k Keeper) GetCommunityTax(ctx sdk.Context) (res sdkmath.LegacyDec)
- func (k Keeper) GetCurrentNozPrice(St, Pt, Lt sdkmath.Int) (currentNozPrice sdkmath.LegacyDec)
- func (k Keeper) GetImmatureTotalReward(ctx sdk.Context, walletAddress sdk.AccAddress) (value sdk.Coins)
- func (k Keeper) GetIndividualReward(ctx sdk.Context, walletAddress sdk.AccAddress, matureEpoch sdkmath.Int) (value types.Reward, found bool)
- func (k Keeper) GetLastDistributedEpoch(ctx sdk.Context) (epoch sdkmath.Int)
- func (k Keeper) GetLegacyTotalReward(ctx sdk.Context, epoch sdkmath.Int) (totalReward types.TotalReward)
- func (k Keeper) GetMatureTotalReward(ctx sdk.Context, walletAddress sdk.AccAddress) (value sdk.Coins)
- func (k Keeper) GetMaturedEpoch(ctx sdk.Context) (epoch sdkmath.Int)
- func (k Keeper) GetMetrics(ctx sdk.Context) types.Metrics
- func (k Keeper) GetMiningRewardParamByMinedToken(ctx sdk.Context, minedToken sdk.Coin) (types.MiningRewardParam, error)
- func (k Keeper) GetParams(ctx sdk.Context) (p types.Params)
- func (k Keeper) GetPrepayAmount(Lt, tokenAmount, St, Pt sdkmath.Int) (purchaseNoz, remainingNoz sdkmath.Int, err error)
- func (k Keeper) GetSupply(ctx sdk.Context) (totalSupply sdk.Coin)
- func (k Keeper) GetTotalConsumedNoz(trafficList []types.SingleWalletVolume) sdkmath.Int
- func (k Keeper) GetTotalMinedTokens(ctx sdk.Context) (totalMinedToken sdk.Coin)
- func (k Keeper) GetTotalMining(ctx sdk.Context) sdk.Coin
- func (k Keeper) GetTotalReward(ctx sdk.Context, epoch sdkmath.Int) (totalReward types.TotalReward)
- func (k Keeper) GetTrafficReward(ctx sdk.Context, totalConsumedNoz sdkmath.LegacyDec) (result sdkmath.LegacyDec)
- func (k Keeper) GetVolumeReport(ctx sdk.Context, epoch sdkmath.Int) (res types.VolumeReportRecord)
- func (k Keeper) HasReachedThreshold(ctx sdk.Context, pubKeys [][]byte) bool
- func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)
- func (k Keeper) InitVariable(ctx sdk.Context)
- func (k Keeper) InitialTotalSupply(ctx sdk.Context) (res sdk.Coin)
- func (k Keeper) IteratorImmatureTotal(ctx sdk.Context, ...)
- func (k Keeper) IteratorIndividualReward(ctx sdk.Context, epoch sdkmath.Int, ...)
- func (k Keeper) IteratorMatureTotal(ctx sdk.Context, ...)
- func (k Keeper) IteratorTotalReward(ctx sdk.Context, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MatureEpoch(ctx sdk.Context) (res int64)
- func (k Keeper) MiningRewardParams(ctx sdk.Context) (res []types.MiningRewardParam)
- func (k Keeper) NozSupply(ctx sdk.Context) (remaining, total sdkmath.Int)
- func (k Keeper) RemoveIndividualReward(ctx sdk.Context, individualRewardKey []byte)
- func (k Keeper) RestoreTotalSupply(ctx sdk.Context) (minted, burned sdk.Coins)
- func (k Keeper) RewardDenom(ctx sdk.Context) (res string)
- func (k Keeper) RewardMatureAndSubSlashing(ctx sdk.Context) error
- func (k Keeper) SafeMintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
- func (k Keeper) SetImmatureTotalReward(ctx sdk.Context, walletAddress sdk.AccAddress, value sdk.Coins)
- func (k Keeper) SetIndividualReward(ctx sdk.Context, walletAddress sdk.AccAddress, matureEpoch sdkmath.Int, ...)
- func (k Keeper) SetLastDistributedEpoch(ctx sdk.Context, epoch sdkmath.Int)
- func (k Keeper) SetMatureTotalReward(ctx sdk.Context, walletAddress sdk.AccAddress, value sdk.Coins)
- func (k Keeper) SetMaturedEpoch(ctx sdk.Context, epoch sdkmath.Int)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error
- func (k Keeper) SetTotalMinedTokens(ctx sdk.Context, totalMinedToken sdk.Coin)
- func (k Keeper) SetTotalReward(ctx sdk.Context, epoch sdkmath.Int, totalReward types.TotalReward)
- func (k Keeper) SetVolumeReport(ctx sdk.Context, epoch sdkmath.Int, reportRecord types.VolumeReportRecord)
- func (k Keeper) SlashingResourceNode(ctx sdk.Context, p2pAddr stratos.SdsAddress, walletAddr sdk.AccAddress, ...) (tokenAmt sdkmath.Int, nodeType registertypes.NodeType, err error)
- func (k Keeper) VolumeReport(ctx sdk.Context, walletVolumes types.WalletVolumes, ...) (err error)
- func (k Keeper) Withdraw(ctx sdk.Context, amount sdk.Coins, walletAddress sdk.AccAddress, ...) error
- type Migrator
- type Querier
- func (q Querier) CirculationSupply(c context.Context, _ *types.QueryCirculationSupplyRequest) (*types.QueryCirculationSupplyResponse, error)
- func (q Querier) Metrics(c context.Context, req *types.QueryMetricsRequest) (*types.QueryMetricsResponse, error)
- func (q Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (q Querier) RewardsByEpoch(c context.Context, req *types.QueryRewardsByEpochRequest) (*types.QueryRewardsByEpochResponse, error)
- func (q Querier) RewardsByWallet(c context.Context, req *types.QueryRewardsByWalletRequest) (*types.QueryRewardsByWalletResponse, error)
- func (q Querier) RewardsByWalletAndEpoch(c context.Context, req *types.QueryRewardsByWalletAndEpochRequest) (*types.QueryRewardsByWalletAndEpochResponse, error)
- func (q Querier) SlashingByOwner(c context.Context, req *types.QuerySlashingByOwnerRequest) (*types.QuerySlashingByOwnerResponse, error)
- func (q Querier) TotalMinedToken(c context.Context, _ *types.QueryTotalMinedTokenRequest) (*types.QueryTotalMinedTokenResponse, error)
- func (q Querier) TotalRewardByEpoch(c context.Context, req *types.QueryTotalRewardByEpochRequest) (*types.QueryTotalRewardByEpochResponse, error)
- func (q Querier) VolumeReport(c context.Context, req *types.QueryVolumeReportRequest) (*types.QueryVolumeReportResponse, error)
Constants ¶
const (
MatureCountPerBlock = 100
)
Variables ¶
This section is empty.
Functions ¶
func FilteredPaginate ¶ added in v0.8.0
func FilteredPaginate(cdc codec.Codec, prefixStore storetypes.KVStore, pageRequest *pagiquery.PageRequest, onResult func(key []byte, value []byte, accumulate bool) (bool, error), ) (*pagiquery.PageResponse, error)
func GetIterator ¶ added in v0.8.0
func NewMsgServerImpl ¶ added in v0.8.0
NewMsgServerImpl returns an implementation of the bank MsgServer interface for the provided Keeper.
func Paginate ¶ added in v0.8.0
func Paginate( prefixStore storetypes.KVStore, pageRequest *pagiquery.PageRequest, onResult func(key []byte, value []byte) error, ) (*pagiquery.PageResponse, error)
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the pot store
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, key storetypes.StoreKey, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, distrKeeper types.DistrKeeper, registerKeeper types.RegisterKeeper, stakingKeeper types.StakingKeeper, authority string, ) Keeper
NewKeeper creates a pot keeper
func (Keeper) CalcCommunityTax ¶ added in v0.9.0
func (Keeper) CalcMiningRewardInTotal ¶
func (k Keeper) CalcMiningRewardInTotal(ctx sdk.Context, distributeGoal types.DistributeGoal) (types.DistributeGoal, error)
CalcMiningRewardInTotal allocate mining reward from foundation account
func (Keeper) CalcRewardForMetaNode ¶ added in v0.8.0
func (k Keeper) CalcRewardForMetaNode(ctx sdk.Context, distributeGoalBalance types.DistributeGoal, rewardDetailMap map[string]types.Reward, ) map[string]types.Reward
CalcRewardForMetaNode Iteration for calculating reward of meta nodes
func (Keeper) CalcRewardForResourceNode ¶
func (k Keeper) CalcRewardForResourceNode(ctx sdk.Context, totalConsumedNoz sdkmath.LegacyDec, trafficList []types.SingleWalletVolume, distributeGoal types.DistributeGoal, rewardDetailMap map[string]types.Reward, ) map[string]types.Reward
CalcRewardForResourceNode Iteration for calculating reward of resource nodes
func (Keeper) CalcTrafficRewardInTotal ¶
func (k Keeper) CalcTrafficRewardInTotal( ctx sdk.Context, distributeGoal types.DistributeGoal, totalConsumedNoz sdkmath.LegacyDec, ) (types.DistributeGoal, error)
func (Keeper) DistributePotReward ¶
func (Keeper) ExportGenesis ¶ added in v0.12.0
func (k Keeper) ExportGenesis(ctx sdk.Context) (data *types.GenesisState)
ExportGenesis writes the current store values to a genesis file, which can be imported again with InitGenesis
func (Keeper) FoundationDeposit ¶ added in v0.5.0
func (Keeper) GetCirculationSupply ¶ added in v0.10.0
func (Keeper) GetCommunityTax ¶ added in v0.9.0
func (Keeper) GetCurrentNozPrice ¶ added in v0.11.0
func (Keeper) GetImmatureTotalReward ¶
func (Keeper) GetIndividualReward ¶
func (Keeper) GetLastDistributedEpoch ¶ added in v0.10.0
func (Keeper) GetLegacyTotalReward ¶ added in v0.12.0
func (Keeper) GetMatureTotalReward ¶
func (Keeper) GetMaturedEpoch ¶ added in v0.10.0
func (Keeper) GetMetrics ¶ added in v0.11.3
func (Keeper) GetMiningRewardParamByMinedToken ¶
func (Keeper) GetPrepayAmount ¶ added in v0.11.0
func (Keeper) GetTotalConsumedNoz ¶ added in v0.9.0
func (k Keeper) GetTotalConsumedNoz(trafficList []types.SingleWalletVolume) sdkmath.Int
GetTotalConsumedNoz Iteration for getting total consumed OZ from traffic
func (Keeper) GetTotalMinedTokens ¶
func (Keeper) GetTotalMining ¶ added in v0.11.3
func (Keeper) GetTotalReward ¶ added in v0.11.0
func (Keeper) GetTrafficReward ¶ added in v0.7.0
func (k Keeper) GetTrafficReward(ctx sdk.Context, totalConsumedNoz sdkmath.LegacyDec) (result sdkmath.LegacyDec)
GetTrafficReward [S] is initial genesis deposit by all resource nodes and meta nodes at t=0 The current unissued prepay Volume Pool [pt] is the total remaining prepay wei kept by Stratos Network but not issued to Resource Node as rewards. At time t=0, pt=0 total consumed Ozone is [Y] The remaining total Ozone limit [lt] is the upper bound of total Ozone that users can purchase from Stratos blockchain. the total generated traffic rewards as [R] R = (S + Pt) * Y / (Lt + Y)
func (Keeper) GetVolumeReport ¶
func (Keeper) HasReachedThreshold ¶ added in v0.10.0
func (Keeper) InitGenesis ¶ added in v0.12.0
func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)
InitGenesis initialize default parameters and the keeper's address to pubkey map
func (Keeper) InitVariable ¶ added in v0.9.0
func (Keeper) InitialTotalSupply ¶ added in v0.10.0
func (Keeper) IteratorImmatureTotal ¶ added in v0.7.0
func (k Keeper) IteratorImmatureTotal(ctx sdk.Context, handler func(walletAddress sdk.AccAddress, immatureTotal sdk.Coins) (stop bool))
IteratorImmatureTotal Iteration for getting total immature reward
func (Keeper) IteratorIndividualReward ¶ added in v0.7.0
func (k Keeper) IteratorIndividualReward(ctx sdk.Context, epoch sdkmath.Int, handler func(walletAddress sdk.AccAddress, individualReward types.Reward) (stop bool))
IteratorIndividualReward Iteration for getting individual reward of each owner at a specific epoch
func (Keeper) IteratorMatureTotal ¶ added in v0.7.0
func (k Keeper) IteratorMatureTotal(ctx sdk.Context, handler func(walletAddress sdk.AccAddress, matureTotal sdk.Coins) (stop bool))
IteratorMatureTotal Iteration for getting total mature reward
func (Keeper) IteratorTotalReward ¶ added in v0.12.0
func (k Keeper) IteratorTotalReward(ctx sdk.Context, handler func(epoch sdkmath.Int, totalReward types.TotalReward) (stop bool))
IteratorTotalReward Iteration for getting total mature reward
func (Keeper) MiningRewardParams ¶
func (k Keeper) MiningRewardParams(ctx sdk.Context) (res []types.MiningRewardParam)
func (Keeper) RemoveIndividualReward ¶ added in v0.10.0
func (Keeper) RestoreTotalSupply ¶ added in v0.10.0
RestoreTotalSupply Restore total supply to 100M stos
func (Keeper) RewardDenom ¶ added in v0.6.0
func (Keeper) RewardMatureAndSubSlashing ¶ added in v0.10.0
RewardMatureAndSubSlashing mature rewards and deduct slashing for all nodes
func (Keeper) SafeMintCoins ¶ added in v0.10.0
func (Keeper) SetImmatureTotalReward ¶ added in v0.7.0
func (Keeper) SetIndividualReward ¶ added in v0.7.0
func (Keeper) SetLastDistributedEpoch ¶ added in v0.10.0
func (Keeper) SetMatureTotalReward ¶ added in v0.7.0
func (Keeper) SetMaturedEpoch ¶ added in v0.10.0
func (Keeper) SetTotalMinedTokens ¶ added in v0.7.0
func (Keeper) SetTotalReward ¶ added in v0.12.0
func (Keeper) SetVolumeReport ¶
func (Keeper) SlashingResourceNode ¶ added in v0.6.2
func (k Keeper) SlashingResourceNode(ctx sdk.Context, p2pAddr stratos.SdsAddress, walletAddr sdk.AccAddress, nozAmt sdkmath.Int, suspend bool) (tokenAmt sdkmath.Int, nodeType registertypes.NodeType, err error)
SlashingResourceNode This function only record slashing amount.
Deduct slashing amount when: 1, calculate upcoming mature reward, deduct from mature_total & upcoming mature reward. 2, meta node decrease deposit . 3, resource node decrease deposit .
func (Keeper) VolumeReport ¶ added in v0.6.0
type Migrator ¶ added in v0.8.0
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func NewMigrator ¶ added in v0.8.0
func NewMigrator(keeper Keeper, legacySubspace types.ParamsSubspace) Migrator
NewMigrator returns a new Migrator.
type Querier ¶ added in v0.8.0
type Querier struct {
Keeper
}
Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper
func (Querier) CirculationSupply ¶ added in v0.10.0
func (q Querier) CirculationSupply(c context.Context, _ *types.QueryCirculationSupplyRequest) (*types.QueryCirculationSupplyResponse, error)
func (Querier) Metrics ¶ added in v0.11.3
func (q Querier) Metrics(c context.Context, req *types.QueryMetricsRequest) ( *types.QueryMetricsResponse, error)
func (Querier) Params ¶ added in v0.8.0
func (q Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Querier) RewardsByEpoch ¶ added in v0.10.0
func (q Querier) RewardsByEpoch(c context.Context, req *types.QueryRewardsByEpochRequest) (*types.QueryRewardsByEpochResponse, error)
func (Querier) RewardsByWallet ¶ added in v0.12.0
func (q Querier) RewardsByWallet(c context.Context, req *types.QueryRewardsByWalletRequest) (*types.QueryRewardsByWalletResponse, error)
func (Querier) RewardsByWalletAndEpoch ¶ added in v0.12.0
func (q Querier) RewardsByWalletAndEpoch(c context.Context, req *types.QueryRewardsByWalletAndEpochRequest) (*types.QueryRewardsByWalletAndEpochResponse, error)
func (Querier) SlashingByOwner ¶ added in v0.10.0
func (q Querier) SlashingByOwner(c context.Context, req *types.QuerySlashingByOwnerRequest) (*types.QuerySlashingByOwnerResponse, error)
func (Querier) TotalMinedToken ¶ added in v0.10.0
func (q Querier) TotalMinedToken(c context.Context, _ *types.QueryTotalMinedTokenRequest) (*types.QueryTotalMinedTokenResponse, error)
func (Querier) TotalRewardByEpoch ¶ added in v0.11.0
func (q Querier) TotalRewardByEpoch(c context.Context, req *types.QueryTotalRewardByEpochRequest) ( *types.QueryTotalRewardByEpochResponse, error)
func (Querier) VolumeReport ¶ added in v0.8.0
func (q Querier) VolumeReport(c context.Context, req *types.QueryVolumeReportRequest) (*types.QueryVolumeReportResponse, error)