Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Path string // Path to config file Name string // Name (without extension) of config file )
View Source
var Config config
Config is a global variable that hold all the configurations need by the whole project NOTE: It must be initialised via ParseConfig() before use
Functions ¶
func ParseConfig ¶
ParseConfig parses the yml configuration file and initialise the Config variable
func ParseFlags ¶
func ParseFlags()
Types ¶
type BFTConfig ¶
type BFTConfig struct { HomeDir string `yaml:"homeDir"` // Path to CometBFT config MockTransactions bool `yaml:"mockTransactions"` // Mock transacitons SkipSourceSelection bool `yaml:"skipSourceSelection"` // Source field selection }
BFTConfig is the configuration for using CometBFT
type CollectorConfig ¶
type DBConfig ¶
type DBConfig struct { Username string `yaml:"username"` // Username for the specific database to be connected Password string `yaml:"password"` // Password for the specific database to be connected Port int `yaml:"port"` // Database connection port DBName string `yaml:"dbName"` // Name for the database used URL string `yaml:"URL"` // Database connection URL }
DBConfig is the configuration for database connection and operation
type ErrorLogConfig ¶
type ErrorLogConfig struct { FileName string `yaml:"fileName"` // Name and path to the error log MaxSize int `yaml:"maxSize"` // Megabytes MaxAge int `yaml:"maxAge"` // Days MaxBackups int `yaml:"maxBackups"` // How much old error log files to retain ToStderr bool `yaml:"toStderr"` // Log to stderr (except file) or not ToFile bool `yaml:"toFile"` // Log to file or not }
type InfoLogConfig ¶
type InfoLogConfig struct { FileName string `yaml:"fileName"` // Name and path to the info log MaxSize int `yaml:"maxSize"` // Megabytes MaxAge int `yaml:"maxAge"` // Days MaxBackups int `yaml:"maxBackups"` // How much old info log files to retain ToStdout bool `yaml:"toStdout"` // Log to stdout (except file) or not ToFile bool `yaml:"toFile"` // Log to file or not }
type LogConfig ¶
type LogConfig struct { Development bool `yaml:"development"` // Development logger has DEBUG level and is more human-friendly Encoding string `yaml:"encoding"` // Default: JSON for production InfoConfig InfoLogConfig `mapstructure:"info"` // Sub-config for info-level logs ErrorConfig ErrorLogConfig `mapstructure:"error"` // Sub-config for error-level logs }
LogConfig is the configuration for zap logger
type P2pConfig ¶
type P2pConfig struct { Addr string `yaml:"addr"` // libp2p listening address (default: 0.0.0.0) Port int `yaml:"port"` // libp2p listening port GroupName string `yaml:"groupName"` // Name used for discovering nodes via mDNS PeerLimit int `yaml:"peerLimit"` // Max number of peers this node can establish connection to DebugAutoconnectMultiaddr string `yaml:"debugAutoconnectMultiaddr"` // Multiaddr of node to automatically connect to. }
type TrConfig ¶
type TrConfig struct { RpcAddress string `yaml:"rpcAddress"` UnlimitedRPC bool `yaml:"unlimitedRPC"` EventSignature string `yaml:"eventSignature"` SearchLimit int `yaml:"searchLimit"` DeployBlock int `yaml:"DeployBlock"` // Corrected field name Confirmations int `yaml:"confirmations"` Timing int `yaml:"timing"` // Corrected field name IsTest bool `yaml:"istest"` }
Click to show internal directories.
Click to hide internal directories.