Skip to content

Commit

Permalink
Update module references.
Browse files Browse the repository at this point in the history
Change http and grpc bind ports.
  • Loading branch information
Asherda committed Sep 27, 2020
1 parent ac1bf84 commit 8abe75a
Show file tree
Hide file tree
Showing 26 changed files with 55 additions and 196 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ To checkout an existing branch (assuming you are in `lightwalletd` directory):
```bash
git checkout [existing_branch_name]
```
If you are fixing a bug or implementing a new feature, you likely will want to create a new branch. If you are reviewing code or working on existing branches, you likely will checkout an existing branch. To view the list of current Lightwalletd GitHub issues, click [here](https://github.com/zcash/lightwalletd/issues).
If you are fixing a bug or implementing a new feature, you likely will want to create a new branch. If you are reviewing code or working on existing branches, you likely will checkout an existing branch. To view the list of current Lightwalletd GitHub issues, click [here](https://github.com/asherda/lightwalletd/issues).

## Make & Commit Changes
If you have created a new branch or checked out an existing one, it is time to make changes to your local source code. Below are some formalities for commits:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
# Create layer in case you want to modify local lightwalletd code
FROM golang:1.13 AS lightwalletd_base

ADD . /go/src/github.com/zcash/lightwalletd
WORKDIR /go/src/github.com/zcash/lightwalletd
ADD . /go/src/github.com/asherda/lightwalletd
WORKDIR /go/src/github.com/asherda/lightwalletd
RUN make \
&& /usr/bin/install -c ./lightwalletd /usr/local/bin/ \
&& mkdir -p /var/lib/lightwalletd/db \
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ VERSION := `git describe --tags`
GITCOMMIT := `git rev-parse HEAD`
BUILDDATE := `date +%Y-%m-%d`
BUILDUSER := `whoami`
LDFLAGSSTRING :=-X github.com/zcash/lightwalletd/common.Version=$(VERSION)
LDFLAGSSTRING +=-X github.com/zcash/lightwalletd/common.GitCommit=$(GITCOMMIT)
LDFLAGSSTRING +=-X github.com/zcash/lightwalletd/common.Branch=$(BRANCH)
LDFLAGSSTRING +=-X github.com/zcash/lightwalletd/common.BuildDate=$(BUILDDATE)
LDFLAGSSTRING +=-X github.com/zcash/lightwalletd/common.BuildUser=$(BUILDUSER)
LDFLAGSSTRING :=-X github.com/asherda/lightwalletd/common.Version=$(VERSION)
LDFLAGSSTRING +=-X github.com/asherda/lightwalletd/common.GitCommit=$(GITCOMMIT)
LDFLAGSSTRING +=-X github.com/asherda/lightwalletd/common.Branch=$(BRANCH)
LDFLAGSSTRING +=-X github.com/asherda/lightwalletd/common.BuildDate=$(BUILDDATE)
LDFLAGSSTRING +=-X github.com/asherda/lightwalletd/common.BuildUser=$(BUILDUSER)
LDFLAGS :=-ldflags "$(LDFLAGSSTRING)"

# There are some files that are generated but are also in source control
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations of light wallets that use Lightwalletd.

# Overview

[lightwalletd](https://github.com/zcash/lightwalletd) is a backend service that provides a bandwidth-efficient interface to the Zcash blockchain. Currently, lightwalletd supports the Sapling protocol version and beyond as its primary concern. The intended purpose of lightwalletd is to support the development and operation of mobile-friendly shielded light wallets.
[lightwalletd](https://github.com/asherda/lightwalletd) is a backend service that provides a bandwidth-efficient interface to the Zcash blockchain. Currently, lightwalletd supports the Sapling protocol version and beyond as its primary concern. The intended purpose of lightwalletd is to support the development and operation of mobile-friendly shielded light wallets.

lightwalletd is a backend service that provides a bandwidth-efficient interface to the Zcash blockchain for mobile and other wallets, such as [Zecwallet](https://github.com/adityapk00/zecwallet-lite-lib).

Expand Down Expand Up @@ -60,15 +60,15 @@ Lightwalletd uses the following `zcashd` RPCs:

First, install [Go](https://golang.org/dl/#stable) version 1.11 or later. You can see your current version by running `go version`.

Clone the [current repository](https://github.com/zcash/lightwalletd) into a local directory that is _not_ within any component of
Clone the [current repository](https://github.com/asherda/lightwalletd) into a local directory that is _not_ within any component of
your `$GOPATH` (`$HOME/go` by default), then build the lightwalletd server binary by running `make`.

## To run SERVER

Assuming you used `make` to build the server, here's a typical developer invocation:

```
./lightwalletd --no-tls-very-insecure --zcash-conf-path ~/.zcash/zcash.conf --data-dir . --log-file /dev/stdout
./lightwalletd --no-tls-very-insecure --verus-conf-path ~/.komodo/VRSC/VRSC.conf --data-dir . --log-file /dev/stdout
```
Type `./lightwalletd help` to see the full list of options and arguments.

Expand Down Expand Up @@ -106,7 +106,7 @@ certbot certonly --standalone --preferred-challenges http -d some.forward.dns.co
Example using server binary built from Makefile:

```
./lightwalletd --tls-cert cert.pem --tls-key key.pem --zcash-conf-path /home/zcash/.zcash/zcash.conf --log-file /logs/server.log
./lightwalletd --tls-cert cert.pem --tls-key key.pem --verus-conf-path "/home/$USER/.komodo/VRSC.conf" --log-file /logs/server.log
```

## Block cache
Expand Down
28 changes: 14 additions & 14 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/reflection"

"github.com/zcash/lightwalletd/common"
"github.com/zcash/lightwalletd/common/logging"
"github.com/zcash/lightwalletd/frontend"
"github.com/zcash/lightwalletd/walletrpc"
"github.com/asherda/lightwalletd/common"
"github.com/asherda/lightwalletd/common/logging"
"github.com/asherda/lightwalletd/frontend"
"github.com/asherda/lightwalletd/walletrpc"
)

var cfgFile string
Expand All @@ -45,7 +45,7 @@ var rootCmd = &cobra.Command{
TLSKeyPath: viper.GetString("tls-key"),
LogLevel: viper.GetUint64("log-level"),
LogFile: viper.GetString("log-file"),
ZcashConfPath: viper.GetString("zcash-conf-path"),
VerusConfPath: viper.GetString("verus-conf-path"),
RPCUser: viper.GetString("rpcuser"),
RPCPassword: viper.GetString("rpcpassword"),
RPCHost: viper.GetString("rpchost"),
Expand All @@ -67,7 +67,7 @@ var rootCmd = &cobra.Command{
os.OpenFile(opts.LogFile, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0666)
}
if !opts.Darkside && (opts.RPCUser == "" || opts.RPCPassword == "" || opts.RPCHost == "" || opts.RPCPort == "") {
filesThatShouldExist = append(filesThatShouldExist, opts.ZcashConfPath)
filesThatShouldExist = append(filesThatShouldExist, opts.VerusConfPath)
}
if !opts.NoTLSVeryInsecure && !opts.GenCertVeryInsecure {
filesThatShouldExist = append(filesThatShouldExist,
Expand Down Expand Up @@ -189,7 +189,7 @@ func startServer(opts *common.Options) error {
if opts.RPCUser != "" && opts.RPCPassword != "" && opts.RPCHost != "" && opts.RPCPort != "" {
rpcClient, err = frontend.NewZRPCFromFlags(opts)
} else {
rpcClient, err = frontend.NewZRPCFromConf(opts.ZcashConfPath)
rpcClient, err = frontend.NewZRPCFromConf(opts.VerusConfPath)
}
if err != nil {
common.Log.WithFields(logrus.Fields{
Expand Down Expand Up @@ -291,13 +291,13 @@ func init() {
rootCmd.AddCommand(versionCmd)
cobra.OnInitialize(initConfig)
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is current directory, lightwalletd.yaml)")
rootCmd.Flags().String("http-bind-addr", "127.0.0.1:9068", "the address to listen for http on")
rootCmd.Flags().String("grpc-bind-addr", "127.0.0.1:9067", "the address to listen for grpc on")
rootCmd.Flags().String("http-bind-addr", "127.0.0.1:9078", "the address to listen for http on")
rootCmd.Flags().String("grpc-bind-addr", "127.0.0.1:9077", "the address to listen for grpc on")
rootCmd.Flags().String("tls-cert", "./cert.pem", "the path to a TLS certificate")
rootCmd.Flags().String("tls-key", "./cert.key", "the path to a TLS key file")
rootCmd.Flags().Int("log-level", int(logrus.InfoLevel), "log level (logrus 1-7)")
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().String("verus-conf-path", "./VRSC.conf", "conf file to pull RPC creds from")
rootCmd.Flags().String("rpcuser", "", "RPC user name")
rootCmd.Flags().String("rpcpassword", "", "RPC password")
rootCmd.Flags().String("rpchost", "", "RPC host")
Expand All @@ -310,9 +310,9 @@ func init() {
rootCmd.Flags().Int("darkside-timeout", 30, "override 30 minute default darkside timeout")

viper.BindPFlag("grpc-bind-addr", rootCmd.Flags().Lookup("grpc-bind-addr"))
viper.SetDefault("grpc-bind-addr", "127.0.0.1:9067")
viper.SetDefault("grpc-bind-addr", "127.0.0.1:9077")
viper.BindPFlag("http-bind-addr", rootCmd.Flags().Lookup("http-bind-addr"))
viper.SetDefault("http-bind-addr", "127.0.0.1:9068")
viper.SetDefault("http-bind-addr", "127.0.0.1:9078")
viper.BindPFlag("tls-cert", rootCmd.Flags().Lookup("tls-cert"))
viper.SetDefault("tls-cert", "./cert.pem")
viper.BindPFlag("tls-key", rootCmd.Flags().Lookup("tls-key"))
Expand All @@ -321,8 +321,8 @@ func init() {
viper.SetDefault("log-level", int(logrus.InfoLevel))
viper.BindPFlag("log-file", rootCmd.Flags().Lookup("log-file"))
viper.SetDefault("log-file", "./server.log")
viper.BindPFlag("zcash-conf-path", rootCmd.Flags().Lookup("zcash-conf-path"))
viper.SetDefault("zcash-conf-path", "./zcash.conf")
viper.BindPFlag("verus-conf-path", rootCmd.Flags().Lookup("verus-conf-path"))
viper.SetDefault("verus-conf-path", "./VRSC.conf")
viper.BindPFlag("rpcuser", rootCmd.Flags().Lookup("rpcuser"))
viper.BindPFlag("rpcpassword", rootCmd.Flags().Lookup("rpcpassword"))
viper.BindPFlag("rpchost", rootCmd.Flags().Lookup("rpchost"))
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package cmd
import (
"fmt"

"github.com/asherda/lightwalletd/common"
"github.com/spf13/cobra"
"github.com/zcash/lightwalletd/common"
)

// versionCmd represents the version command
Expand Down
2 changes: 1 addition & 1 deletion common/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"path/filepath"
"sync"

"github.com/asherda/lightwalletd/walletrpc"
"github.com/golang/protobuf/proto"
"github.com/zcash/lightwalletd/walletrpc"
)

// BlockCache contains a consecutive set of recent compact blocks in marshalled form.
Expand Down
4 changes: 2 additions & 2 deletions common/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"os"
"testing"

"github.com/zcash/lightwalletd/parser"
"github.com/zcash/lightwalletd/walletrpc"
"github.com/asherda/lightwalletd/parser"
"github.com/asherda/lightwalletd/walletrpc"
)

var compacts []*walletrpc.CompactBlock
Expand Down
6 changes: 3 additions & 3 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"strings"
"time"

"github.com/asherda/lightwalletd/parser"
"github.com/asherda/lightwalletd/walletrpc"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/zcash/lightwalletd/parser"
"github.com/zcash/lightwalletd/walletrpc"
)

// 'make build' will overwrite this string with the output of git-describe (tag)
Expand All @@ -32,7 +32,7 @@ type Options struct {
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"`
VerusConfPath string `json:"zcash_conf,omitempty"`
RPCUser string `json:"rpcuser"`
RPCPassword string `json:"rpcpassword"`
RPCHost string `json:"rpchost"`
Expand Down
2 changes: 1 addition & 1 deletion common/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"testing"
"time"

"github.com/asherda/lightwalletd/walletrpc"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/zcash/lightwalletd/walletrpc"
)

// ------------------------------------------ Setup
Expand Down
2 changes: 1 addition & 1 deletion common/darkside.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"sync"
"time"

"github.com/zcash/lightwalletd/parser"
"github.com/asherda/lightwalletd/parser"
)

type darksideState struct {
Expand Down
2 changes: 1 addition & 1 deletion common/logging/logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"testing"

"errors"
"github.com/asherda/lightwalletd/common"
"github.com/sirupsen/logrus"
"github.com/zcash/lightwalletd/common"
"google.golang.org/grpc"
"google.golang.org/grpc/peer"
)
Expand Down
4 changes: 2 additions & 2 deletions frontend/frontend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (
"strings"
"testing"

"github.com/asherda/lightwalletd/common"
"github.com/asherda/lightwalletd/walletrpc"
"github.com/sirupsen/logrus"
"github.com/zcash/lightwalletd/common"
"github.com/zcash/lightwalletd/walletrpc"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion frontend/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ package frontend
import (
"net"

"github.com/asherda/lightwalletd/common"
"github.com/btcsuite/btcd/rpcclient"
"github.com/pkg/errors"
"github.com/zcash/lightwalletd/common"
ini "gopkg.in/ini.v1"
)

Expand Down
6 changes: 3 additions & 3 deletions frontend/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"sync/atomic"
"time"

"github.com/zcash/lightwalletd/common"
"github.com/zcash/lightwalletd/parser"
"github.com/zcash/lightwalletd/walletrpc"
"github.com/asherda/lightwalletd/common"
"github.com/asherda/lightwalletd/parser"
"github.com/asherda/lightwalletd/walletrpc"
)

type lwdStreamer struct {
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/zcash/lightwalletd
module github.com/asherda/lightwalletd

go 1.12

Expand All @@ -9,8 +9,6 @@ require (
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/pkg/errors v0.8.1
github.com/prometheus/client_golang v1.5.1
github.com/sirupsen/logrus v1.4.2
Expand Down
Loading

0 comments on commit 8abe75a

Please sign in to comment.