Compare commits

...

7 Commits
master ... dev

  1. 2
      Makefile
  2. 2
      README.md
  3. 2
      cmd/server/main_test.go
  4. 21
      doc/examples/README.md
  5. 19
      doc/examples/run_lightwalletd_nginx.sh
  6. 26
      doc/examples/run_lightwalletd_no-web.sh
  7. 7
      start.sh
  8. 2
      util/build-debian-package-SBC.sh
  9. 17
      util/build-debian-package.sh
  10. 29
      util/build.sh
  11. 31
      util/build_arm.sh

2
Makefile

@ -1,4 +1,4 @@
# Copyright (c) 2021 Jahway603 & The Hush Developers
# Copyright (c) 2021-2022 Jahway603 & The Hush Developers
# Released under the GPLv3
#
# Hush Lightwalletd Makefile

2
README.md

@ -125,7 +125,7 @@ These are the current different command line options for lightwalletd:
| -cache-size| 40000 | number of blocks to hold in the cache |
## Support
For support or other questions, join us on [Telegram](https://hush.is/telegram), or tweet at [@MyHushTeam](https://twitter.com/MyHushTeam), or toot at our [Mastodon](https://fosstodon.org/@myhushteam) or join [Telegram Support](https://hush.is/telegram_support).
For support or other questions, join us on [Telegram](https://hush.is/telegram), or toot at our [Mastodon](https://fosstodon.org/@myhushteam) or join [Telegram Support](https://hush.is/telegram_support).
## License
GPLv3 or later

2
cmd/server/main_test.go

@ -1,4 +1,4 @@
// Copyright 2021 The Hush developers
// Copyright 2021-2022 The Hush developers
// Released under the GPLv3
package main

21
doc/examples/README.md

@ -0,0 +1,21 @@
# Example lightwalletd configurations
# Table of contents
1. [Why](#why)
2. [With Nginx](#with-nginx)
3. [No Web](#no-web)
4. [Apache](#apache)
## Why
The [Hush Lightwalletd](https://git.hush.is/hush/lightwalletd/) can be configured in numerous different ways depending upon your specific setup. Here I will cover some example configurations and include shell scripts you can modify for your needs once you decide how you want to configure it.
## With Nginx
For Nginx specifics, refer to the [lightwalletd README](https://git.hush.is/hush/lightwalletd/src/branch/master/README.md) to setup your SSL cert config.
Then you can use this [example shell script](run_lightwalletd_nginx.sh) to run lightwalletd with an nginx reverse proxy frontend. In the script you have to change the hostname and username before running it.
## No Web
Here we run lightwalletd without any web servers (no nginx) and as a stand-alone service managing the SSL cert config internally. Use this [example shell script](run_lightwalletd_no-web.sh) to run lightwalletd stand-alone.
## Apache
I do not know Apache, but you are welcome to contribute your example configuration if you are using it as a reverse proxy.

19
doc/examples/run_lightwalletd_nginx.sh

@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Purpose: simple run script for Hush lightwalletd with an nginx reverse proxy frontend
# Setup: Change host, change username, and then run this to start lightwalletd
### Change below to your lightwalletd public server name ###
host=your.server.name.com
# port 9067 is the default lightwalletd port
port=9067
host_and_port="${host}:${port}"
### Change below to the username running lightwalletd ###
# this user account must have access to the HUSH3.conf
username=jahway603
hush_conf="/home/${username}/.hush/HUSH3/HUSH3.conf"
echo "starting lightwalletd on port $port..."
lightwalletd -bind-addr "$host_and_port" -conf-file "$hush_conf" -no-tls
# let's go brandon

26
doc/examples/run_lightwalletd_no-web.sh

@ -0,0 +1,26 @@
#!/usr/bin/env bash
# Purpose: simple run script for Hush lightwalletd with NO web frontend
# Setup: Change username, setup your SSL cert config, and then run this to start lightwalletd
# had to use this IP when using acme.sh instead of certbot
ip=0.0.0.0
# port 9067 is the default lightwalletd port
port=9067
ip_and_port="${ip}:${port}"
### Change below to the username running lightwalletd ###
# this user account must have access to the HUSH3.conf
username=jahway603
hush_conf="/home/${username}/.hush/HUSH3/HUSH3.conf"
### Setup SSL cert config below ###
# Change below to your lightwalletd public server name
host=your.server.name.com
# Change to your SSL cert, certbot does one thing, acme.sh does another, YMMV
ssl_cert="/etc/nginx/ssl/${host}/fullchain/${host}.pem"
ssl_key="/etc/nginx/ssl/${host}/key/${host}.key.pem"
echo "starting lightwalletd on port $port..."
lightwalletd -bind-addr "$ip_and_port" -conf-file "$hush_conf" -tls-cert "$ssl_cert" --tls-key "$ssl_key"
# let's go brandon

7
start.sh

@ -1,12 +1,15 @@
#!/bin/bash
# Copyright 2020-2021 The Hush Developers
# Copyright 2020-2022 The Hush Developers
# Released under GPLv3
# Description: This script would be used with a NGINX reverse proxy
# you can choose either IPv4 or IPv6
# using ipv4 localhost
#./lightwalletd -bind-addr localhost:9067 -conf-file ~/.hush/HUSH3/HUSH3.conf -no-tls
# using legacy directory
#./lightwalletd -bind-addr localhost:9067 -conf-file ~/.komodo/HUSH3/HUSH3.conf -no-tls
# using ipv6 localhost
./lightwalletd -bind-addr ip6-localhost:9067 -conf-file ~/.komodo/HUSH3/HUSH3.conf -no-tls
./lightwalletd -bind-addr ip6-localhost:9067 -conf-file ~/.hush/HUSH3/HUSH3.conf -no-tls

2
util/build-debian-package-SBC.sh

@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2021 The Hush developers
# Copyright (c) 2021-2022 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html
#

17
util/build-debian-package.sh

@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2021 The Hush developers
# Copyright (c) 2021-2022 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html
#
@ -16,11 +16,11 @@ if ! [ -x "$(command -v ./lightwalletd)" ]; then
fi
# Check if lintian is installed and exit if it is not
#if ! [ -x "$(command -v lintian)" ]; then
# echo 'Error: lintian is not installed yet. Consult your Linux version package manager...' >&2
# echo ""
# exit 1
#fi
if ! [ -x "$(command -v lintian)" ]; then
echo 'Error: lintian is not installed yet. Consult your Linux version package manager...' >&2
echo ""
exit 1
fi
echo "Let There Be Hush Lightwalletd Debian Packages!"
echo ""
@ -92,7 +92,6 @@ fakeroot dpkg-deb --build $BUILD_DIR
cp $BUILD_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb $SRC_PATH
shasum -a 256 $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb
# Analyze with Lintian, reporting bugs and policy violations
# Arch does not have lintian, as it's a Debian package, so commenting this out
# To-DO - test on Debian/Ubuntu, create AUR lintian package
#lintian -i $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb
# Arch does not have lintian, as it's a Debian package, so run this on Debian stuff
lintian -i $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-$ARCH.deb
exit 0

29
util/build.sh

@ -1,14 +1,24 @@
#!/usr/bin/env bash
# Copyright 2021 The Hush Developers
# Copyright 2021-2022 The Hush Developers
# Distributed under the GPLv3 software license, see the accompanying
# file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html
# Purpose: Script to build Hush lightwalletd on x86 64-bit arch
## Usage: ./util/build.sh
# Check if go is installed on system...
v=`go version | { read _ _ v _; echo ${v#go}; }`
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
# Check if go is installed on system and exits if it is not
if ! [ -x "$(command -v go)" ]; then
echo 'Error: go is not installed. Install go and try again.' >&2
exit 1
# If go is installed, then check system for at least version 1.13.0
elif [ $(version $v) -lt $(version "1.13.0") ]; then
echo 'Error: the go version you have installed requires at least version 1.13, which your system does not have installed. Install a newer version of go and try again.' >&2
echo ''
echo "Try out gobrew to install a newer version than what your OS package manager supplies."
exit 1
fi
echo ""
@ -23,10 +33,17 @@ echo "+------'+------'+------'+------'+------'+------'+------'+------'+------'+-
# now to compiling...
echo ""
echo "You have go installed, so starting to compile Hush lightwalletd for you..."
echo "You have at least go 1.13.0 installed, so starting to compile Hush lightwalletd for you..."
cd `pwd`/cmd/server
go build -o lightwalletd main.go
mv lightwalletd `pwd`/../../lightwalletd
echo ""
echo "Hush lightwalletd is now compiled for you. Enjoy and reach out if you need support."
echo "For options, run ./lightwalletd --help"
# check if compile was success
if [ $? -ne 0 ]; then
echo ""
echo 'Error: Something went wrong and lightwalletd did not build successfully... Please reach out if you need support.' >&2
exit 1
else
mv lightwalletd `pwd`/../../lightwalletd
echo ""
echo "Hush lightwalletd is now compiled for you. Enjoy and reach out if you need support."
echo "For options, run ./lightwalletd --help"
fi

31
util/build_arm.sh

@ -1,15 +1,24 @@
#!/usr/bin/env bash
# Copyright 2021 The Hush Developers
# Copyright 2021-2022 The Hush Developers
# Distributed under the GPLv3 software license, see the accompanying
# file LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html
#
# Purpose: Script to build the ARM or aarch64 architecture,
# which is what the PinePhone boards are running
# Check if go is installed on system...
v=`go version | { read _ _ v _; echo ${v#go}; }`
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
# Check if go is installed on system and exits if it is not
if ! [ -x "$(command -v go)" ]; then
echo 'Error: go is not installed. Install go and try again.' >&2
exit 1
# If go is installed, then check system for at least version 1.13.0
elif [ $(version $v) -lt $(version "1.13.0") ]; then
echo 'Error: the go version you have installed requires at least version 1.13, which your system does not have installed. Install a newer version of go and try again.' >&2
echo ''
echo "Try out gobrew to install a newer version than what your OS package manager supplies."
exit 1
fi
echo ""
@ -24,11 +33,19 @@ echo "+------'+------'+------'+------'+------'+------'+------'+------'+------'+-
# now to compiling...
echo ""
echo "You have go installed, so starting to compile Hush lightwalletd for you..."
echo "You have at least go 1.13.0 installed, so starting to compile Hush lightwalletd for you..."
cd `pwd`/cmd/server
env GOOS=linux GOARCH=arm64 go build -o lightwalletd_aarch64 main.go
mv lightwalletd_aarch64 lightwalletd
mv lightwalletd `pwd`/../../lightwalletd
echo ""
echo "Hush lightwalletd is now compiled for your ARM farm or Pine Rock64. Enjoy and reach out if you need support."
echo "For options, run ./lightwalletd --help"
# check if compile was success
if [ $? -ne 0 ]; then
echo ""
echo 'Error: Something went wrong and lightwalletd did not build successfully... Please reach out if you need support.' >&2
exit 1
else
mv lightwalletd_aarch64 lightwalletd
mv lightwalletd `pwd`/../../lightwalletd
echo ""
echo "Hush lightwalletd is now compiled for your ARM farm or Pine Rock64. Enjoy and reach out if you need support."
echo "For options, run ./lightwalletd --help"
fi

Loading…
Cancel
Save