()
| 87 | } |
| 88 | |
| 89 | func configInit() { |
| 90 | configFile = utils.HomeDirExpand(configFile) |
| 91 | |
| 92 | if password == "" { |
| 93 | password = readMasterKey(!withPassword) |
| 94 | } |
| 95 | |
| 96 | // init covenantsql driver |
| 97 | if err := client.Init(configFile, []byte(password)); err != nil { |
| 98 | ConsoleLog.WithError(err).Error("init covenantsql client failed") |
| 99 | SetExitStatus(1) |
| 100 | Exit() |
| 101 | } |
| 102 | |
| 103 | ConsoleLog.WithField("path", configFile).Info("init config success") |
| 104 | |
| 105 | // TODO(leventeliu): discover more specific confirmation duration from config. We don't have |
| 106 | // enough informations from config to do that currently, so just use a fixed and long enough |
| 107 | // duration. |
| 108 | waitTxConfirmationMaxDuration = 20 * conf.GConf.BPPeriod |
| 109 | } |
| 110 | |
| 111 | func addWaitFlag(cmd *Command) { |
| 112 | cmd.Flag.BoolVar(&waitTxConfirmation, "wait-tx-confirm", false, "Wait for transaction confirmation") |
no test coverage detected