Go to file
Larry Ruane f58a5f9376 add GetLightdInfo RPC
Co-authored-by: Aditya Kulkarni <adityapk@gmail.com>

also to pick up changes to walletrpc/service.proto
(regenerate compact_formats.pb.go service.pb.go)

cd walletrpc
protoc compact_formats.proto --go_out=plugins=grpc:.
protoc service.proto --go_out=plugins=grpc:.

ran go mod tidy && go mod vendor
2019-12-17 12:57:41 -07:00
cmd add GetLightdInfo RPC 2019-12-17 12:57:41 -07:00
common add GetLightdInfo RPC 2019-12-17 12:57:41 -07:00
docs Reorg documents for updates and upcoming new details 2019-10-13 18:28:57 -07:00
frontend add GetLightdInfo RPC 2019-12-17 12:57:41 -07:00
parser improve test coverage 2019-11-06 10:50:24 -07:00
storage add tests for GetTx* methods 2019-10-16 16:11:36 -06:00
testdata improve test coverage 2019-11-06 10:50:24 -07:00
vendor add GetLightdInfo RPC 2019-12-17 12:57:41 -07:00
walletrpc add GetLightdInfo RPC 2019-12-17 12:57:41 -07:00
.codecov.yml Update .codecov.yml 2019-10-29 16:21:39 -07:00
.gitignore add coverage.* (output of make test) to .gitignore 2019-10-10 13:36:49 -06:00
.gitlab-ci.yml update typo 2019-12-16 19:08:25 -08:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2019-09-19 19:26:16 -07:00
CONTRIBUTING.md Fix typos 2019-09-25 15:01:46 +03:00
Dockerfile Add user to Dockerfile 2019-10-11 18:39:23 -07:00
LICENSE Create LICENSE 2019-09-19 19:21:48 -07:00
Makefile Adding release targets to Makefile 2019-10-13 14:43:18 -07:00
README.md Update README.md 2019-10-31 15:05:37 -07:00
go.mod add GetLightdInfo RPC 2019-12-17 12:57:41 -07:00
go.sum add GetLightdInfo RPC 2019-12-17 12:57:41 -07:00

README.md

pipeline status coverage report

Overview

lightwalletd is a backend service that provides a bandwidth-efficient interface to the Zcash blockchain. Currently, lightwalletd supports the Sapling protocol version as its primary concern. The intended purpose of lightwalletd is to support the development of mobile-friendly shielded light wallets.

lightwalletd consists of three loosely coupled components: an "ingester", a "frontend", and an arbitrary storage layer (such as a SQL database) that connects the two. The ingester receives raw block data, parses out the transactions and block metadata, then stores them in a format convenient for the frontend to serve to clients. Thus, these components can operate and scale independently of each other and are connected only by a shared storage convention.

Lightwalletd has not yet undergone audits or been subject to rigorous testing. It lacks some affordances necessary for production-level reliability. We do not recommend using it to handle customer funds at this time (October 2019).

To view status of CI pipeline

To view detailed Codecov report

Local/Developer Usage

First, ensure Go >= 1.11 is installed. Once your go environment is setup correctly, you can build/run the below components.

To build ingest and server, run make.

This will build the ingest and server binaries, where you can use the below commands to configure how they run.

To run INGESTER

Assuming you used make to build INGESTER

./ingest --conf-file /home/zcash/.zcash/zcash.conf --db-path /db/sql.db --log-file /logs/ingest.log

To run SERVER

Assuming you used make to build SERVER:

./server --very-insecure=true --conf-file /home/zcash/.zcash/zcash.conf --db-path /db/sql.db --log-file /logs/server.log --bind-addr 127.0.0.1:18232

Production Usage

Ensure Go >= 1.11 is installed.

x509 Certificates You will need to supply an x509 certificate that connecting clients will have good reason to trust (hint: do not use a self-signed one, our SDK will reject those unless you distribute them to the client out-of-band). We suggest that you be sure to buy a reputable one from a supplier that uses a modern hashing algorithm (NOT md5 or sha1) and that uses Certificate Transparency (OID 1.3.6.1.4.1.11129.2.4.2 will be present in the certificate).

To check a given certificate's (cert.pem) hashing algorithm:

openssl x509 -text -in certificate.crt | grep "Signature Algorithm"

To check if a given certificate (cert.pem) contains a Certificate Transparency OID:

echo "1.3.6.1.4.1.11129.2.4.2 certTransparency Certificate Transparency" > oid.txt
openssl asn1parse -in cert.pem -oid ./oid.txt | grep 'Certificate Transparency'

To use Let's Encrypt to generate a free certificate for your frontend, one method is to:

  1. Install certbot
  2. Open port 80 to your host
  3. Point some forward dns to that host (some.forward.dns.com)
  4. Run
certbot certonly --standalone --preferred-challenges http -d some.forward.dns.com
  1. Pass the resulting certificate and key to frontend using the -tls-cert and -tls-key options.

To run production INGESTER

Example using ingest binary built from Makefile:

./ingest --conf-file /home/zcash/.zcash/zcash.conf --db-path /db/sql.db --log-file /logs/ingest.log

To run production SERVER

Example using server binary built from Makefile:

./server --tls-cert cert.pem --tls-key key.pem --conf-file /home/zcash/.zcash/zcash.conf --db-path /db/sql.db --log-file /logs/server.log --bind-addr 127.0.0.1:18232

Pull Requests

We welcome pull requests! We like to keep our Go code neatly formatted in a standard way, which the standard tool gofmt can do. Please consider adding the following to the file .git/hooks/pre-commit in your clone:

#!/bin/sh

modified_go_files=$(git diff --cached --name-only -- '*.go')
if test "$modified_go_files"
then
    need_formatting=$(gofmt -l $modified_go_files)
    if test "$need_formatting"
    then
        echo files need formatting:
        echo gofmt -w $need_formatting
        exit 1
    fi
fi

You'll also need to make this file executable:

$ chmod +x .git/hooks/pre-commit

Doing this will prevent commits that break the standard formatting. Simply run the gofmt command as indicated and rerun the git commit command.