bump version to 0.4.1, release notes, small fixes
This commit is contained in:
parent
57d10eece3
commit
ead5415693
64
cmd/root.go
64
cmd/root.go
|
@ -38,25 +38,24 @@ var rootCmd = &cobra.Command{
|
|||
bandwidth-efficient interface to the Zcash blockchain`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
opts := &common.Options{
|
||||
GRPCBindAddr: viper.GetString("grpc-bind-addr"),
|
||||
HTTPBindAddr: viper.GetString("http-bind-addr"),
|
||||
TLSCertPath: viper.GetString("tls-cert"),
|
||||
TLSKeyPath: viper.GetString("tls-key"),
|
||||
LogLevel: viper.GetUint64("log-level"),
|
||||
LogFile: viper.GetString("log-file"),
|
||||
ZcashConfPath: viper.GetString("zcash-conf-path"),
|
||||
NoTLSVeryInsecure: viper.GetBool("no-tls-very-insecure"),
|
||||
DataDir: viper.GetString("data-dir"),
|
||||
Redownload: viper.GetBool("redownload"),
|
||||
Darkside: viper.GetBool("darkside-very-insecure"),
|
||||
DarksideTimeout: viper.GetUint64("darkside-timeout"),
|
||||
GRPCBindAddr: viper.GetString("grpc-bind-addr"),
|
||||
HTTPBindAddr: viper.GetString("http-bind-addr"),
|
||||
TLSCertPath: viper.GetString("tls-cert"),
|
||||
TLSKeyPath: viper.GetString("tls-key"),
|
||||
LogLevel: viper.GetUint64("log-level"),
|
||||
LogFile: viper.GetString("log-file"),
|
||||
ZcashConfPath: viper.GetString("zcash-conf-path"),
|
||||
NoTLSVeryInsecure: viper.GetBool("no-tls-very-insecure"),
|
||||
GenCertVeryInsecure: viper.GetBool("gen-cert-very-insecure"),
|
||||
DataDir: viper.GetString("data-dir"),
|
||||
Redownload: viper.GetBool("redownload"),
|
||||
Darkside: viper.GetBool("darkside-very-insecure"),
|
||||
DarksideTimeout: viper.GetUint64("darkside-timeout"),
|
||||
}
|
||||
|
||||
common.Log.Debugf("Options: %#v\n", opts)
|
||||
|
||||
filesThatShouldExist := []string{
|
||||
opts.TLSCertPath,
|
||||
opts.TLSKeyPath,
|
||||
opts.LogFile,
|
||||
}
|
||||
if !fileExists(opts.LogFile) {
|
||||
|
@ -65,14 +64,15 @@ var rootCmd = &cobra.Command{
|
|||
if !opts.Darkside {
|
||||
filesThatShouldExist = append(filesThatShouldExist, opts.ZcashConfPath)
|
||||
}
|
||||
if !opts.NoTLSVeryInsecure && !opts.GenCertVeryInsecure {
|
||||
filesThatShouldExist = append(filesThatShouldExist,
|
||||
opts.TLSCertPath, opts.TLSKeyPath)
|
||||
}
|
||||
|
||||
for _, filename := range filesThatShouldExist {
|
||||
if opts.NoTLSVeryInsecure && (filename == opts.TLSCertPath || filename == opts.TLSKeyPath) {
|
||||
continue
|
||||
}
|
||||
if !fileExists(filename) {
|
||||
os.Stderr.WriteString(fmt.Sprintf("\n ** File does not exist: %s\n\n", filename))
|
||||
os.Exit(1)
|
||||
common.Log.Fatal("required file ", filename, " does not exist")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ func startServer(opts *common.Options) error {
|
|||
var server *grpc.Server
|
||||
|
||||
if opts.NoTLSVeryInsecure {
|
||||
common.Log.Warningln("Starting insecure server")
|
||||
common.Log.Warningln("Starting insecure no-TLS (plaintext) server")
|
||||
fmt.Println("Starting insecure server")
|
||||
server = grpc.NewServer(
|
||||
grpc.StreamInterceptor(
|
||||
|
@ -132,13 +132,22 @@ func startServer(opts *common.Options) error {
|
|||
grpc_prometheus.UnaryServerInterceptor),
|
||||
))
|
||||
} else {
|
||||
transportCreds, err := credentials.NewServerTLSFromFile(opts.TLSCertPath, opts.TLSKeyPath)
|
||||
if err != nil {
|
||||
common.Log.WithFields(logrus.Fields{
|
||||
"cert_file": opts.TLSCertPath,
|
||||
"key_path": opts.TLSKeyPath,
|
||||
"error": err,
|
||||
}).Fatal("couldn't load TLS credentials")
|
||||
var transportCreds credentials.TransportCredentials
|
||||
if opts.GenCertVeryInsecure {
|
||||
common.Log.Warning("Certificate and key not provided, generating self signed values")
|
||||
fmt.Println("Starting insecure self-certificate server")
|
||||
tlsCert := common.GenerateCerts()
|
||||
transportCreds = credentials.NewServerTLSFromCert(tlsCert)
|
||||
} else {
|
||||
var err error
|
||||
transportCreds, err = credentials.NewServerTLSFromFile(opts.TLSCertPath, opts.TLSKeyPath)
|
||||
if err != nil {
|
||||
common.Log.WithFields(logrus.Fields{
|
||||
"cert_file": opts.TLSCertPath,
|
||||
"key_path": opts.TLSKeyPath,
|
||||
"error": err,
|
||||
}).Fatal("couldn't load TLS credentials")
|
||||
}
|
||||
}
|
||||
server = grpc.NewServer(
|
||||
grpc.Creds(transportCreds),
|
||||
|
@ -279,6 +288,7 @@ func init() {
|
|||
rootCmd.Flags().String("log-file", "./server.log", "log file to write to")
|
||||
rootCmd.Flags().String("zcash-conf-path", "./zcash.conf", "conf file to pull RPC creds from")
|
||||
rootCmd.Flags().Bool("no-tls-very-insecure", false, "run without the required TLS certificate, only for debugging, DO NOT use in production")
|
||||
rootCmd.Flags().Bool("gen-cert-very-insecure", false, "run with self-signed TLS certificate, only for debugging, DO NOT use in production")
|
||||
rootCmd.Flags().Bool("redownload", false, "re-fetch all blocks from zcashd; reinitialize local cache files")
|
||||
rootCmd.Flags().String("data-dir", "/var/lib/lightwalletd", "data directory (such as db)")
|
||||
rootCmd.Flags().Bool("darkside-very-insecure", false, "run with GRPC-controllable mock zcashd for integration testing (shuts down after 30 minutes)")
|
||||
|
@ -300,6 +310,8 @@ func init() {
|
|||
viper.SetDefault("zcash-conf-path", "./zcash.conf")
|
||||
viper.BindPFlag("no-tls-very-insecure", rootCmd.Flags().Lookup("no-tls-very-insecure"))
|
||||
viper.SetDefault("no-tls-very-insecure", false)
|
||||
viper.BindPFlag("gen-cert-very-insecure", rootCmd.Flags().Lookup("gen-cert-very-insecure"))
|
||||
viper.SetDefault("gen-cert-very-insecure", false)
|
||||
viper.BindPFlag("redownload", rootCmd.Flags().Lookup("redownload"))
|
||||
viper.SetDefault("redownload", false)
|
||||
viper.BindPFlag("data-dir", rootCmd.Flags().Lookup("data-dir"))
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// Copyright (c) 2019-2020 The Zcash developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or https://www.opensource.org/licenses/mit-license.php .
|
||||
|
||||
// Package common contains utilities that are shared by other packages.
|
||||
package common
|
||||
|
||||
import (
|
||||
|
@ -28,12 +30,14 @@ type BlockCache struct {
|
|||
mutex sync.RWMutex
|
||||
}
|
||||
|
||||
// GetNextHeight returns the height of the lowest unobtained block.
|
||||
func (c *BlockCache) GetNextHeight() int {
|
||||
c.mutex.RLock()
|
||||
defer c.mutex.RUnlock()
|
||||
return c.nextBlock
|
||||
}
|
||||
|
||||
// GetLatestHash returns the hash (block ID) of the most recent (highest) known block.
|
||||
func (c *BlockCache) GetLatestHash() []byte {
|
||||
c.mutex.RLock()
|
||||
defer c.mutex.RUnlock()
|
||||
|
@ -171,6 +175,7 @@ func (c *BlockCache) setLatestHash() {
|
|||
}
|
||||
}
|
||||
|
||||
// Reset is used only for darkside testing.
|
||||
func (c *BlockCache) Reset(startHeight int) {
|
||||
c.setDbFiles(c.firstBlock) // empty the cache
|
||||
c.firstBlock = startHeight
|
||||
|
@ -367,6 +372,7 @@ func (c *BlockCache) GetLatestHeight() int {
|
|||
return c.nextBlock - 1
|
||||
}
|
||||
|
||||
// Sync ensures that the db files are flushed to disk, can be called unnecessarily.
|
||||
func (c *BlockCache) Sync() {
|
||||
c.lengthsFile.Sync()
|
||||
c.blocksFile.Sync()
|
||||
|
|
|
@ -18,24 +18,27 @@ import (
|
|||
)
|
||||
|
||||
// 'make build' will overwrite this string with the output of git-describe (tag)
|
||||
var Version = "v0.0.0.0-dev"
|
||||
var GitCommit = ""
|
||||
var BuildDate = ""
|
||||
var BuildUser = ""
|
||||
var (
|
||||
Version = "v0.0.0.0-dev"
|
||||
GitCommit = ""
|
||||
BuildDate = ""
|
||||
BuildUser = ""
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
GRPCBindAddr string `json:"grpc_bind_address,omitempty"`
|
||||
HTTPBindAddr string `json:"http_bind_address,omitempty"`
|
||||
TLSCertPath string `json:"tls_cert_path,omitempty"`
|
||||
TLSKeyPath string `json:"tls_cert_key,omitempty"`
|
||||
LogLevel uint64 `json:"log_level,omitempty"`
|
||||
LogFile string `json:"log_file,omitempty"`
|
||||
ZcashConfPath string `json:"zcash_conf,omitempty"`
|
||||
NoTLSVeryInsecure bool `json:"no_tls_very_insecure,omitempty"`
|
||||
Redownload bool `json:"redownload"`
|
||||
DataDir string `json:"data-dir"`
|
||||
Darkside bool `json:"darkside"`
|
||||
DarksideTimeout uint64 `json:"darkside-timeout"`
|
||||
GRPCBindAddr string `json:"grpc_bind_address,omitempty"`
|
||||
HTTPBindAddr string `json:"http_bind_address,omitempty"`
|
||||
TLSCertPath string `json:"tls_cert_path,omitempty"`
|
||||
TLSKeyPath string `json:"tls_cert_key,omitempty"`
|
||||
LogLevel uint64 `json:"log_level,omitempty"`
|
||||
LogFile string `json:"log_file,omitempty"`
|
||||
ZcashConfPath string `json:"zcash_conf,omitempty"`
|
||||
NoTLSVeryInsecure bool `json:"no_tls_very_insecure,omitempty"`
|
||||
GenCertVeryInsecure bool `json:"gen_cert_very_insecure,omitempty"`
|
||||
Redownload bool `json:"redownload"`
|
||||
DataDir string `json:"data_dir"`
|
||||
Darkside bool `json:"darkside"`
|
||||
DarksideTimeout uint64 `json:"darkside_timeout"`
|
||||
}
|
||||
|
||||
// RawRequest points to the function to send a an RPC request to zcashd;
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
0.4.1 Release Notes
|
||||
===============================
|
||||
|
||||
Lightwalletd version 0.4.1 is now available from:
|
||||
|
||||
<https://github.com/zcash/lightwalletd/releases/tag/v0.4.1>
|
||||
|
||||
Or cloned from:
|
||||
|
||||
<https://github.com/zcash/lightwalletd/tree/v0.4.1>
|
||||
|
||||
Lightwalletd must be built from source code (there are no binary releases
|
||||
at this time).
|
||||
|
||||
This minor release includes various bug fixes, performance
|
||||
improvements, and test code improvements.
|
||||
|
||||
Please report bugs using the issue tracker at GitHub:
|
||||
|
||||
<https://github.com/zcash/lightwalletd/issues>
|
||||
|
||||
How to Upgrade
|
||||
==============
|
||||
|
||||
If you are running an older version, shut it down. Run `make` to generate
|
||||
the `./lightwalletd` executable. Run `./lightwalletd version` to verify
|
||||
that you're running the correct version (v0.4.0). Some of the command-line
|
||||
arguments (options) have changed since the previous release; please
|
||||
run `./lightwalletd help` to view them.
|
||||
|
||||
Compatibility
|
||||
==============
|
||||
|
||||
Lightwalletd is supported and extensively tested on operating systems using
|
||||
the Linux kernel, and to a lesser degree macOS. It is not recommended
|
||||
to use Lightwalletd on unsupported systems.
|
||||
|
||||
0.4.1 change log
|
||||
=================
|
||||
|
||||
### Infrastructure
|
||||
- #161 Add docker-compose
|
||||
- #227 Added tekton for Docker image build
|
||||
- #236 Add http endpoint and prometheus metrics framework
|
||||
|
||||
### Tests and QA
|
||||
- #234 darksidewalletd
|
||||
|
||||
### Documentation
|
||||
- #107 Reorg documents for updates and upcoming new details
|
||||
- #188 add documentation for lightwalletd APIs and data types
|
||||
- #195 add simple gRPC test client
|
||||
- #270 add issue and PR templates
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Thanks to everyone who directly contributed to this release:
|
||||
|
||||
- adityapk00
|
||||
- Marshall Gaucher
|
||||
- Kevin Gorhan
|
||||
- Taylor Hornby
|
||||
- Linda Lee
|
||||
- Brad Miller
|
||||
- Charlie O'Keefe
|
||||
- Larry Ruane
|
||||
- Za Wilcox
|
||||
- Ben Wilson
|
Loading…
Reference in New Issue