 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- Variables
- func DoNotValidate(cfg Config) error
- func ValidateAPI(cfg Config) error
- func ValidateActPool(cfg Config) error
- func ValidateArchiveMode(cfg Config) error
- func ValidateDispatcher(cfg Config) error
- func ValidateForkHeights(cfg Config) error
- func ValidateRollDPoS(cfg Config) error
- type Config
- type System
- type Validate
Constants ¶
      View Source
      
  
    const ( // RollDPoSScheme means randomized delegated proof of stake RollDPoSScheme = "ROLLDPOS" // StandaloneScheme means that the node creates a block periodically regardless of others (if there is any) StandaloneScheme = "STANDALONE" // NOOPScheme means that the node does not create only block NOOPScheme = "NOOP" )
      View Source
      
  
const ( // GatewayPlugin is the plugin of accepting user API requests and serving blockchain data to users GatewayPlugin = iota )
Variables ¶
      View Source
      
  var ( // Default is the default config Default = Config{ Plugins: make(map[int]interface{}), SubLogs: make(map[string]log.GlobalConfig), Network: p2p.DefaultConfig, Chain: blockchain.DefaultConfig, ActPool: actpool.DefaultConfig, Consensus: consensus.DefaultConfig, DardanellesUpgrade: consensusfsm.DefaultDardanellesUpgradeConfig, BlockSync: blocksync.DefaultConfig, Dispatcher: dispatcher.DefaultConfig, API: api.DefaultConfig, System: System{ Active: true, HeartbeatInterval: 10 * time.Second, HTTPStatsPort: 8080, HTTPAdminPort: 0, StartSubChainInterval: 10 * time.Second, SystemLogDBPath: "/var/log", }, DB: db.DefaultConfig, Indexer: blockindex.DefaultConfig, Genesis: genesis.Default, NodeInfo: nodeinfo.DefaultConfig, ActionSync: actsync.DefaultConfig, } // ErrInvalidCfg indicates the invalid config value ErrInvalidCfg = errors.New("invalid config value") // Validates is the collection config validation functions Validates = []Validate{ ValidateRollDPoS, ValidateArchiveMode, ValidateDispatcher, ValidateAPI, ValidateActPool, ValidateForkHeights, } )
Dardanelles consensus config
Functions ¶
func ValidateActPool ¶
ValidateActPool validates the given config
func ValidateArchiveMode ¶
ValidateArchiveMode validates the state factory setting
func ValidateDispatcher ¶
ValidateDispatcher validates the dispatcher configs
func ValidateForkHeights ¶
ValidateForkHeights validates the forked heights
func ValidateRollDPoS ¶
ValidateRollDPoS validates the roll-DPoS configs
Types ¶
type Config ¶
type Config struct {
	Plugins            map[int]interface{}             `ymal:"plugins"`
	Network            p2p.Config                      `yaml:"network"`
	Chain              blockchain.Config               `yaml:"chain"`
	ActPool            actpool.Config                  `yaml:"actPool"`
	Consensus          consensus.Config                `yaml:"consensus"`
	DardanellesUpgrade consensusfsm.DardanellesUpgrade `yaml:"dardanellesUpgrade"`
	BlockSync          blocksync.Config                `yaml:"blockSync"`
	Dispatcher         dispatcher.Config               `yaml:"dispatcher"`
	API                api.Config                      `yaml:"api"`
	System             System                          `yaml:"system"`
	DB                 db.Config                       `yaml:"db"`
	Indexer            blockindex.Config               `yaml:"indexer"`
	Log                log.GlobalConfig                `yaml:"log"`
	SubLogs            map[string]log.GlobalConfig     `yaml:"subLogs"`
	Genesis            genesis.Genesis                 `yaml:"genesis"`
	NodeInfo           nodeinfo.Config                 `yaml:"nodeinfo"`
	ActionSync         actsync.Config                  `yaml:"actionSync"`
}
    Config is the root config struct, each package's config should be put as its sub struct
type System ¶
type System struct {
	// Active is the status of the node. True means active and false means stand-by
	Active            bool          `yaml:"active"`
	HeartbeatInterval time.Duration `yaml:"heartbeatInterval"`
	// HTTPProfilingPort is the port number to access golang performance profiling data of a blockchain node. It is
	// 0 by default, meaning performance profiling has been disabled
	HTTPAdminPort         int           `yaml:"httpAdminPort"`
	HTTPStatsPort         int           `yaml:"httpStatsPort"`
	StartSubChainInterval time.Duration `yaml:"startSubChainInterval"`
	SystemLogDBPath       string        `yaml:"systemLogDBPath"`
	MptrieLogPath         string        `yaml:"mptrieLogPath"`
}
    System is the system config
 Click to show internal directories. 
   Click to hide internal directories.