types

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2018 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Qos         = int64(1e8)
	BlockReward = int64(0 * Qos)
)
View Source
const (
	//Active 可获得挖矿奖励状态
	Active int8 = iota

	//Inactive
	Inactive

	//Inactive Code
	Revoke InactiveCode = iota
	MissVoteBlock
	MaxValidator
)

Variables

View Source
var (
	DefaultCLIHome  = os.ExpandEnv("$HOME/.qoscli")
	DefaultNodeHome = os.ExpandEnv("$HOME/.qosd")
)

Functions

func GetDefaultChainId added in v0.0.2

func GetDefaultChainId() (string, error)

Get default chain-id.

Types

type InactiveCode added in v0.0.3

type InactiveCode int8

type QSC

type QSC = types.BaseCoin

func NewQSC

func NewQSC(name string, amount types.BigInt) *QSC

type QSCInfo added in v0.0.3

type QSCInfo struct {
	Name        string         `json:"name"`        //币名
	ChainId     string         `json:"chain_id"`    //证书可用链
	Extrate     string         `json:"extrate"`     //qcs:qos汇率(amino不支持binary形式的浮点数序列化,精度同qos erc20 [.0000])
	Description string         `json:"description"` //描述信息
	Banker      btypes.Address `json:"banker"`      //Banker PubKey
}

func NewQSCInfoWithQSCCA added in v0.0.3

func NewQSCInfoWithQSCCA(cer *cert.Certificate) QSCInfo

type QSCs

type QSCs = types.BaseCoins

func ParseCoins added in v0.0.2

func ParseCoins(str string) (btypes.BigInt, QSCs, error)

Parse QOS and QSCs from string str example : 100qos,100qstar

type SPOConfig added in v0.0.3

type SPOConfig struct {
	TotalAmount uint64 `json:"total_amount"`
	TotalBlock  uint64 `json:"total_block"`
}

func DefaultSPOConfig added in v0.0.3

func DefaultSPOConfig() SPOConfig

type StakeConfig added in v0.0.3

type StakeConfig struct {
	MaxValidatorCnt            uint32 `json:"max_validator_cnt"`
	ValidatorVotingStatusLen   uint32 `json:"voting_status_len"`
	ValidatorVotingStatusLeast uint32 `json:"voting_status_least"`
	ValidatorSurvivalSecs      uint64 `json:"survival_secs"`
}

func DefaultStakeConfig added in v0.0.3

func DefaultStakeConfig() StakeConfig

type Validator added in v0.0.2

type Validator struct {
	Name            string         `json:"name"`
	Owner           btypes.Address `json:"owner"`
	ValidatorPubKey crypto.PubKey  `json:"validatorPubkey"`
	BondTokens      uint64         `json:"bondTokens"` //不能超过int64最大值
	Description     string         `json:"description"`

	Status         int8         `json:"status"`
	InactiveCode   InactiveCode `json:"inactiveCode"`
	InactiveTime   time.Time    `json:"inactiveTime"`
	InactiveHeight uint64       `json:"inactiveHeight"`

	BondHeight uint64 `json:"bondHeight"`
}

func (Validator) IsActive added in v0.0.3

func (val Validator) IsActive() bool

func (Validator) ToABCIValidator added in v0.0.2

func (val Validator) ToABCIValidator() (abciVal abci.Validator)

type ValidatorVoteInfo added in v0.0.3

type ValidatorVoteInfo struct {
	StartHeight         uint64 `json:"startHeight"`
	IndexOffset         uint64 `json:"indexOffset"`
	MissedBlocksCounter uint64 `json:"missedBlocksCounter"`
}

func NewValidatorVoteInfo added in v0.0.3

func NewValidatorVoteInfo(startHeight, indexOffset, missedBlocksCounter uint64) ValidatorVoteInfo

Jump to

Keyboard shortcuts

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