From 02db54651644f5531cee8c600d384fa90c15069a Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Thu, 22 Apr 2021 09:25:53 -0700 Subject: [PATCH] Update README --- README.md | 83 +------------------ docker/Dockerfile | 5 -- docker/cert.key | 28 ------- docker/cert.pem | 21 ----- docker/gen_cert.sh | 6 -- .../provisioning/datasources/loki.yaml | 11 --- .../provisioning/datasources/prometheus.yaml | 9 -- docker/prometheus/config.yml | 27 ------ docker/zcash.conf | 4 - 9 files changed, 3 insertions(+), 191 deletions(-) delete mode 100644 docker/Dockerfile delete mode 100644 docker/cert.key delete mode 100644 docker/cert.pem delete mode 100644 docker/gen_cert.sh delete mode 100644 docker/grafana/provisioning/datasources/loki.yaml delete mode 100644 docker/grafana/provisioning/datasources/prometheus.yaml delete mode 100644 docker/prometheus/config.yml delete mode 100644 docker/zcash.conf diff --git a/README.md b/README.md index 0baa694..0c523e2 100644 --- a/README.md +++ b/README.md @@ -1,87 +1,10 @@ # Overview -Zecwallet lightwalletd is a fork of [lightwalletd](https://github.com/adityapk00/lightwalletd) from the ECC. +Zecwallet lightwalletd is an API-compatible fork of [lightwalletd](https://github.com/zcash/lightwalletd) from the ECC. Since the API is compatible Zecwallet Lite will work with any LightwalletD. This fork is maintained by Zecwallet to ease integrations and experiments with the Lightwallet protocol. -It is a backend service that provides a bandwidth-efficient interface to the Zcash blockchain for the [Zecwallet light wallet](https://github.com/adityapk00/zecwallet-lite-lib). - -## Changes from upstream lightwalletd -This version of Zecwallet lightwalletd extends lightwalletd and: -* Adds support for transparent addresses -* Adds several new RPC calls for lightclients -* Lots of perf improvements - * Replaces SQLite with in-memory cache for Compact Blocks - * Replace local Txstore, delegating Tx lookups to Zcashd - * Remove the need for a separate ingestor +LightwalletD is a backend service that provides a bandwidth-efficient interface to the Zcash blockchain for the [Zecwallet light wallet](https://github.com/adityapk00/zecwallet-lite-lib). ## Running your own zeclite lightwalletd +Please see instructions at the [LightwalletD Readme](https://github.com/zcash/lightwalletd/blob/master/README.md) -#### 0. First, install [Go >= 1.11](https://golang.org/dl/#stable). -#### 1. Run a zcash node. -Start a `zcashd` with the following options: -``` -server=1 -rpcuser=user -rpcpassword=password -rpcbind=127.0.0.1 -rpcport=8232 -experimentalfeatures=1 -txindex=1 -insightexplorer=1 -``` - -You might need to run with `-reindex` the first time if you are enabling the `txindex` or `insightexplorer` options for the first time. The reindex might take a while. If you are using it on testnet, please also include `testnet=1` - -#### 2. Get a TLS certificate - -##### a. "Let's Encrypt" certificate using NGINX as a reverse proxy -If you running a public-facing server, the easiest way to obtain a certificate is to use a NGINX reverse proxy and get a Let's Encrypt certificate. [Instructions are here](https://www.nginx.com/blog/using-free-ssltls-certificates-from-lets-encrypt-with-nginx/) - -Create a new section for the NGINX reverse proxy: -``` -server { - listen 443 ssl http2; - - - ssl_certificate ssl/cert.pem; # From certbot - ssl_certificate_key ssl/key.pem; # From certbot - - location / { - # Replace localhost:9067 with the address and port of your gRPC server if using a custom port - grpc_pass grpc://localhost:9067; - } -} -``` - -##### b. Use without TLS certificate -You can run lightwalletd without TLS and server traffic over `http`. This is recommended only for local testing - -#### 3. Run the frontend: -You can run the gRPC server with or without TLS, depending on how you configured step 2. If you are using NGINX as a reverse proxy and are letting NGINX handle the TLS authentication, then run the frontend with `-no-tls` - -``` -go run cmd/server/main.go -bind-addr 127.0.0.1:9067 -conf-file ~/.zcash/zcash.conf -no-tls -``` -Type `./lightwalletd help` to see the full list of options and arguments. - -# Production Usage - -If you have a certificate that you want to use (either self signed, or from a certificate authority), pass the certificate to the frontend: - -``` -go run cmd/server/main.go -bind-addr 127.0.0.1:443 -conf-file ~/.zcash/zcash.conf -tls-cert cert.pem -tls-key key.pem -``` - -You should start seeing the frontend ingest and cache the zcash blocks after ~15 seconds. - -#### 4. Point the `zecwallet-cli` to this server -Connect to your server! -``` -./zecwallet-cli -server https://mylightwalletd.server.com:443 -``` - -If you are using your own server running without TLS, you can also connect over `http` - -``` -./zecwallet-cli --server http://127.0.0.1:9067 -``` diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 765269a..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM scratch - -COPY main / - -ENTRYPOINT ["/main"] \ No newline at end of file diff --git a/docker/cert.key b/docker/cert.key deleted file mode 100644 index 3c42aaa..0000000 --- a/docker/cert.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCertVgQ0jHcqW9 -NvPszU9Mwi5jsin6edmCIBFLEDdOBBCWd9fkDkVHcaLNgq2uf1DYnhaWcSHiUiP2 -D7sUrtFdR9JZc9REwOwaOInk+ughiGPQ06nnOlhxbHH4TF3hwXLBe1LvEVL7SP3s -liBi88oITC1YrTQ2BXi3vKwL7FsTuCLn8+hlw/l5WNt+JZyA9GvXjwLLr8yf3Xi+ -8HRn3vRyIwy6rxFf2xYmTK0+5pBGBGhkuKuz/V3mJO9hyw8702ccdc7Vi+yETvIr -I6BjmQgH8AzM3J2JjZ/4Jbc78WjTqC8/P7ve4YW19rKmJKvqeY73x2CXC80PQZ8J -2nVMtlu7AgMBAAECggEAXBGi2jSP4LEjevKMeuPw09+C3PN9qcfTLM4AWqYxAIIZ -QcSNLdQd3EMRq93befiC5vxqrKU9fLweA2HDMU/xSAcpBB/RlIa/NsOBNqthzjr9 -dyeoV/IhaMX8Jo3gluEP/TTZvL43gHcsZX4BkohSu5e/Y8kzFvj7vteol05u1bRB -607DW6ONNKCK+upbTIvY3FvaeQ+Y8sZLT1ceQGzmwkNFb0l5qnwmKm3w2jy8y7Ls -lGkVTOXuDpUm1rFYomh1vUetTB1E/B8FokbLlz8shRq3nmWKx/tycW305fqA8j0h -5XWxApARF8LptEXCGTyaqWdZDTMwRrUP4ORqklyf2QKBgQDSU1y4AvRbzDL+dfb7 -3WgNQjkQEmWDDb50hKxK9hat1aOhPa/gFwNKLWPyJpAFNBOczyCHVux6eOYPCH+t -cxf81FfbNHbfTlnfM1yXg1/5r2Mp3selUjun2aSIHQmmI0r+MjpLmFCV/TFDRDRx -IeZlea7adU62XmhIZbD9hw44jwKBgQDBJH9/+U7W4WZc0RocxZDzlW6R2E5R7hBo -F4mfeTUHrPVR5r5Tdxv94eyGqW5ZTRfty9U4btg/t8rOhb2YW9P0LT7BPQ/K/PXu -RjNR12sgZn3XY89/IwitY+SV/8kPq0fQtnjc1YdHGJ7cqW76b2SAGuFSY7bzw4W8 -9fV08+TIFQKBgAxI+j11Trid8MyUL1z+zbkYiSS7Llq9TsaXiUjHnwOAWxJr+/3m -2jZW+GOIhRkItayPHKNLHHz62tU99dc3xcrqzEbthZP9i5pR8bKX5d87s1savCaX -6wwe1lFtAMdHgHXgkS8hMnPQWjRHo5iIFmEO/nucJoDYetbfubrVTKtZAoGAPsmX -rUmlyJMjzL6pR3sugREuDbmM1HOY383vDmm/xIwEgCiL7ORGtEUSuEAyQFOgmMxv -t1XJdQVRp8uwc+w+Ph3LTdSE4s9TP6+QlWV7TOAkvrWSydjgxEU6FU0+1pou0XnQ -VrIPtRwa4M8v5bf6qu6SG0+RNTN1sZUfw3JaCHUCgYBb9wCYDktOzcUTo0xK2j8q -gZotpmKT+1wbZmL+vTRmq9juo3qGjlcRSNJMvFCe1zwC24E3bei+Chld626Do3mN -f2hkrrLIVqsXP2CSOOTZtONsO3VRPaNjdLzreR5V6Oc9StOD/2CPcvaHcaRMaoDl -ylpUUJpnIUaIIRZQvN9GlA== ------END PRIVATE KEY----- diff --git a/docker/cert.pem b/docker/cert.pem deleted file mode 100644 index 27bdab3..0000000 --- a/docker/cert.pem +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDizCCAnOgAwIBAgIUevPATPP74qY3JPE6s3axxnC8rxwwDQYJKoZIhvcNAQEL -BQAwVTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMRQwEgYDVQQKDAtNeU9yZywg -SW5jLjEjMCEGA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v2Lg9NCubF0p4l19KF9yANdXc+bs= ------END CERTIFICATE----- diff --git a/docker/gen_cert.sh b/docker/gen_cert.sh deleted file mode 100644 index 3079f9d..0000000 --- a/docker/gen_cert.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -## In debian -# apt-get update && apt-get install -y openssl - -openssl req -x509 -nodes -newkey rsa:2048 -keyout ./cert.key -out ./cert.pem -days 3650 -subj "/C=US/ST=CA/O=MyOrg, Inc./CN=lightwalletd.testnet.local" -reqexts SAN -config <(cat /etc/ssl/openssl.cnf <(printf "\n[SAN]\nsubjectAltName=DNS:lightwalletd.testnet.local,DNS:127.0.0.1,DNS:localhost")) diff --git a/docker/grafana/provisioning/datasources/loki.yaml b/docker/grafana/provisioning/datasources/loki.yaml deleted file mode 100644 index 4842596..0000000 --- a/docker/grafana/provisioning/datasources/loki.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: 1 -datasources: -- name: Loki - type: loki - access: proxy - orgId: 1 - url: http://loki:3100 - version: 1 - editable: false - jsonData: - maxLines: 1000 diff --git a/docker/grafana/provisioning/datasources/prometheus.yaml b/docker/grafana/provisioning/datasources/prometheus.yaml deleted file mode 100644 index 2234053..0000000 --- a/docker/grafana/provisioning/datasources/prometheus.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: 1 -datasources: -- name: Prometheus - type: prometheus - access: proxy - orgId: 1 - url: http://prometheus:9090 - version: 1 - editable: false diff --git a/docker/prometheus/config.yml b/docker/prometheus/config.yml deleted file mode 100644 index 057df7e..0000000 --- a/docker/prometheus/config.yml +++ /dev/null @@ -1,27 +0,0 @@ -# my global config -global: - scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. - evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. - # scrape_timeout is set to the global default (10s). - -# Alertmanager configuration -alerting: - alertmanagers: - - static_configs: - - targets: - # - alertmanager:9093 - -# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. -rule_files: - # - "first_rules.yml" - # - "second_rules.yml" - -# A scrape configuration containing exactly one endpoint to scrape: -# Here it's Prometheus itself. -scrape_configs: - - job_name: 'zcashd_exporter' - static_configs: - - targets: ['zcashd_exporter:9100'] - - job_name: 'lightwalletd' - static_configs: - - targets: ['lightwalletd:9068'] diff --git a/docker/zcash.conf b/docker/zcash.conf deleted file mode 100644 index bed2d2f..0000000 --- a/docker/zcash.conf +++ /dev/null @@ -1,4 +0,0 @@ -rpcuser=zcashrpc -rpcpassword=notsecure -rpcbind=zcashd -rpcport=3434