Documentation ¶
Index ¶
- Constants
- Variables
- func IsLogOn(logType LogType) bool
- type ChainConf
- type ChainConfs
- func (cc ChainConfs) GetChainElectType(chainid common.ChainID) (common.ElectionType, error)
- func (cc ChainConfs) GetGenesisDataNodeIds(chainid common.ChainID) []common.NodeID
- func (cc ChainConfs) GetInitCommittee(chainid common.ChainID) []common.NodeID
- func (cc ChainConfs) Len() int
- func (cc ChainConfs) Less(i, j int) bool
- func (cc ChainConfs) Swap(i, j int)
- func (cc ChainConfs) Validate() error
- type ConfValidator
- type Config
- type DConfig
- type ETHRPCConfig
- type ElectConf
- type LogType
- type NConfig
- type NoticeConf
- type P2PConfig
- type RPCConfig
- type Release
- type ReleaseDef
- type ReleaseDefs
- type Releases
- type Starter
Constants ¶
View Source
const ( NoticeDefaultAddr = "127.0.0.1:6379" NoticeDefaultPwd = "" NoticeDefaultDB = 0 NoticeDefaultQueue = "QueueOfBlocks" )
View Source
const ( // all letters must be captitalized ORIGIN Release = "ORIGIN" V2_10_3 Release = "V2_10_3" ORIGINFORKAT common.Height = 0 V2_10_3FORKAT common.Height = 30000000 )
View Source
const DefaultLoadLimit = 1
Variables ¶
View Source
var ( SystemStarterPrivate cipher.ECCPrivateKey SystemStarterPublic cipher.ECCPublicKey SystemStarterPK []byte )
View Source
var (
DefaultEthRpcEndpoint = common.Endpoint{NetType: "tcp", Address: common.DefaultEthRpcAddress}
)
Functions ¶
Types ¶
type ChainConf ¶
type ChainConf struct { ID common.ChainID `yaml:"id" json:"id"` // ID of the chain ParentID common.ChainID `yaml:"parentid" json:"parentid"` // ID of the parent chain,if there's no parent chain (main chain no parent),should be '1048576',IsNil()==true GenesisDataservers []string `yaml:"gdataservers" json:"gdataservers"` // string array of nodeid of the genesis data node GenesisDataserverIds []common.NodeID `yaml:"-" json:"-"` // the nodeid array of genesis data node, convert from GenesisDataservers in validate() Dataservers []string `yaml:"dataservers" json:"dataservers"` // String array of nodeid of non genesis data node DataserverIds []common.NodeID `yaml:"-" json:"-"` // nodeid array of genesis and non-genesis data nodes, created in validate() ElectType common.ElectionType `yaml:"election" json:"election"` // election type:VRF,Managed CommitteeIdStrings []string `yaml:"committee" json:"committee"` // Array of nodeid strings for the initial committee CommitteeIds []common.NodeID `yaml:"-" json:"-"` // Array of NodeID for the initial committee Admins []string `yaml:"admins" json:"-"` // string array of account address of chain administrators AdminAddrs []common.Address `yaml:"-" json:"-"` // Address array of chain administrators SecondCoinId uint32 `yaml:"coinId" json:"coinId"` // local currency id SecondCoinName string `yaml:"coinName" json:"coinName"` // local currency name Attributes []string `yaml:"attributes"` // attribute strings of the chain }
type ChainConfs ¶
type ChainConfs []*ChainConf
func (ChainConfs) GetChainElectType ¶
func (cc ChainConfs) GetChainElectType(chainid common.ChainID) (common.ElectionType, error)
func (ChainConfs) GetGenesisDataNodeIds ¶
func (cc ChainConfs) GetGenesisDataNodeIds(chainid common.ChainID) []common.NodeID
func (ChainConfs) GetInitCommittee ¶
func (cc ChainConfs) GetInitCommittee(chainid common.ChainID) []common.NodeID
func (ChainConfs) Len ¶
func (cc ChainConfs) Len() int
func (ChainConfs) Less ¶
func (cc ChainConfs) Less(i, j int) bool
func (ChainConfs) Swap ¶
func (cc ChainConfs) Swap(i, j int)
func (ChainConfs) Validate ¶
func (cc ChainConfs) Validate() error
type ConfValidator ¶
type ConfValidator interface {
Validate() error
}
type Config ¶
type Config struct { PriKeyString string `yaml:"priKey"` // hex string of private key of the node LoadLimit int `yaml:"loadlimit"` // Load upper limit. Configure the current node to make consensus on several chains at the same time. Default loadlimit = 2 NetworkConf NConfig `yaml:"network"` // network config DataConf DConfig `yaml:"data"` // data node config LogTypes []LogType `yaml:"logs"` // log types should print LogPath string `yaml:"logpath"` // log file path Chains ChainConfs `yaml:"chains"` // configs for genesis chains TxCount uint64 `yaml:"txCount"` // NetDelay []int `yaml:"netDelay"` // range of network delay (for debugging) WaitingTime *time.Duration `yaml:"waitingTime"` // delay for consensus NodeType *common.NodeType `yaml:"nodetype"` // type of node: Consensus:0, Data:1, Memo:2 ForChain *common.ChainID `yaml:"forchain"` // specifies the chain of node services FullData bool `yaml:"fulldata"` // whether a full data node CheckData bool `yaml:"checkdata"` // whether need to check old data Compatible *bool `yaml:"compatible"` // Nid *common.NodeID `yaml:"-"` // The nodeid object obtained by parsing Nodeidstring PrivKey cipher.ECCPrivateKey `yaml:"-"` // The private key object obtained by parsing PriKeyString StandAlone bool `yaml:"standAlone"` // whether start in single chain mode Noticer *NoticeConf `yaml:"notice"` Starter *Starter `yaml:"starter"` // starter private key Releases ReleaseDefs `yaml:"releases"` // release definations }
func LoadConfig ¶
func (*Config) IsCompatible ¶
func (*Config) MakeLogTypeMap ¶
func (c *Config) MakeLogTypeMap()
type ETHRPCConfig ¶
type ETHRPCConfig struct { MessageBufferSize uint16 `yaml:"buffersize" json:"-"` KeepaliveInterval int64 `yaml:"keepaliveinterval" json:"-"` EthRPCServerAddr *common.Endpoint `yaml:"ethrpcserver" json:"ethrpcserver"` }
func (*ETHRPCConfig) GetRpcEndpoint ¶
func (rpc *ETHRPCConfig) GetRpcEndpoint() common.Endpoint
type ElectConf ¶
type ElectConf struct { ChainID common.ChainID `yaml:"chainid"` // ID of the chain Election common.ElectionType `yaml:"election"` // Election type, default NONE SyncBlock bool `yaml:"syncblock"` // no use }
type NConfig ¶
type NConfig struct { DataServers []common.Dataserver `yaml:"bootservers" json:"bootservers"` P2Ps *P2PConfig `yaml:"p2p",omitempty json:"p2p"` RPCs *RPCConfig `yaml:"rpc",omitempty json:"rpc"` ETHRPC *ETHRPCConfig `yaml:"ethrpc",omitempty json:"ethrpc"` Pprof *string `yaml:"pprof",omitempty json:"pprof"` DataServerMap map[common.NodeID][]common.Dataserver `yaml:"-" json:"-"` // nodeid -> []Dataserver }
type NoticeConf ¶
type NoticeConf struct { ChainID *common.ChainID `yaml:"chainid" json:"chainid"` QueueSize int `yaml:"queueSize" json:"queueSize"` RedisAddr string `yaml:"addr" json:"addr"` RedisPwd string `yaml:"pwd" json:"pwd"` RedisDB int `yaml:"db" json:"db"` RedisQueue string `yaml:"queue" json:"queue"` }
func (*NoticeConf) String ¶
func (n *NoticeConf) String() string
func (*NoticeConf) Validate ¶
func (n *NoticeConf) Validate() error
type P2PConfig ¶
type P2PConfig struct {
PortRange *[2]uint16 `yaml:"portRange",omitempty json:"portRange"`
}
func (*P2PConfig) GetPortRange ¶
type RPCConfig ¶
type RPCConfig struct { MessageBufferSize uint16 `yaml:"buffersize" json:"-"` KeepaliveInterval int64 `yaml:"keepaliveinterval" json:"-"` RPCServerAddr *common.Endpoint `yaml:"rpcserver" json:"rpcserver"` }
func (*RPCConfig) GetRpcAddress ¶
func (*RPCConfig) GetRpcEndpoint ¶
func (rpc *RPCConfig) GetRpcEndpoint() common.Endpoint
type ReleaseDef ¶
type ReleaseDef struct { Name Release `yaml:"name"` ForkAt common.Height `yaml:"fork"` }
func (ReleaseDef) String ¶
func (d ReleaseDef) String() string
type ReleaseDefs ¶
type ReleaseDefs []ReleaseDef
func (ReleaseDefs) Validate ¶
func (defs ReleaseDefs) Validate() error
type Releases ¶
type Releases struct {
// contains filtered or unexported fields
}
var (
SysReleases *Releases
)
func NewReleases ¶
func NewReleases(defs ReleaseDefs) (*Releases, error)
Click to show internal directories.
Click to hide internal directories.