add -version argument to ingest and server executables, v0.1.0

This commit is contained in:
Larry Ruane 2019-11-07 16:20:45 -07:00 committed by Larry Ruane
parent 36b5c588ec
commit f143bcf332
2 changed files with 13 additions and 0 deletions

View File

@ -31,6 +31,7 @@ type Options struct {
logLevel uint64
logPath string
zcashConfPath string
wantVersion bool
}
func main() {
@ -39,10 +40,15 @@ func main() {
flag.Uint64Var(&opts.logLevel, "log-level", uint64(logrus.InfoLevel), "log level (logrus 1-7)")
flag.StringVar(&opts.logPath, "log-file", "", "log file to write to")
flag.StringVar(&opts.zcashConfPath, "conf-file", "", "conf file to pull RPC creds from")
flag.BoolVar(&opts.wantVersion, "version", false, "version (major.minor.patch)")
// TODO prod metrics
// TODO support config from file and env vars
flag.Parse()
if opts.wantVersion {
fmt.Println("lightwalletd ingest version v0.1.0")
return
}
if opts.dbPath == "" {
flag.Usage()
os.Exit(1)

View File

@ -90,6 +90,7 @@ type Options struct {
logPath string `json:"log_file,omitempty"`
zcashConfPath string `json:"zcash_conf,omitempty"`
veryInsecure bool `json:"very_insecure,omitempty"`
wantVersion bool
}
func fileExists(filename string) bool {
@ -110,10 +111,16 @@ func main() {
flag.StringVar(&opts.logPath, "log-file", "./server.log", "log file to write to")
flag.StringVar(&opts.zcashConfPath, "conf-file", "./zcash.conf", "conf file to pull RPC creds from")
flag.BoolVar(&opts.veryInsecure, "very-insecure", false, "run without the required TLS certificate, only for debugging, DO NOT use in production")
flag.BoolVar(&opts.wantVersion, "version", false, "version (major.minor.patch)")
// TODO prod metrics
// TODO support config from file and env vars
flag.Parse()
if opts.wantVersion {
fmt.Println("lightwalletd ingest version v0.1.0")
return
}
filesThatShouldExist := []string{
opts.dbPath,
opts.tlsCertPath,