Documentation
¶
Index ¶
- Constants
- Variables
- type AMOAppConfig
- type AMOAppConfigGenesis
- type Currency
- func (c *Currency) Add(a *Currency) *Currency
- func (c *Currency) Clone() (*Currency, error)
- func (c Currency) Equals(a *Currency) bool
- func (c Currency) GreaterThan(a *Currency) bool
- func (c Currency) LessThan(a *Currency) bool
- func (c Currency) MarshalJSON() ([]byte, error)
- func (c *Currency) Set(x uint64) *Currency
- func (c *Currency) SetAMO(x float64) *Currency
- func (c *Currency) SetBytes(x []byte) (*Currency, error)
- func (c *Currency) SetString(x string, base int) (*Currency, error)
- func (c Currency) String() string
- func (c *Currency) Sub(a *Currency) *Currency
- func (c *Currency) UnmarshalJSON(data []byte) error
- type DIDEntry
- type Delegate
- type DelegateEx
- type Draft
- type DraftEx
- type DraftForQuery
- type Extra
- type Hibernate
- type Parcel
- type ParcelEx
- type Request
- type RequestEx
- type Stake
- type StakeEx
- type Storage
- type UDC
- type Usage
- type UsageEx
- type VCEntry
- type Vote
- type VoteInfo
Constants ¶
View Source
const ( // hard-coded configs DefaultMaxValidators = uint64(100) DefaultWeightValidator = float64(2) DefaultWeightDelegator = float64(1) DefaultMinStakingUnit = "1000000000000000000000000" DefaultBlkReward = "0" DefaultTxReward = "10000000000000000000" // TODO: not fixed Default ratios yet DefaultPenaltyRatioM = float64(0.3) DefaultPenaltyRatioL = float64(0.3) DefaultLazinessWindow = int64(10000) DefaultLazinessThreshold = int64(8000) DefaultHibernateThreshold = int64(100) DefaultHibernatePeriod = int64(10000) DefaultBlockBindingWindow = int64(10000) DefaultLockupPeriod = int64(1000000) DefaultDraftOpenCount = int64(10000) DefaultDraftCloseCount = int64(10000) DefaultDraftApplyCount = int64(10000) DefaultDraftDeposit = "1000000000000000000000000" DefaultDraftQuorumRate = float64(0.3) DefaultDraftPassRate = float64(0.51) DefaultDraftRefundRate = float64(0.2) DefaultUpgradeProtocolHeight = int64(1) DefaultUpgradeProtocolVersion = uint64(0) )
View Source
const (
OneAMOUint64 = uint64(1000000000000000000) // in decimal
)
View Source
const StorageIDLen = 4
Variables ¶
View Source
var Zero = new(Currency).Set(0)
Functions ¶
This section is empty.
Types ¶
type AMOAppConfig ¶ added in v1.4.1
type AMOAppConfig struct {
MaxValidators uint64 `json:"max_validators"`
WeightValidator float64 `json:"weight_validator"`
WeightDelegator float64 `json:"weight_delegator"`
MinStakingUnit Currency `json:"min_staking_unit"`
BlkReward Currency `json:"blk_reward"`
TxReward Currency `json:"tx_reward"`
PenaltyRatioM float64 `json:"penalty_ratio_m"` // malicious validator
PenaltyRatioL float64 `json:"penalty_ratio_l"` // lazy validators
LazinessWindow int64 `json:"laziness_window"`
LazinessThreshold int64 `json:"laziness_threshold"`
HibernateThreshold int64 `json:"hibernate_threshold"`
HibernatePeriod int64 `json:"hibernate_period"`
BlockBindingWindow int64 `json:"block_binding_window"`
LockupPeriod int64 `json:"lockup_period"`
DraftOpenCount int64 `json:"draft_open_count"`
DraftCloseCount int64 `json:"draft_close_count"`
DraftApplyCount int64 `json:"draft_apply_count"`
DraftDeposit Currency `json:"draft_deposit"`
DraftQuorumRate float64 `json:"draft_quorum_rate"`
DraftPassRate float64 `json:"draft_pass_rate"`
DraftRefundRate float64 `json:"draft_refund_rate"`
UpgradeProtocolHeight int64 `json:"upgrade_protocol_height"`
UpgradeProtocolVersion uint64 `json:"upgrade_protocol_version"`
}
func NewDefaultAMOAppConfig ¶ added in v1.7.6
func NewDefaultAMOAppConfig() (AMOAppConfig, error)
func (*AMOAppConfig) Check ¶ added in v1.4.1
func (cfg *AMOAppConfig) Check( blockHeight int64, protocolVersion uint64, txCfgRaw json.RawMessage, ) (AMOAppConfig, error)
type AMOAppConfigGenesis ¶ added in v1.7.6
type AMOAppConfigGenesis struct {
MaxValidators uint64 `json:"max_validators"`
WeightValidator float64 `json:"weight_validator"`
WeightDelegator float64 `json:"weight_delegator"`
MinStakingUnit Currency `json:"min_staking_unit"`
BlkReward Currency `json:"blk_reward"`
TxReward Currency `json:"tx_reward"`
PenaltyRatioM float64 `json:"penalty_ratio_m"`
PenaltyRatioL float64 `json:"penalty_ratio_l"`
LazinessCounterWindow int64 `json:"laziness_counter_window"`
LazinessThreshold float64 `json:"laziness_threshold"`
BlockBindingWindow int64 `json:"block_binding_window"`
LockupPeriod int64 `json:"lockup_period"`
DraftOpenCount int64 `json:"draft_open_count"`
DraftCloseCount int64 `json:"draft_close_count"`
DraftApplyCount int64 `json:"draft_apply_count"`
DraftDeposit Currency `json:"draft_deposit"`
DraftQuorumRate float64 `json:"draft_quorum_rate"`
DraftPassRate float64 `json:"draft_pass_rate"`
DraftRefundRate float64 `json:"draft_refund_rate"`
UpgradeProtocolHeight int64 `json:"upgrade_protocol_height"`
UpgradeProtocolVersion uint64 `json:"upgrade_protocol_version"`
}
func (*AMOAppConfigGenesis) Migrate ¶ added in v1.7.6
func (bCfg *AMOAppConfigGenesis) Migrate() AMOAppConfig
type Currency ¶
Currency uses big endian for compatibility to big.Int
func (Currency) GreaterThan ¶
func (Currency) MarshalJSON ¶
func (*Currency) UnmarshalJSON ¶
type DIDEntry ¶ added in v1.7.0
type DIDEntry struct {
Owner crypto.Address `json:"owner,omitempty"` // obsolete
Document json.RawMessage `json:"document"`
Meta json.RawMessage `json:"meta,omitempty"`
}
type DelegateEx ¶ added in v1.1.0
type Draft ¶ added in v1.4.1
type Draft struct {
Proposer crypto.Address `json:"proposer"`
Config AMOAppConfig `json:"config"`
Desc string `json:"desc"`
OpenCount int64 `json:"open_count"`
CloseCount int64 `json:"close_count"`
ApplyCount int64 `json:"apply_count"`
Deposit Currency `json:"deposit"`
TallyQuorum Currency `json:"tally_quorum"`
TallyApprove Currency `json:"tally_approve"`
TallyReject Currency `json:"tally_reject"`
}
type DraftEx ¶ added in v1.4.1
type DraftEx struct {
*DraftForQuery
Votes []*VoteInfo `json:"votes"`
}
type DraftForQuery ¶ added in v1.7.5
type DraftForQuery struct {
Proposer crypto.Address `json:"proposer"`
Config json.RawMessage `json:"config"`
Desc string `json:"desc"`
OpenCount int64 `json:"open_count"`
CloseCount int64 `json:"close_count"`
ApplyCount int64 `json:"apply_count"`
Deposit Currency `json:"deposit"`
TallyQuorum Currency `json:"tally_quorum"`
TallyApprove Currency `json:"tally_approve"`
TallyReject Currency `json:"tally_reject"`
}
type Extra ¶ added in v1.4.1
type Extra struct {
Register json.RawMessage `json:"register,omitempty"`
Request json.RawMessage `json:"request,omitempty"`
Grant json.RawMessage `json:"grant,omitempty"`
}
type Stake ¶
type Stake struct {
Validator ed25519.PubKeyEd25519 `json:"validator"`
Amount Currency `json:"amount"`
}
type StakeEx ¶ added in v1.1.0
type StakeEx struct {
*Stake
Delegates []*DelegateEx `json:"delegates,omitempty"`
}
func (StakeEx) MarshalJSON ¶ added in v1.5.0
type VCEntry ¶ added in v1.9.0
type VCEntry struct {
Credential json.RawMessage `json:"credential"`
Meta json.RawMessage `json:"meta,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.