param

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2019 License: Apache-2.0 Imports: 6 Imported by: 14

Documentation

Index

Constants

View Source
const (
	// ModuleKey is the name of the module
	ModuleName = "param"

	// RouterKey is the message route for param
	RouterKey = ModuleName

	// QuerierRoute is the querier route for param
	QuerierRoute = ModuleName

	QueryAllocationParam = "allocation"
	QueryDeveloperParam  = "developer"
	QueryVoteParam       = "vote"
	QueryProposalParam   = "proposal"
	QueryValidatorParam  = "validator"
	QueryBandwidthParam  = "bandwidth"
	QueryAccountParam    = "account"
	QueryPostParam       = "post"
	QueryReputationParam = "reputation"
	QueryPriceParam      = "price"
)

Variables

View Source
var (

	// AnnualInflationCeiling - annual inflation upper bound
	AnnualInflationCeiling = types.NewDecFromRat(98, 1000)
	// AnnualInflationFloor - annual inflation lower bound
	AnnualInflationFloor = types.NewDecFromRat(3, 100)
)

Functions

func ErrAccountParamNotFound

func ErrAccountParamNotFound() sdk.Error

ErrAccountParamNotFound - error when account param is empty.

func ErrBandwidthParamNotFound

func ErrBandwidthParamNotFound() sdk.Error

ErrBandwidthParamNotFound - error when bandwidth param is empty.

func ErrCoinDayParamNotFound

func ErrCoinDayParamNotFound() sdk.Error

ErrCoinDayParamNotFound - error when coin day param is empty.

func ErrDeveloperParamNotFound

func ErrDeveloperParamNotFound() sdk.Error

ErrDeveloperParamNotFound - error when developer param is empty.

func ErrEvaluateOfContentValueParamNotFound

func ErrEvaluateOfContentValueParamNotFound() sdk.Error

ErrEvaluateOfContentValueParamNotFound - error when evaluate of content value param is empty.

func ErrFailedToMarshalAccountParam

func ErrFailedToMarshalAccountParam(err error) sdk.Error

ErrFailedToMarshalAccountParam - error when marshal account param failed.

func ErrFailedToMarshalBandwidthParam

func ErrFailedToMarshalBandwidthParam(err error) sdk.Error

ErrFailedToMarshalBandwidthParam - error when marshal bandwidth day param failed.

func ErrFailedToMarshalCoinDayParam

func ErrFailedToMarshalCoinDayParam(err error) sdk.Error

ErrFailedToMarshalCoinDayParam - error when marshal coin day param failed.

func ErrFailedToMarshalDeveloperParam

func ErrFailedToMarshalDeveloperParam(err error) sdk.Error

ErrFailedToMarshalDeveloperParam - error when marshal developer param failed.

func ErrFailedToMarshalEvaluateOfContentValueParam

func ErrFailedToMarshalEvaluateOfContentValueParam(err error) sdk.Error

ErrFailedToMarshalEvaluateOfContentValueParam - error when marshal evaluate of content value param failed.

func ErrFailedToMarshalGlobalAllocationParam

func ErrFailedToMarshalGlobalAllocationParam(err error) sdk.Error

ErrFailedToUnmarshalAccountParam - error when marshal global allocation param failed.

func ErrFailedToMarshalPostParam

func ErrFailedToMarshalPostParam(err error) sdk.Error

ErrFailedToMarshalPostParam - error when marshal post param failed.

func ErrFailedToMarshalProposalParam

func ErrFailedToMarshalProposalParam(err error) sdk.Error

ErrFailedToMarshalProposalParam - error when marshal proposal param failed.

func ErrFailedToMarshalReputationParam added in v0.1.1

func ErrFailedToMarshalReputationParam(err error) sdk.Error

ErrFailedToMarshalReputationParam - error when marshal reputation failed.

func ErrFailedToMarshalValidatorParam

func ErrFailedToMarshalValidatorParam(err error) sdk.Error

ErrFailedToMarshalValidatorParam - error when marshal validator param failed.

func ErrFailedToMarshalVoteParam

func ErrFailedToMarshalVoteParam(err error) sdk.Error

ErrFailedToMarshalVoteParam - error when marshal vote param failed.

func ErrFailedToUnmarshalAccountParam

func ErrFailedToUnmarshalAccountParam(err error) sdk.Error

ErrFailedToUnmarshalAccountParam - error when unmarshal account param failed.

func ErrFailedToUnmarshalBandwidthParam

func ErrFailedToUnmarshalBandwidthParam(err error) sdk.Error

ErrFailedToUnmarshalBandwidthParam - error when unmarshal bandwidth param failed.

func ErrFailedToUnmarshalCoinDayParam

func ErrFailedToUnmarshalCoinDayParam(err error) sdk.Error

ErrFailedToUnmarshalCoinDayParam - error when unmarshal coin day param failed.

func ErrFailedToUnmarshalDeveloperParam

func ErrFailedToUnmarshalDeveloperParam(err error) sdk.Error

ErrFailedToUnmarshalDeveloperParam - error when unmarshal developer param failed.

func ErrFailedToUnmarshalEvaluateOfContentValueParam

func ErrFailedToUnmarshalEvaluateOfContentValueParam(err error) sdk.Error

ErrFailedToUnmarshalEvaluateOfContentValueParam - error when unmarshal evaluate of content value param failed.

func ErrFailedToUnmarshalGlobalAllocationParam

func ErrFailedToUnmarshalGlobalAllocationParam(err error) sdk.Error

ErrFailedToUnmarshalGlobalAllocationParam - error when unmarshal global allocation param failed.

func ErrFailedToUnmarshalPostParam

func ErrFailedToUnmarshalPostParam(err error) sdk.Error

ErrFailedToUnmarshalPostParam - error when unmarshal post param failed.

func ErrFailedToUnmarshalProposalParam

func ErrFailedToUnmarshalProposalParam(err error) sdk.Error

ErrFailedToUnmarshalProposalParam - error when unmarshal proposal param failed.

func ErrFailedToUnmarshalReputationParam added in v0.1.1

func ErrFailedToUnmarshalReputationParam(err error) sdk.Error

ErrFailedToUnmarshalReputationParam - error when unmarshal reputation param failed.

func ErrFailedToUnmarshalValidatorParam

func ErrFailedToUnmarshalValidatorParam(err error) sdk.Error

ErrFailedToUnmarshalValidatorParam - error when unmarshal validator param failed.

func ErrFailedToUnmarshalVoteParam

func ErrFailedToUnmarshalVoteParam(err error) sdk.Error

ErrFailedToUnmarshalVoteParam - error when unmarshal vote param failed.

func ErrGlobalAllocationParamNotFound

func ErrGlobalAllocationParamNotFound() sdk.Error

ErrGlobalAllocationParamNotFound - error when global allocation param is empty.

func ErrInvalidaParameter

func ErrInvalidaParameter() sdk.Error

ErrInvalidaParameter - error when propose a proposal with invalid parameter.

func ErrParamHolderGenesisFailed

func ErrParamHolderGenesisFailed() sdk.Error

ErrParamHolderGenesisFailed - error when genesis failed.

func ErrPostParamNotFound

func ErrPostParamNotFound() sdk.Error

ErrPostParamNotFound - error when post param is empty.

func ErrProposalParamNotFound

func ErrProposalParamNotFound() sdk.Error

ErrProposalParamNotFound - error when proposal param is empty.

func ErrQueryFailed added in v0.2.0

func ErrQueryFailed() sdk.Error

ErrQueryFailed - error when query parameter store failed

func ErrReputationParamNotFound added in v0.1.1

func ErrReputationParamNotFound() sdk.Error

ErrReputationParamNotFound - error when reputation param is empty.

func ErrValidatorParamNotFound

func ErrValidatorParamNotFound() sdk.Error

ErrValidatorParamNotFound - error when validator param is empty.

func ErrVoteParamNotFound

func ErrVoteParamNotFound() sdk.Error

ErrVoteParamNotFound - error when vote param is empty.

func GetAccountParamKey

func GetAccountParamKey() []byte

GetAccountParamKey - "account param substore"

func GetAllocationParamKey

func GetAllocationParamKey() []byte

GetAllocationParamKey - "allocation param substore"

func GetBandwidthParamKey

func GetBandwidthParamKey() []byte

GetBandwidthParamKey - "bandwidth param substore"

func GetCoinDayParamKey

func GetCoinDayParamKey() []byte

GetCoinDayParamKey - "coin day param substore"

func GetDeveloperParamKey

func GetDeveloperParamKey() []byte

GetDeveloperParamKey - "developer param substore"

func GetEvaluateOfContentValueParamKey

func GetEvaluateOfContentValueParamKey() []byte

GetEvaluateOfContentValueParamKey - "evaluate of content value param substore"

func GetPostParamKey

func GetPostParamKey() []byte

GetPostParamKey - "post param substore"

func GetPriceParamKey added in v0.4.0

func GetPriceParamKey() []byte

GetPriceParamKey

func GetProposalParamKey

func GetProposalParamKey() []byte

GetProposalParamKey - "proposal param substore"

func GetReputationParamKey added in v0.1.1

func GetReputationParamKey() []byte

GetAccountParamKey - "account param substore"

func GetValidatorParamKey

func GetValidatorParamKey() []byte

GetValidatorParamKey - "validator param substore"

func GetVoteParamKey

func GetVoteParamKey() []byte

GetVoteParamKey - "vote param substore"

func NewQuerier added in v0.2.0

func NewQuerier(ph ParamHolder) sdk.Querier

creates a querier for account REST endpoints

Types

type AccountParam

type AccountParam struct {
	MinimumBalance               types.Coin `json:"minimum_balance"`
	RegisterFee                  types.Coin `json:"register_fee"`
	FirstDepositFullCoinDayLimit types.Coin `json:"first_deposit_full_coin_day_limit"`
	MaxNumFrozenMoney            int64      `json:"max_num_frozen_money"`
}

AccountParam - account parameters MinimumBalance - minimum balance each account need to maintain RegisterFee - register fee need to pay to developer inflation pool for each account registration FirstDepositFullCoinDayLimit - when register account, some of coin day of register fee to newly open account will be fully charged MaxNumFrozenMoney - the upper limit for each person's ongoing frozen money

type BandwidthParam

type BandwidthParam struct {
	SecondsToRecoverBandwidth   int64      `json:"seconds_to_recover_bandwidth"`
	CapacityUsagePerTransaction types.Coin `json:"capacity_usage_per_transaction"`
	VirtualCoin                 types.Coin `json:"virtual_coin"`
	GeneralMsgQuotaRatio        sdk.Dec    `json:"general_msg_quota_ratio"`
	GeneralMsgEMAFactor         sdk.Dec    `json:"general_msg_ema_factor"`
	AppMsgQuotaRatio            sdk.Dec    `json:"app_msg_quota_ratio"`
	AppMsgEMAFactor             sdk.Dec    `json:"app_msg_ema_factor"`
	ExpectedMaxMPS              sdk.Dec    `json:"expected_max_mps"`
	MsgFeeFactorA               sdk.Dec    `json:"msg_fee_factor_a"`
	MsgFeeFactorB               sdk.Dec    `json:"msg_fee_factor_b"`
	MaxMPSDecayRate             sdk.Dec    `json:"max_mps_decay_rate"`
	AppBandwidthPoolSize        sdk.Dec    `json:"app_bandwidth_pool_size"`
	AppVacancyFactor            sdk.Dec    `json:"app_vacancy_factor"`
	AppPunishmentFactor         sdk.Dec    `json:"app_punishment_factor"`
}

type ChangeParamEvent

type ChangeParamEvent struct {
	Param Parameter `json:"param"`
}

ChangeParamEvent - change parameter event

func (ChangeParamEvent) Execute

func (cpe ChangeParamEvent) Execute(ctx sdk.Context, ph ParamHolder) sdk.Error

Execute - execute change parameter event

type CoinDayParam

type CoinDayParam struct {
	SecondsToRecoverCoinDay int64 `json:"seconds_to_recover_coin_day"`
}

CoinDayParam - coin day parameters SecondsToRecoverCoinDay - seconds for each incoming balance coin day fully charged

type DeveloperParam

type DeveloperParam struct {
	DeveloperMinDeposit            types.Coin `json:"developer_min_deposit"`
	DeveloperCoinReturnIntervalSec int64      `json:"developer_coin_return_interval_second"`
	DeveloperCoinReturnTimes       int64      `json:"developer_coin_return_times"`
}

DeveloperParam - developer parameters DeveloperMinDeposit - minimum deposit to become a developer DeveloperCoinReturnIntervalSec - when withdraw or revoke, coin return to developer by coin return event DeveloperCoinReturnTimes - when withdraw or revoke, coin return to developer by coin return event

type GlobalAllocationParam

type GlobalAllocationParam struct {
	GlobalGrowthRate         sdk.Dec `json:"global_growth_rate"`
	ContentCreatorAllocation sdk.Dec `json:"content_creator_allocation"`
	DeveloperAllocation      sdk.Dec `json:"developer_allocation"`
	ValidatorAllocation      sdk.Dec `json:"validator_allocation"`
}

GlobalAllocationParam - global allocation parameters ContentCreatorAllocation - percentage for all content creator related allocation DeveloperAllocation - percentage of inflation for developers ValidatorAllocation - percentage of inflation for validators

func (GlobalAllocationParam) IsValid added in v0.4.0

func (gp GlobalAllocationParam) IsValid() bool

type ParamHolder

type ParamHolder struct {
	// contains filtered or unexported fields
}

ParamHolder - parameter KVStore

func NewParamHolder

func NewParamHolder(key sdk.StoreKey) ParamHolder

NewParamHolder - create a new parameter KVStore

func (ParamHolder) GetAccountParam

func (ph ParamHolder) GetAccountParam(ctx sdk.Context) (*AccountParam, sdk.Error)

GetAccountParam - get account param

func (ParamHolder) GetBandwidthParam

func (ph ParamHolder) GetBandwidthParam(ctx sdk.Context) (*BandwidthParam, sdk.Error)

GetBandwidthParam - get bandwidth param

func (ParamHolder) GetCoinDayParam

func (ph ParamHolder) GetCoinDayParam(ctx sdk.Context) (*CoinDayParam, sdk.Error)

GetCoinDayParam - get coin day param

func (ParamHolder) GetDeveloperParam

func (ph ParamHolder) GetDeveloperParam(ctx sdk.Context) (*DeveloperParam, sdk.Error)

GetDeveloperParam - get developer param

func (ParamHolder) GetGlobalAllocationParam

func (ph ParamHolder) GetGlobalAllocationParam(
	ctx sdk.Context) (*GlobalAllocationParam, sdk.Error)

GetGlobalAllocationParam - get global allocation param

func (ParamHolder) GetPostParam

func (ph ParamHolder) GetPostParam(ctx sdk.Context) (*PostParam, sdk.Error)

GetPostParam - get post param

func (ParamHolder) GetPriceParam added in v0.4.0

func (ph ParamHolder) GetPriceParam(ctx sdk.Context) *PriceParam

GetPriceParam - get price param

func (ParamHolder) GetProposalParam

func (ph ParamHolder) GetProposalParam(ctx sdk.Context) (*ProposalParam, sdk.Error)

GetProposalParam - get proposal param

func (ParamHolder) GetReputationParam added in v0.1.1

func (ph ParamHolder) GetReputationParam(ctx sdk.Context) *ReputationParam

GetReputationParam - get reputation param

func (ParamHolder) GetValidatorParam

func (ph ParamHolder) GetValidatorParam(ctx sdk.Context) *ValidatorParam

GetValidatorParam - get validator param

func (ParamHolder) GetVoteParam

func (ph ParamHolder) GetVoteParam(ctx sdk.Context) (*VoteParam, sdk.Error)

GetVoteParam - get vote param

func (ParamHolder) InitParam

func (ph ParamHolder) InitParam(ctx sdk.Context) error

InitParam - init all parameters based on code

func (ParamHolder) InitParamFromConfig

func (ph ParamHolder) InitParamFromConfig(
	ctx sdk.Context,
	globalParam GlobalAllocationParam,
	postParam PostParam,
	developerParam DeveloperParam,
	validatorParam ValidatorParam,
	voteParam VoteParam,
	proposalParam ProposalParam,
	coinDayParam CoinDayParam,
	bandwidthParam BandwidthParam,
	accParam AccountParam,
	repParam ReputationParam,
	priceParam PriceParam) error

InitParamFromConfig - init all parameters based on pass in args

func (ParamHolder) UpdateGlobalGrowthRate added in v0.1.1

func (ph ParamHolder) UpdateGlobalGrowthRate(ctx sdk.Context, growthRate sdk.Dec) sdk.Error

UpdateGlobalGrowthRate - update global growth rate

type ParamKeeper added in v0.3.0

type ParamKeeper interface {
	GetPostParam(ctx sdk.Context) (*PostParam, sdk.Error)
	GetDeveloperParam(ctx sdk.Context) (*DeveloperParam, sdk.Error)
	GetVoteParam(ctx sdk.Context) (*VoteParam, sdk.Error)
	GetProposalParam(ctx sdk.Context) (*ProposalParam, sdk.Error)
	GetValidatorParam(ctx sdk.Context) *ValidatorParam
	GetCoinDayParam(ctx sdk.Context) (*CoinDayParam, sdk.Error)
	GetBandwidthParam(ctx sdk.Context) (*BandwidthParam, sdk.Error)
	GetAccountParam(ctx sdk.Context) (*AccountParam, sdk.Error)
	GetPriceParam(ctx sdk.Context) *PriceParam
	GetReputationParam(ctx sdk.Context) *ReputationParam
	UpdateGlobalGrowthRate(ctx sdk.Context, growthRate sdk.Dec) sdk.Error
}

type Parameter

type Parameter interface{}

Parameter - parameter in Lino Blockchain

type PostParam

type PostParam struct {
	ReportOrUpvoteIntervalSec int64      `json:"report_or_upvote_interval_second"`
	PostIntervalSec           int64      `json:"post_interval_sec"`
	MaxReportReputation       types.Coin `json:"max_report_reputation"`
}

PostParam - post parameters ReportOrUpvoteIntervalSec - report interval second PostIntervalSec - post interval second

type PriceParam added in v0.4.0

type PriceParam struct {
	TestnetMode     bool       `json:"testnet_mode"`
	UpdateEverySec  int64      `json:"update_every"`
	FeedEverySec    int64      `json:"feed_every"`
	HistoryMaxLen   int        `json:"history_max_len"`
	PenaltyMissFeed types.Coin `json:"penalty_miss_feed"`
}

PriceParam - parameters of price module.

type ProposalParam

type ProposalParam struct {
	ContentCensorshipDecideSec  int64      `json:"content_censorship_decide_second"`
	ContentCensorshipMinDeposit types.Coin `json:"content_censorship_min_deposit"`
	ContentCensorshipPassRatio  sdk.Dec    `json:"content_censorship_pass_ratio"`
	ContentCensorshipPassVotes  types.Coin `json:"content_censorship_pass_votes"`
	ChangeParamDecideSec        int64      `json:"change_param_decide_second"`
	ChangeParamExecutionSec     int64      `json:"change_param_execution_second"`
	ChangeParamMinDeposit       types.Coin `json:"change_param_min_deposit"`
	ChangeParamPassRatio        sdk.Dec    `json:"change_param_pass_ratio"`
	ChangeParamPassVotes        types.Coin `json:"change_param_pass_votes"`
	ProtocolUpgradeDecideSec    int64      `json:"protocol_upgrade_decide_second"`
	ProtocolUpgradeMinDeposit   types.Coin `json:"protocol_upgrade_min_deposit"`
	ProtocolUpgradePassRatio    sdk.Dec    `json:"protocol_upgrade_pass_ratio"`
	ProtocolUpgradePassVotes    types.Coin `json:"protocol_upgrade_pass_votes"`
}

ProposalParam - proposal parameters ContentCensorshipDecideSec - seconds after content censorship proposal created till expired ContentCensorshipMinDeposit - minimum deposit to propose content censorship proposal ContentCensorshipPassRatio - upvote and downvote ratio for content censorship proposal ContentCensorshipPassVotes - minimum voting power required to pass content censorship proposal ChangeParamDecideSec - seconds after parameter change proposal created till expired ChangeParamExecutionSec - seconds after parameter change proposal pass till execution ChangeParamMinDeposit - minimum deposit to propose parameter change proposal ChangeParamPassRatio - upvote and downvote ratio for parameter change proposal ChangeParamPassVotes - minimum voting power required to pass parameter change proposal ProtocolUpgradeDecideSec - seconds after protocol upgrade proposal created till expired ProtocolUpgradeMinDeposit - minimum deposit to propose protocol upgrade proposal ProtocolUpgradePassRatio - upvote and downvote ratio for protocol upgrade proposal ProtocolUpgradePassVotes - minimum voting power required to pass protocol upgrade proposal

type ReputationParam added in v0.1.1

type ReputationParam struct {
	BestContentIndexN int `json:"best_content_index_n"`
	UserMaxN          int `json:"user_max_n"`
}

ReputationParam: parameters of reputation BestContentIndexN - hard cap of how many content can be indexed every round. UserMaxN - maximum different donation target counted every round.

type ValidatorParam

type ValidatorParam struct {
	ValidatorMinDeposit            types.Coin `json:"validator_min_deposit"`
	ValidatorCoinReturnIntervalSec int64      `json:"validator_coin_return_second"`
	ValidatorCoinReturnTimes       int64      `json:"validator_coin_return_times"`
	PenaltyMissCommit              types.Coin `json:"penalty_miss_commit"`
	PenaltyByzantine               types.Coin `json:"penalty_byzantine"`
	AbsentCommitLimitation         int64      `json:"absent_commit_limitation"`
	OncallSize                     int64      `json:"oncall_size"`
	StandbySize                    int64      `json:"standby_size"`
	ValidatorRevokePendingSec      int64      `json:"validator_revoke_pending_sec"`
	OncallInflationWeight          int64      `json:"oncall_inflation_weight"`
	StandbyInflationWeight         int64      `json:"standby_inflation_weight"`
	MaxVotedValidators             int64      `json:"max_voted_validators"`
}

ValidatorParam - validator parameters ValidatorMinDeposit - minimum deposit requirement for user wanna be validator ValidatorCoinReturnIntervalSec - when withdraw or revoke, coin return to validator by coin return event ValidatorCoinReturnTimes - when withdraw or revoke, coin return to validator by coin return event minus PenaltyMissCommit amount of Coin from validator deposit PenaltyMissCommit - when missing block till AbsentCommitLimitation, minus PenaltyMissCommit amount of Coin from validator deposit PenaltyByzantine - when validator acts as byzantine (double sign, for example), minus PenaltyByzantine amount of Coin from validator deposit AbsentCommitLimitation - absent block limitation till penalty OncallSize - the size of oncall validators StandbySize - the size of standby validators ValidatorRevokePendingSec - how many seconds before unassign validator duty OncallInflationWeight - oncall validator's weight when distributing inflation StandbyInflationWeight - standby validator's weight when distributing inflation MaxVotedValidators - the number of max validators one voter can vote

type VoteParam

type VoteParam struct {
	MinStakeIn                     types.Coin `json:"min_stake_in"`
	VoterCoinReturnIntervalSec     int64      `json:"voter_coin_return_interval_second"`
	VoterCoinReturnTimes           int64      `json:"voter_coin_return_times"`
	DelegatorCoinReturnIntervalSec int64      `json:"delegator_coin_return_interval_second"`
	DelegatorCoinReturnTimes       int64      `json:"delegator_coin_return_times"`
}

VoteParam - vote parameters MinStakeIn - minimum stake for stake in msg VoterCoinReturnIntervalSec - when withdraw or revoke, the deposit return to voter by return event VoterCoinReturnTimes - when withdraw or revoke, the deposit return to voter by return event DelegatorCoinReturnIntervalSec - when withdraw or revoke, the deposit return to delegator by return event DelegatorCoinReturnTimes - when withdraw or revoke, the deposit return to delegator by return event

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL