MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / configInit

Function configInit

cmd/cql/internal/cfg.go:89–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

87}
88
89func 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
111func addWaitFlag(cmd *Command) {
112 cmd.Flag.BoolVar(&waitTxConfirmation, "wait-tx-confirm", false, "Wait for transaction confirmation")

Callers 10

runConsoleFunction · 0.85
runWalletFunction · 0.85
runMirrorFunction · 0.85
runDropFunction · 0.85
runTransferFunction · 0.85
runRPCFunction · 0.85
runGrantFunction · 0.85
runExplorerFunction · 0.85
runCreateFunction · 0.85
runAdapterFunction · 0.85

Calls 9

HomeDirExpandFunction · 0.92
InitFunction · 0.92
readMasterKeyFunction · 0.85
SetExitStatusFunction · 0.85
ExitFunction · 0.85
ErrorMethod · 0.80
WithErrorMethod · 0.80
InfoMethod · 0.80
WithFieldMethod · 0.80

Tested by

no test coverage detected