Documentation ¶
Index ¶
- Constants
- Variables
- func CalGasFee(gasUsed uint64, gasPrice uint64) sdk.Int
- func CheckParamType(name, value string) bool
- func CleanParams() (before bool)
- func Contains(slice []string, item string) bool
- func ConvertDaysToHeight(days int64) int64
- func Diff(t string) (int64, error)
- func FormatUnixTime(ts int64) string
- func GetNow() string
- func GetTimeBefore(ts int64, hours int) (string, error)
- func GetTimeBeforeNow(hours int) (string, error)
- func IsBlank(str string) bool
- func IsEmptyAddress(address common.Address) bool
- func IsEthTx(tx *types.Transaction) bool
- func LeftPad(str string, count int) string
- func LoadParams(b []byte)
- func ParseFloat(str string) float64
- func ParseInt(str string) sdk.Int
- func RoundFloat(f float64, n int) float64
- func SetParam(name, value string) bool
- func SetParams(p *Params)
- func ToWei(value int64) (result *big.Int)
- func UnloadParams() (b []byte)
- type Params
- type StateChangeObject
- type StateChangeReactor
Constants ¶
View Source
const ( CommitSeconds = 10 HalfYear = 180 YearlyBlockNumber = 365 * 24 * 3600 / CommitSeconds BasicMintableAmount = "1000000000000000000000000000" DB_FILE_NAME = "cybermiles.db" Cube = "cube" CmtWallet = "cmt_wallet" )
View Source
const ( Staging = 20 TestNet = 19 MainNet = 18 PrivateChain = 1234 )
View Source
const (
MonitorRpcPort = "26650"
)
Variables ¶
View Source
var ( BlockGasFee = big.NewInt(0) StateChangeQueue []StateChangeObject PendingProposal = &pendingProposal{ make(map[string]int64), math.MaxInt64, nil, make(map[string]int64), math.MaxInt64, nil, } RetiringProposalId string // Indicate where to shutdown the node MintAccount = common.HexToAddress("0000000000000000000000000000000000000000") HoldAccount = common.HexToAddress("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF") GovHoldAccount = common.HexToAddress("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF") )
View Source
var ( // Keys for store prefixes ParamKey = []byte{0x01} // key for global parameters AwardInfosKey = []byte{0x02} // key for award infos AbsentValidatorsKey = []byte{0x03} // key for absent validators PubKeyUpdatesKey = []byte{0x04} // key for absent validators )
View Source
var GOOSDIST string
View Source
var GOOSVERS string
View Source
var SUPPORT_OS = map[string][]string{
"ubuntu": {"16.04"},
"centos": {"^7.0"},
}
Functions ¶
func CheckParamType ¶
func CleanParams ¶
func CleanParams() (before bool)
func ConvertDaysToHeight ¶
func FormatUnixTime ¶
func GetTimeBeforeNow ¶
func IsEmptyAddress ¶
func IsEthTx ¶
func IsEthTx(tx *types.Transaction) bool
func ParseFloat ¶
func RoundFloat ¶
func UnloadParams ¶
func UnloadParams() (b []byte)
Types ¶
type Params ¶
type Params struct { MaxVals uint16 `json:"max_vals" type:"uint"` // maximum number of validators BackupVals uint16 `json:"backup_vals" type:"uint"` // number of backup validators SelfStakingRatio sdk.Rat `json:"self_staking_ratio" type:"rat"` InflationRate sdk.Rat `json:"inflation_rate" type:"rat"` ValidatorSizeThreshold sdk.Rat `json:"validator_size_threshold" type:"rat"` UnstakeWaitingPeriod uint64 `json:"unstake_waiting_period" type:"uint"` ProposalExpirePeriod uint64 `json:"proposal_expire_period" type:"uint"` DeclareCandidacyGas uint64 `json:"declare_candidacy_gas" type:"uint"` UpdateCandidacyGas uint64 `json:"update_candidacy_gas" type:"uint"` SetCompRateGas uint64 `json:"set_comp_rate_gas" type:"uint"` UpdateCandidateAccountGas uint64 `json:"update_candidate_account_gas" type:"uint"` AcceptCandidateAccountUpdateRequestGas uint64 `json:"accept_candidate_account_update_request_gas" type:"uint"` TransferFundProposalGas uint64 `json:"transfer_fund_proposal_gas" type:"uint"` ChangeParamsProposalGas uint64 `json:"change_params_proposal_gas" type:"uint"` DeployLibEniProposalGas uint64 `json:"deploy_libeni_proposal_gas" type:"uint"` RetireProgramProposalGas uint64 `json:"retire_program_proposal_gas" type:"uint"` UpgradeProgramProposalGas uint64 `json:"upgrade_program_proposal_gas" type:"uint"` GasPrice uint64 `json:"gas_price" type:"uint"` MinStakingAmount int64 `json:"min_staking_amount" type:"uint"` ValidatorsBlockAwardRatio sdk.Rat `json:"validators_block_award_ratio" type:"rat"` MaxSlashBlocks int16 `json:"max_slash_blocks" type:"uint"` SlashRatio sdk.Rat `json:"slash_ratio" type:"rat"` SlashEnabled bool `json:"slash_enabled" type:"bool"` CubePubKeys string `json:"cube_pub_keys" type:"json"` LowPriceTxGasLimit uint64 `json:"low_price_tx_gas_limit" type:"uint"` LowPriceTxSlotsCap int `json:"low_price_tx_slots_cap" type:"int"` FoundationAddress string `json:"foundation_address"` CalStakeInterval uint64 `json:"cal_stake_interval" type:"uint"` CalVPInterval uint64 `json:"cal_vp_interval" type:"uint"` CalAverageStakingDateInterval uint64 `json:"cal_avg_staking_date_interval" type:"uint"` }
func DefaultParams ¶
func DefaultParams() *Params
type StateChangeObject ¶
type StateChangeReactor ¶
type StateChangeReactor interface {
React(result, msg string)
}
Click to show internal directories.
Click to hide internal directories.