From ca4520c8bf6eb0d29d8d43fd7de654401a028a1d Mon Sep 17 00:00:00 2001 From: jahway603 Date: Mon, 5 Dec 2022 02:50:51 -0500 Subject: [PATCH 1/4] updated manpage & added required directory info --- README.md | 2 ++ doc/man/lightwalletd.1 | 32 ++++++++++++++++++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index b799a2e..a7cd39f 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ Then run the lightwalletd frontend with the following: Note: we use the "--no-tls" option as we are using NGINX as a reverse proxy and letting it handle the TLS authentication for us instead. If you want to do TLS directly with lightwalletd with no reverse proxy, see the next section. +If you encounter an error about the lightwalletd "data directory", then set one on the command line with `--data-dir` (OR) create the `/var/lib/lightwalletd` and `/var/lib/lightwalletd/db` directories & chown that new db directory as the user account running lightwalletd and hushd. ##### Option B: "Let's Encrypt" certificate just using lightwalletd without NGINX The other option is to configure lightwalletd to handle its own TLS authentication. Once you have a certificate that you want to use (from a certificate authority), pass the certificate to the frontend as follows: @@ -127,6 +128,7 @@ These are some of the most used command line options for lightwalletd: | --tls-cert | blank | the path to a TLS certificate | | --tls-key | blank | the path to a TLS key file | | --no-tls | false | Disable TLS, serve un-encrypted traffic | +| --data-dir | /var/lib/lightwalletd | Sets the lightwalletd data directory | | --log-file | blank | log file to write to | | --log-level | logrus.InfoLevel | log level 1 thru 7 (something from logrus)| | --hush-conf-path | blank | conf file to pull RPC creds from | diff --git a/doc/man/lightwalletd.1 b/doc/man/lightwalletd.1 index a54a3c9..bf2f066 100644 --- a/doc/man/lightwalletd.1 +++ b/doc/man/lightwalletd.1 @@ -1,6 +1,6 @@ -.TH LIGHTWALLET "1" "October 2021" "lightwalletd v0.1.1" "User Commands" +.TH LIGHTWALLET "1" "December 2022" "lightwalletd v0.1.2" "User Commands" .SH NAME -lightwalletd \- manual page for hush lightwalletd v0.1.1 +lightwalletd \- manual page for hush lightwalletd v0.1.2 .SH DESCRIPTION .B lightwalletd runs a lightwallet daemon for a Hush Silent Dragon Lite node. @@ -23,35 +23,39 @@ Display version information .IP Display command line options .HP -\fB\-conf-file\fR [conf_file location] +\fB\--hush-conf-path\fR [conf_file location] .IP -Configures your HUSH3.conf file location [Required to run]. Typically ~/.hush/HUSH3/HUSH3.conf +Configures your HUSH3.conf file location to pull RPC creds from (default "./HUSH3.conf") .HP -\fB\-bind-addr \fRhost.net:chosen_port +\fB\--data-dir\fR [location] .IP -Set host.net to either a FQDN or 127.0.0.1 depending on your configuration [Required to run]. Most common port is 9067 unless changed. +Configures your lightwalletd data directory (such as db) (default "/var/lib/lightwalletd") .HP -\fB\-no-tls +\fB\--grpc-bind-addr \fRlocalhost:chosen_port .IP -Disable TLS, serve un-encrypted traffic. Toggle depending on your configuration. +The address to listen for grpc on (default "localhost:9067") .HP -\fB\-cache-size \fRint +\fB\--no-tls +.IP +Run without TLS, only safe if a reverse proxy like nginx does TLS on localhost. +.HP +\fB\--cache-size \fRint .IP Set number of blocks to hold in the cache (default 40000) .HP -\fB\-log-file \fRstring +\fB\--log-file \fRstring .IP Set log file to write to .HP -\fB\-log-level \fRuint +\fB\--log-level \fRuint .IP log level (logrus 1-7) (default 4) .HP -\fB\-tls-cert \fRstring +\fB\--tls-cert \fRstring .IP the path to a TLS certificate (optional) .HP -\fB\-tls-key \fRstring +\fB\--tls-key \fRstring .IP the path to a TLS key file (optional) @@ -59,7 +63,7 @@ the path to a TLS key file (optional) In order to ensure you are adequately protecting your privacy when using Hush, please see . -Copyright (C) 2021 Jahway603 and The Hush Developers +Copyright (C) 2021-2022 Jahway603 and The Hush Developers This is experimental Free Software! Fuck Yeah!!!!! From a5adf5ea495ddfddca3c7fc21dbce887c49816f7 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 2 Apr 2023 16:49:58 -0700 Subject: [PATCH 2/4] Add --rpcport to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a7cd39f..0f33372 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,7 @@ These are some of the most used command line options for lightwalletd: | --log-level | logrus.InfoLevel | log level 1 thru 7 (something from logrus)| | --hush-conf-path | blank | conf file to pull RPC creds from | | --cache-size| 40000 | number of blocks to hold in the cache | +| --rpcport | 18031 | RPC port | Run `./lightwalletd --help` to see all options. From f076ea8e52e90f1536581433a808e18b70bcb145 Mon Sep 17 00:00:00 2001 From: Duke Date: Mon, 3 Apr 2023 12:19:16 -0700 Subject: [PATCH 3/4] Add docs for lightwalletd with HSCs and for --http-bind-addr --- README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0f33372..b387f8d 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,29 @@ cargo build --release * If you have trouble compiling silentdragonlite-cli, then [please refer to it's separate documentation here](https://git.hush.is/hush/silentdragonlite-cli) on how to build it and what pre-requisites need to be installed. +## Running a server for Hush Smart Chains + +This lightwalletd code can be used with any Hush Smart Chain. For example, here is how you would +run the lightwalletd for DragonX : + +``` +./lightwalletd --grpc-bind-addr localhost:9069 --http-bind-addr localhost:9070 --hush-conf-path ~/.hush/DRAGONX/DRAGONX.conf --no-tls --rpcport=21769 +``` + +For this code, your Nginx config will need to use the same GRPC port, so something like `grpc_pass grpc://localhost:9069;` + +The above code should be compatible with running a lightwalletd on the same server that runs one for Hush, which by default uses ports 9067 for grpc +and 9068 for http. If you are only running a single lightwalletd on a server, the following should work for DragonX : + +``` +./lightwalletd --grpc-bind-addr localhost:9069 --http-bind-addr localhost:9070 --hush-conf-path ~/.hush/DRAGONX/DRAGONX.conf --no-tls --rpcport=21769 +``` + +To run lightwalletd for other HSC's, you must specific the correct RPC port via `--rpcport` , point to it's config file via `--hush-conf-path` and +use use unique ports that nothing else is using for `--grpc-bind-addr` and `--http-bind-addr` . Make sure your nginx config `grpc_pass` port matches +what you give to `--grpc-bin-addr` . + + ## Lightwalletd Command-line Options These are some of the most used command line options for lightwalletd: @@ -124,7 +147,8 @@ These are some of the most used command line options for lightwalletd: | CLI option | Default | What it does | |------------|:--------------:|------------------------------:| -| --grpc-bind-addr | 127.0.0.1:9067 | address and port to listen on | +| --grpc-bind-addr | 127.0.0.1:9067 | address and port to listen on via GRPC | +| --http-bind-addr | 127.0.0.1:9068 | address and port to listen on vi HTTP | | --tls-cert | blank | the path to a TLS certificate | | --tls-key | blank | the path to a TLS key file | | --no-tls | false | Disable TLS, serve un-encrypted traffic | From 78bcb21d8c4c2a5ee4c47a4b0f7f92d206c8740b Mon Sep 17 00:00:00 2001 From: Duke Date: Mon, 3 Apr 2023 15:21:15 -0700 Subject: [PATCH 4/4] Add a link to grpcurl for testing --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b387f8d..5ee0d09 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,8 @@ cargo build --release * If you have trouble compiling silentdragonlite-cli, then [please refer to it's separate documentation here](https://git.hush.is/hush/silentdragonlite-cli) on how to build it and what pre-requisites need to be installed. +You can also do testing with https://github.com/fullstorydev/grpcurl + ## Running a server for Hush Smart Chains This lightwalletd code can be used with any Hush Smart Chain. For example, here is how you would