Documentation ¶
Overview ¶
Package nodeconfig includes all the configuration variables for a node. It is a global configuration for node and other services. It will be included in node module, and other modules.
Index ¶
- Constants
- func GetPeerID() peer.ID
- func GetVersion() string
- func SetDefaultRole(r Role)
- func SetNetworkType(networkType NetworkType)
- func SetPeerID(pid peer.ID)
- func SetVersion(ver string)
- type BootNodeConfig
- type ConfigType
- type GeneralConfig
- type HttpConfig
- type LogConfig
- type LogContext
- type LogVerbosePrints
- type NetworkType
- type P2pConfig
- type PprofConfig
- type PrometheusConfig
- type RPCServerConfig
- type Role
- type RpcOptConfig
- type SysConfig
- type WsConfig
Constants ¶
const ( Mainnet = "mainnet" Testnet = "testnet" Pangaea = "pangaea" Partner = "partner" Stressnet = "stressnet" Devnet = "devnet" Localnet = "localnet" )
Constants for NetworkType TODO: replace this with iota. Leave the string parsing in command line
Variables ¶
This section is empty.
Functions ¶
func SetNetworkType ¶
func SetNetworkType(networkType NetworkType)
SetNetworkType set the networkType
Types ¶
type BootNodeConfig ¶
type BootNodeConfig struct { Version string General GeneralConfig P2P P2pConfig HTTP HttpConfig WS WsConfig RPCOpt RpcOptConfig Pprof PprofConfig Log LogConfig Sys *SysConfig `toml:",omitempty"` }
BootNodeConfig contains all the configs user can set for running Intelchain binary. Served as the bridge from user set flags to internal node configs. Also user can persist this structure to a toml file to avoid inputting all arguments.
func (BootNodeConfig) ToRPCServerConfig ¶
func (bnc BootNodeConfig) ToRPCServerConfig() nodeconfig.RPCServerConfig
type ConfigType ¶
type ConfigType struct { ShardID uint32 // ShardID of this node; TODO ek – revisit when resharding Port string // Port of the node. IP string // IP of the node. RPCServer RPCServerConfig // RPC server port and ip DebugMode bool // log every single process and error to help to debug the syncing issues NtpServer string DNSZone string WebHooks struct { Hooks *webhooks.Hooks } TraceEnable bool // contains filtered or unexported fields }
ConfigType is the structure of all node related configuration variables
func GetDefaultConfig ¶
func GetDefaultConfig() *ConfigType
GetDefaultConfig returns default config.
func (*ConfigType) GetNetworkType ¶
func (conf *ConfigType) GetNetworkType() NetworkType
GetNetworkType gets the networkType
func (*ConfigType) GetShardID ¶
func (conf *ConfigType) GetShardID() uint32
GetShardID returns the shardID.
func (*ConfigType) SetShardID ¶
func (conf *ConfigType) SetShardID(s uint32)
SetShardID set the ShardID
func (*ConfigType) String ¶
func (conf *ConfigType) String() string
type GeneralConfig ¶
type HttpConfig ¶
type LogConfig ¶
type LogConfig struct { Console bool Folder string FileName string RotateSize int RotateCount int RotateMaxAge int Verbosity int VerbosePrints LogVerbosePrints Context *LogContext `toml:",omitempty"` }
type LogContext ¶
type LogVerbosePrints ¶
type LogVerbosePrints struct {
Config bool
}
func FlagSliceToLogVerbosePrints ¶
func FlagSliceToLogVerbosePrints(verbosePrintsFlagSlice []string) LogVerbosePrints
type NetworkType ¶
type NetworkType string
NetworkType describes the type of Intelchain network
func (NetworkType) ChainConfig ¶
func (t NetworkType) ChainConfig() params.ChainConfig
ChainConfig returns the chain configuration for the network type.
func (NetworkType) String ¶
func (n NetworkType) String() string
type P2pConfig ¶
type P2pConfig struct { Port int IP string KeyFile string DHTDataStore *string `toml:",omitempty"` DiscConcurrency int // Discovery Concurrency value MaxConnsPerIP int DisablePrivateIPScan bool MaxPeers int64 // In order to disable Connection Manager, it only needs to // set both the high and low watermarks to zero. In this way, // using Connection Manager will be an optional feature. ConnManagerLowWatermark int ConnManagerHighWatermark int WaitForEachPeerToConnect bool // to disable p2p security (tls and noise) NoTransportSecurity bool // enable p2p NAT. NAT Manager takes care of setting NAT port mappings, and discovering external addresses NAT bool // custom user agent; explicitly set the user-agent, so we can differentiate from other Go libp2p users UserAgent string // p2p dial timeout DialTimeout time.Duration // P2P multiplexer type, should be comma separated (mplex, Yamux) Muxer string // No relay services, direct connections between peers only NoRelay bool }
type PprofConfig ¶
type PrometheusConfig ¶
type RPCServerConfig ¶
type RPCServerConfig struct { HTTPEnabled bool HTTPIp string HTTPPort int HTTPTimeoutRead time.Duration HTTPTimeoutWrite time.Duration HTTPTimeoutIdle time.Duration WSEnabled bool WSIp string WSPort int DebugEnabled bool NetworkRPCsEnabled bool RpcFilterFile string RateLimiterEnabled bool RequestsPerSecond int }
RPCServerConfig is the config for rpc listen addresses
type RpcOptConfig ¶
type RpcOptConfig struct { DebugEnabled bool // Enables PrivateDebugService APIs, including the EVM tracer EthRPCsEnabled bool // Expose Eth RPCs LegacyRPCsEnabled bool // Expose Legacy RPCs RpcFilterFile string // Define filters to enable/disable RPC exposure RateLimterEnabled bool // Enable Rate limiter for RPC RequestsPerSecond int // for RPC rate limiter }