Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // File names from which we attempt to read configuration. DefaultConfigFiles = []string{"config.yml", "config.yaml"} // Launchd doesn't set root env variables, so there is default DefaultConfigDirs = []string{getCurrentDirectory(), "~/.iotex-analyser", "/usr/local/etc/iotex-analyser", "/etc/iotex-analyser"} )
View Source
var ( // Default is the default config Default = Config{ Server: Server{ Http: "", Addr: "/tmp/iotex-analyser.sock", }, Iotex: Iotex{ BatchSize: 64, }, BlockDB: coredb.Config{ NumRetries: 3, MaxCacheSize: 64, BlockStoreBatchSize: 16, V2BlocksToSplitDB: 1000000, Compressor: "Snappy", CompressLegacy: false, SplitDBSizeMB: 0, SplitDBHeight: 900000, HistoryStateRetention: 2000, }, SubLogs: make(map[string]log.GlobalConfig), Genesis: genesis.Default, } )
Functions ¶
func FileExists ¶
FileExists checks to see if a file exist at the provided path.
func FindDefaultConfigPath ¶
func FindDefaultConfigPath() string
FindDefaultConfigPath returns the first path that contains a config file. If none of the combination of DefaultConfigDirs and DefaultConfigFiles contains a config file, return empty string.
Types ¶
type Config ¶
type Config struct {
Genesis genesis.Genesis `yaml:"genesis"`
Server Server `yaml:"server"`
Database Database `yaml:"database"`
Iotex Iotex `yaml:"iotex"`
BlockDB coredb.Config `yaml:"blockDB"`
Log log.GlobalConfig `yaml:"log" json:"-"`
SubLogs map[string]log.GlobalConfig `yaml:"subLogs" json:"-"`
}
type Database ¶
type Database struct {
Driver string `yaml:"driver" env:"DB_DRIVER"`
Host string `yaml:"host" env:"DB_HOST"`
Port string `yaml:"port" env:"DB_PORT"`
User string `yaml:"user" env:"DB_USER"`
Password string `yaml:"password" env:"DB_PASSWORD"`
Name string `yaml:"name" env:"DB_NAME"`
Debug bool `yaml:"debug" env:"DB_DEBUG"`
}
type Iotex ¶
type Iotex struct {
CrawlMode bool `yaml:"crawlMode"`
CrawlHeight []uint64 `yaml:"crawlHeight"`
DisableRebuildDB bool `yaml:"disableRebuildDB"`
CatchUpMode bool `yaml:"catchUpMode"`
CatchUpStartHeight uint64 `yaml:"catchUpStartHeight"`
ChainEndPoint string `yaml:"chainEndPoint" env:"IOTEX_CHAIN_END_POINT"`
ChainInsecure bool `yaml:"chainInsecure"`
BatchSize uint64 `yaml:"batchSize"` //default 64, ~ 10 blocks
}
Click to show internal directories.
Click to hide internal directories.