ApiAddress string `mapstructure:"api_addr"`
+ VaultMode bool `mapstructure:"vault_mode"`
+
Time time.Time
+
+ // log file name
+ LogName string `mapstructure:"log_name"`
}
// Default configurable base parameters.
DBPath: "data",
KeysPath: "keystore",
HsmUrl: "",
+ LogName: "bytom.log",
}
}
//-----------------------------------------------------------------------------
type WalletConfig struct {
Disable bool `mapstructure:"disable"`
+ Rescan bool `mapstructure:"rescan"`
}
type RPCAuthConfig struct {
func DefaultWalletConfig() *WalletConfig {
return &WalletConfig{
Disable: false,
+ Rescan: false,
}
}
func DefaultDataDir() string {
// Try to place the data folder in the user's home dir
home := homeDir()
- dataDir := "./.bytom"
- if home != "" {
- switch runtime.GOOS {
- case "darwin":
- dataDir = filepath.Join(home, "Library", "Bytom")
- case "windows":
- dataDir = filepath.Join(home, "AppData", "Roaming", "Bytom")
- default:
- dataDir = filepath.Join(home, ".bytom")
- }
+ if home == "" {
+ return "./.bytom"
+ }
+ switch runtime.GOOS {
+ case "darwin":
+ return filepath.Join(home, "Library", "Bytom")
+ case "windows":
+ return filepath.Join(home, "AppData", "Roaming", "Bytom")
+ default:
+ return filepath.Join(home, ".bytom")
}
- return dataDir
}
func homeDir() string {