manparams

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: MIT Imports: 12 Imported by: 117

Documentation

Index

Constants

View Source
const (
	VotePoolTimeout    = 55 * 1000
	VotePoolCountLimit = 5

	BlkPosReqSendInterval   = 5
	BlkPosReqSendTimes      = 6
	BlkVoteSendInterval     = 3
	BlkVoteSendTimes        = 8
	MinerReqSendInterval    = 3
	PosedReqSendInterval    = 10
	MinerResultSendInterval = 3

	MinerPickTimeout = 20

	OnlineConsensusValidityTime = 5
)
View Source
const (
	ElectionSeed                         = "electionseed"
	ElectionSeed_Plug_MinHash            = "MinHash"
	EveryBlockSeed                       = "everyblockseed"
	EveryBlockSeed_Plug_NonceAndCoinbase = "NonceAndCoinbase"
	EveryBroadcastSeed                   = "everybroadcastseed"
	EveryBroadcastSeed_Plug_MaxNonce     = "MaxNonce"

	ElectPlug_layerd    = "layerd"
	ElectPlug_stock     = "stock"
	ELectPlug_direct    = "direct"
	ElectPlug_layerdMEP = "layerd_MEP"
	ElectPlug_layerdBSS = "layerd_BSS"
)
View Source
const (
	VersionAlpha = "1.0.0.0"
	//增加版本号示例
	VersionBeta  = "1.0.0.1"
	VersionGamma = "1.0.0.2"
	//todo:上线后需要修改
	VersionSignatureGamma = "" //jerry
	/* 132-byte string literal not displayed */
	VersionNumGamma = uint64(330003)
)

Variables

View Source
var (
	//随机数相关
	RandomConfig              = DefaultRandomConfig //man.json配置中读的
	RandomServiceName         = []string{ElectionSeed, EveryBlockSeed, EveryBroadcastSeed}
	RandomServicePlugs        = make(map[string][]string, 0) //子服务对应的插件名
	RandomServiceDefaultPlugs = make(map[string]string, 0)
)
View Source
var (
	DefaultRandomConfig = map[string]string{ElectionSeed: ElectionSeed_Plug_MinHash}
)
View Source
var VersionList [][]byte
View Source
var VersionSignatureMap map[string][]common.Signature

Functions

func CanSwitchGammaCanonicalChain added in v1.1.4

func CanSwitchGammaCanonicalChain(currentTime int64) bool

func Config_Init

func Config_Init(Config_PATH string)

func GetBCIntervalInfo

func GetBCIntervalInfo() *mc.BCIntervalInfo

func GetBCIntervalInfoByHash

func GetBCIntervalInfoByHash(hash common.Hash) (*mc.BCIntervalInfo, error)

func GetBCIntervalInfoByNumber

func GetBCIntervalInfoByNumber(number uint64) (*mc.BCIntervalInfo, error)

func GetVersionSignature

func GetVersionSignature(parentBlock *types.Block, version []byte) []common.Signature

func IsBroadcastNumber

func IsBroadcastNumber(number uint64, stateNumber uint64) bool

func IsBroadcastNumberByHash

func IsBroadcastNumberByHash(number uint64, blockHash common.Hash) bool

func IsCorrectVersion

func IsCorrectVersion(version []byte) bool

func IsReElectionNumber

func IsReElectionNumber(number uint64, stateNumber uint64) bool

func ReadBlacklist added in v1.1.3

func ReadBlacklist(path string)

func SetStateReader

func SetStateReader(stReader BCIntervalReader)

func VersionCmp added in v1.1.4

func VersionCmp(version1 string, version2 string) int

version1 > version2 return 1 version1 = version2 return 0 version1 < version2 return -1

Types

type BCIntervalReader

type BCIntervalReader interface {
	GetBroadcastInterval() (*mc.BCIntervalInfo, error)
	GetBroadcastIntervalByHash(hash common.Hash) (*mc.BCIntervalInfo, error)
	GetBroadcastIntervalByNumber(number uint64) (*mc.BCIntervalInfo, error)
}

type Config

type Config struct {
	BootNode         []string
	ConsensusAccount []string
}

type JsonStruct

type JsonStruct struct {
}

func NewJsonStruct

func NewJsonStruct() *JsonStruct

func (*JsonStruct) Load

func (jst *JsonStruct) Load(filename string, v interface{})

type StateDB

type StateDB interface {
	GetMatrixData(hash common.Hash) (val []byte)
	SetMatrixData(hash common.Hash, val []byte)
}

Jump to

Keyboard shortcuts

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