Browse Source

changed to variable

pull/1/head
jahway603 3 years ago
parent
commit
edac479e7d
  1. 6
      build.sh
  2. 8
      cmd/server/main.go

6
build.sh

@ -20,10 +20,10 @@ echo "+------'+------'+------'+------'+------'+------'+------'+------'+------'+-
# now to compiling...
echo ""
echo "You have go installed, so starting to compile hush lightwalletd for you..."
echo "You have go installed, so starting to compile Hush lightwalletd for you..."
cd `pwd`/cmd/server
go build -o lightwalletd main.go
mv lightwalletd `pwd`/../../lightwalletd
echo ""
echo "lightwalletd is now compiled for you."
echo "for options, run ./lightwalletd --help"
echo "Hush lightwalletd is now compiled for you. Enjoy and reach out if you need support."
echo "For options, run ./lightwalletd --help"

8
cmd/server/main.go

@ -88,6 +88,8 @@ type Options struct {
}
func main() {
var version = "0.1.1" // set version number
opts := &Options{}
flag.StringVar(&opts.bindAddr, "bind-addr", "127.0.0.1:9069", "the address to listen on")
flag.StringVar(&opts.tlsCertPath, "tls-cert", "", "the path to a TLS certificate (optional)")
@ -98,13 +100,11 @@ func main() {
flag.StringVar(&opts.hush3ConfPath, "conf-file", "", "conf file to pull RPC creds from")
flag.IntVar(&opts.cacheSize, "cache-size", 40000, "number of blocks to hold in the cache")
// creating --version so help2man will work
// creating --version as a requirement of help2man
if len(os.Args) > 1 && (os.Args[1] == "--version" || os.Args[1] == "-v") {
// TODO find a better method than hardcode the version number here
fmt.Printf("hush lightwalletd version 0.1.1\n")
fmt.Printf("Hush lightwalletd version " + version + "\n")
os.Exit(0)
}
// TODO determine why help2man is now complaining about --help even after I tried creating one...
// TODO prod metrics
// TODO support config from file and env vars

Loading…
Cancel
Save