* update init
* update
* update fatal
func initFiles(cmd *cobra.Command, args []string) {
configFilePath := path.Join(config.RootDir, "config.toml")
if _, err := os.Stat(configFilePath); !os.IsNotExist(err) {
func initFiles(cmd *cobra.Command, args []string) {
configFilePath := path.Join(config.RootDir, "config.toml")
if _, err := os.Stat(configFilePath); !os.IsNotExist(err) {
- log.WithFields(log.Fields{"module": logModule, "config": configFilePath}).Panic("Already exists config file.")
+ log.WithFields(log.Fields{"module": logModule, "config": configFilePath}).Fatal("Already exists config file.")
}
switch config.ChainID {
}
switch config.ChainID {
fedFilePath := config.FederationFile()
if _, err := os.Stat(fedFilePath); os.IsNotExist(err) {
if err := cfg.ExportFederationFile(fedFilePath, config); err != nil {
fedFilePath := config.FederationFile()
if _, err := os.Stat(fedFilePath); os.IsNotExist(err) {
if err := cfg.ExportFederationFile(fedFilePath, config); err != nil {
- log.WithFields(log.Fields{"module": logModule, "config": fedFilePath, "error": err}).Panic("fail on export federation file")
+ log.WithFields(log.Fields{"module": logModule, "config": fedFilePath, "error": err}).Fatal("fail on export federation file")
if _, err := os.Stat(keyFilePath); os.IsNotExist(err) {
xprv, err := chainkd.NewXPrv(nil)
if err != nil {
if _, err := os.Stat(keyFilePath); os.IsNotExist(err) {
xprv, err := chainkd.NewXPrv(nil)
if err != nil {
- log.WithFields(log.Fields{"module": logModule, "err": err}).Panic("fail on generate private key")
+ log.WithFields(log.Fields{"module": logModule, "err": err}).Fatal("fail on generate private key")
}
if err := ioutil.WriteFile(keyFilePath, []byte(hex.EncodeToString(xprv[:])), 0600); err != nil {
}
if err := ioutil.WriteFile(keyFilePath, []byte(hex.EncodeToString(xprv[:])), 0600); err != nil {
- log.WithFields(log.Fields{"module": logModule, "err": err}).Panic("fail on save private key")
+ log.WithFields(log.Fields{"module": logModule, "err": err}).Fatal("fail on save private key")
}
log.WithFields(log.Fields{"pubkey": xprv.XPub()}).Info("success generate private")
}
log.WithFields(log.Fields{"pubkey": xprv.XPub()}).Info("success generate private")