Browse Source

Merge pull request #4 from MyHush/master

merge upstream
pull/41/head
Larry Ludlow 7 years ago
committed by GitHub
parent
commit
1c23b812d4
  1. 72
      INSTALL.md
  2. 43
      README.md
  3. 193
      Testnet.md
  4. 32
      contrib/qos/README.md
  5. 34
      contrib/qos/tc.sh
  6. 0
      doc/man/hush-cli.1
  7. 0
      doc/man/hush-fetch-params.1
  8. 0
      doc/man/hush-tx.1
  9. 0
      doc/man/hushd.1
  10. 28
      zcutil/build-debian-package.sh

72
INSTALL.md

@ -1,5 +1,71 @@
# Building Hush
See the Zcash github wiki (https://github.com/zcash/zcash/wiki) for
instructions on building zcashd, the intended-for-services,
no-graphical-interface, reference implementation of Zcash.
Building Hush from source will take some time but your efforts will be rewarded :)
## Requirements
You will need at least 2GB of RAM to build hush from git source, OR
you can enable a swap file. To enable a 4GB swap file on modern Linux
distributions:
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
You will need to have Git and a C++ compiler and libtool and a
a few other libraries, depending on your setup.
## Building
The following build process generally applies to Ubuntu (and similar) Linux
distributions. For best results it is recommended to use Ubuntu Linux 16.04
or later.
Build HUSH along with most dependencies from source by running
Get dependencies:
```{r, engine='bash'}
sudo apt-get install \
build-essential pkg-config libc6-dev m4 g++-multilib \
autoconf libtool ncurses-dev unzip git python \
zlib1g-dev wget bsdmainutils automake
```
Create a HUSH configuration file (*important*):
```
mkdir -p ~/.hush
echo "rpcuser=username" >> ~/.hush/hush.conf
echo "rpcpassword=`head -c 32 /dev/urandom | base64`" >>~/.hush/hush.conf
```
## Downloading Git source repo, building and running Hush
```{r, engine='bash'}
# pull
git clone https://github.com/MyHush/hush.git
cd hush
# fetch key
./zcutil/fetch-params.sh
# Build
./zcutil/build.sh -j$(nproc)
# Run a HUSH node
./src/hushd
```
## Supported Platforms
Currently only Linux is officially supported. Windows/Mac OS X versions are in the works...
We aim to support all platforms, but there is only so much time in the day.
Currently, any ARMv7 machine will not be able to build this repo, because the
underlying tech (zcash and the zksnark library) do not support that instruction
set.
This also means that RaspberryPi devices will not work, unless they have a newer ARMv8
## Compiling from Git source
git clone https://github.com/MyHush/hush.git
cd hush
./zcutil/build.sh

43
README.md

@ -33,49 +33,18 @@ TEAM
Slack
-----
https://slack.myhush.org/ //invite
Please feel free to join our Slack at https://slack.myhush.org/ .
There are many channels, some you might enjoy are #general, #exchanges and #mining.
Forum
-----
https://forum.myhush.org/
Installing
----------
Building
--------
The following build process generally applies to Ubuntu (and similar) Linux
distributions. For best results it is recommended to use Ubuntu Linux 16.04
or later.
Build HUSH along with most dependencies from source by running
Get dependencies:
```{r, engine='bash'}
sudo apt-get install \
build-essential pkg-config libc6-dev m4 g++-multilib \
autoconf libtool ncurses-dev unzip git python \
zlib1g-dev wget bsdmainutils automake
```
Create a HUSH configuration file (*important*):
```
mkdir -p ~/.hush
echo "rpcuser=username" >> ~/.hush/hush.conf
echo "rpcpassword=`head -c 32 /dev/urandom | base64`" >>~/.hush/hush.conf
```
Install HUSH
```{r, engine='bash'}
# pull
git clone https://github.com/MyHush/hush.git
cd hush
# fetch key
./zcutil/fetch-params.sh
# Build
./zcutil/build.sh -j$(nproc)
# Run a HUSH node
./src/hushd
```
Currently only Linux is officially supported. Windows/Mac OS X versions are in the works...
See [INSTALL.md](https://github.com/MyHush/hush/edit/master/README.md).
Deprecation Policy
------------------

193
Testnet.md

@ -0,0 +1,193 @@
HUSH 1.0.9 - Testnet
=============
What is a Testnet?
--------------
![Logo](doc/hush/hush.png "Logo")
This software is the HUSH node and command-line Testnet client. It provides
a safe place - off the main network - for testing of new features,
applications and ideas without compromising the security of the main network.
How is running the Testnet different to running a Mainnet node?
--------------
In essence their is very little difference in running a Testnet to a Mainnet node
it only requires one of many possible changes in how you start the node - we will
look at just a few.
However - it is important that before you choose which method to use, you consider
if you will be ONLY running a Testnet node, or if you will be running one alongside
a Mainnet node on the same computer.
### To run a Testnet node on it's own (the simplest way) once only.
Make sure there are no other instances of Hush running:
```
cd hush
./src/hush-cli stop
```
Start the Testnet:
```
./src/hushd -testnet
```
This will give you a running node on testnet - and your node will verify testnet
transactions
### To run a Testnet node on it's own every time Hush is started.
For this we need to edit the hush.conf configuration file.
Using your favourite text editor add the following line to the hush.conf file:
```
testnet=1
```
Exit your text editor and start the node with:
```
./src/hushd
```
as usual. Your node will start on the Testnet and be validating Testnet transactions
### I want to run the Testnet AND mine some Testnet coins!
Thats great!! and you will be helping to keep the testnet alive and well - and supporting
all the testing that developers are trying out out on the chain.
But please remember - this is not competitive mining, we don't need a rig full of GPU's
running to keep the Testnet generating blocks and coins - just one CPU core will do!
Keeping the hasrate low will ensure that everybody can mine a few blocks and do some testing.
Please also note - many VPS suppliers don't like users pegging a CPU core at 100% permanently
you may want to run this from home in a VM or on a server you own.
This time we will make some more detailed changes to the hush.conf file (these will need
removing before using this datadir for a Mainnet node)
Using your favourite text editor add the following lines to the hush.conf file:
```
testnet=1
gen=1
genproclimit=1
equihashsolver=tromp
mineraddress=
```
Don't forget to add in one of your testnet transparent addresses (an empty one)
on the last line there - it will keep all your mined coins on one address ready for
shielding.
### What if I want to run Mainnet and Testnet at the same time?
Not recommended - but if you must.
The simple way is to use a common hush.conf file and data directory - but then you
can't mine as you can't tell one to mine and one not to mine using the same config
But you will still need to talk to both nodes.
This is slightly more complex - as you will need to tell the client (hush-cli) which
node you want to talk to when you ask it questions.
By default hush-cli will talk to the Mainnet node if one / both are running
By default hush-cli will talk to the Testnet node if ONLY the testnet is running
First start the Mainnet:
```
./src/hushd
```
Then start the Testnet
```
./src/hushd -testnet
```
Now We need a way to tell hush-cli to talk to the Testnet node instead of the Mainnet
node if both are running.
We can do this by calling the correct Testnet RPC port on the command line:
```
hush-cli -rpcport=18822 getinfo
```
this should show the Testnet node details and Testnet should be listed.
### I REALLY want to run Testnet and Mainnet AND mine on the Testnet
OK - Then I assume you know what you are doing on Linux, some basic
commands and how to troubleshoot when things go wrong.
For this, no changes to the Mainnet hush.conf are needed - they can all be removed
and put back to default.
- Copy your ```/.hush``` data directory to ```/.hush-t``` or a suitably named alternative
- Make the changes to the new ```/.hush-t/hush.conf``` file as before:
```
testnet=1
gen=1
genproclimit=1
equihashsolver=tromp
mineraddress=
```
- Run this from the usual hush directory (adjust for your paths):
```
./src/hushd -datadir=/home/username/.hush-t
```
- OR make a nice bash script in ```/usr/bin/```
```
#!/bin/bash
~/hush/src/hushd -datadir=/home/username/.hush-t $1 $2 $3
```
Remember that to talk to this Testnet node - you will still need to use the
```./src/hush-cli -rpcport=18822``` style command, or of course you could also
make other scripts and nice bits to customise the system the way you want it.
Or use any combination of the methods outlined above.
Happy hashing!
###
Building
--------
Building a Testnet node is no different from building a mainnet node - it
is built into the mainnet node software, which builds as follows:
The following build process generally applies to Ubuntu (and similar) Linux
distributions. For best results it is recommended to use Ubuntu Linux 16.04
or later.
Build HUSH along with most dependencies from source by running
Get dependencies:
```{r, engine='bash'}
sudo apt-get install \
build-essential pkg-config libc6-dev m4 g++-multilib \
autoconf libtool ncurses-dev unzip git python \
zlib1g-dev wget bsdmainutils automake
```
Create a HUSH configuration file (*important*):
```
mkdir -p ~/.hush
echo "rpcuser=username" >> ~/.hush/hush.conf
echo "rpcpassword=`head -c 32 /dev/urandom | base64`" >>~/.hush/hush.conf
```
Install HUSH
```{r, engine='bash'}
# pull
git clone https://github.com/MyHush/hush.git
cd hush
# fetch key
./zcutil/fetch-params.sh
# Build
./zcutil/build.sh -j$(nproc)
# Run a HUSH node
./src/hushd
```
Currently only Linux is officially supported. Windows/Mac OS X versions are in the works...
Deprecation Policy
------------------
This release is considered deprecated 16 weeks after the release day. There
is an automatic deprecation shutdown feature which will halt the node some
time after this 16 week time period. The automatic feature is based on block
height and can be explicitly disabled.
License
-------
For license information see the file [COPYING](COPYING).

32
contrib/qos/README.md

@ -1,5 +1,33 @@
### Qos ###
This is a Linux bash script that will set up tc to limit the outgoing bandwidth for connections to the Bitcoin network. It limits outbound TCP traffic with a source or destination port of 8888, but not if the destination IP is within a LAN (defined as 192.168.x.x).
This is a Linux bash script that will set up tc to limit the outgoing bandwidth for connections to the Hush network. It limits outbound TCP traffic with a source or destination port of 8888, but not if the destination IP is within a LAN (defined as 192.168.x.x).
This means one can have an always-on hushd instance running, and another local wallet which connects to this node and receives blocks from it.
###Usage###
Open the script in a text editor. Find the line that says IF="eth0" and change eth0 to reflect the network interface that your internet connection runs through. To get a list of your computer's network interfaces, use ifconfig on the command line. My computer is connected wireless through wlan1, so the IF line of my tc.sh looks like this:
IF="wlan1"
LINKCEIL should reflect the limit of the network interface, and most likely does not need to be changed.
LINKCEIL="1gbit"
Change LIMIT to be the maximum bandwidth you want **hushd** to use (I chose 1mbit).
LIMIT="1mbit"
Exit your editor and make the script executable with the following command:
chmod +x ./tc.sh
Run the script as root:
sudo ./tc.sh
Your **hushd** bandwidth will be throttled until you reboot your computer!
This means one can have an always-on bitcoind instance running, and another local bitcoind/bitcoin-qt instance which connects to this node and receives blocks from it.

34
contrib/qos/tc.sh

@ -1,11 +1,17 @@
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#network interface on which to limit traffic
IF="eth0"
#limit of the network interface in question
LINKCEIL="1gbit"
#limit outbound Bitcoin protocol traffic to this rate
LIMIT="160kbit"
#defines the address space for which you wish to disable rate limiting
LOCALNET="192.168.0.0/16"
LIMIT="4mbit"
#defines the IPv4 address space for which you wish to disable rate limiting
LOCALNET_V4="192.168.0.0/16"
#defines the IPv6 address space for which you wish to disable rate limiting
LOCALNET_V6="fe80::/10"
#delete existing rules
tc qdisc del dev ${IF} root
@ -24,6 +30,12 @@ tc class add dev ${IF} parent 1:1 classid 1:11 htb rate ${LIMIT} ceil ${LIMIT} p
tc filter add dev ${IF} parent 1: protocol ip prio 1 handle 1 fw classid 1:10
tc filter add dev ${IF} parent 1: protocol ip prio 2 handle 2 fw classid 1:11
if [ ! -z "${LOCALNET_V6}" ] ; then
# v6 cannot have the same priority value as v4
tc filter add dev ${IF} parent 1: protocol ipv6 prio 3 handle 1 fw classid 1:10
tc filter add dev ${IF} parent 1: protocol ipv6 prio 4 handle 2 fw classid 1:11
fi
#delete any existing rules
#disable for now
#ret=0
@ -33,9 +45,15 @@ tc filter add dev ${IF} parent 1: protocol ip prio 2 handle 2 fw classid 1:11
#done
#limit outgoing traffic to and from port 8888. but not when dealing with a host on the local network
# (defined by $LOCALNET)
# --set-mark marks packages matching these criteria with the number "2"
# these packages are filtered by the tc filter with "handle 2"
# (defined by $LOCALNET_V4 and $LOCALNET_V6)
# --set-mark marks packages matching these criteria with the number "2" (v4)
# --set-mark marks packages matching these criteria with the number "4" (v6)
# these packets are filtered by the tc filter with "handle 2"
# this filter sends the packages into the 1:11 class, and this class is limited to ${LIMIT}
iptables -t mangle -A OUTPUT -p tcp -m tcp --dport 8888 ! -d ${LOCALNET} -j MARK --set-mark 0x2
iptables -t mangle -A OUTPUT -p tcp -m tcp --sport 8888 ! -d ${LOCALNET} -j MARK --set-mark 0x2
iptables -t mangle -A OUTPUT -p tcp -m tcp --dport 8888 ! -d ${LOCALNET_V4} -j MARK --set-mark 0x2
iptables -t mangle -A OUTPUT -p tcp -m tcp --sport 8888 ! -d ${LOCALNET_V4} -j MARK --set-mark 0x2
if [ ! -z "${LOCALNET_V6}" ] ; then
ip6tables -t mangle -A OUTPUT -p tcp -m tcp --dport 8888 ! -d ${LOCALNET_V6} -j MARK --set-mark 0x4
ip6tables -t mangle -A OUTPUT -p tcp -m tcp --sport 8888 ! -d ${LOCALNET_V6} -j MARK --set-mark 0x4
fi

0
doc/man/zcash-cli.1 → doc/man/hush-cli.1

0
doc/man/zcash-fetch-params.1 → doc/man/hush-fetch-params.1

0
doc/man/zcash-tx.1 → doc/man/hush-tx.1

0
doc/man/zcashd.1 → doc/man/hushd.1

28
zcutil/build-debian-package.sh

@ -6,7 +6,7 @@ set -e
set -x
BUILD_PATH="/tmp/zcbuild"
PACKAGE_NAME="zcash"
PACKAGE_NAME="hush"
SRC_PATH=`pwd`
SRC_DEB=$SRC_PATH/contrib/debian
SRC_DOC=$SRC_PATH/doc
@ -17,7 +17,7 @@ if [ ! -d $BUILD_PATH ]; then
mkdir $BUILD_PATH
fi
PACKAGE_VERSION=$($SRC_PATH/src/zcashd --version | grep version | cut -d' ' -f4 | tr -d v)
PACKAGE_VERSION=$($SRC_PATH/src/hushd --version | grep version | cut -d' ' -f4 | tr -d v)
DEBVERSION=$(echo $PACKAGE_VERSION | sed 's/-beta/~beta/' | sed 's/-rc/~rc/' | sed 's/-/+/')
BUILD_DIR="$BUILD_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-amd64"
@ -38,32 +38,32 @@ chmod 0755 -R $BUILD_DIR/*
#cp $SRC_DEB/preinst $BUILD_DIR/DEBIAN
#cp $SRC_DEB/prerm $BUILD_DIR/DEBIAN
# Copy binaries
cp $SRC_PATH/src/zcashd $DEB_BIN
cp $SRC_PATH/src/zcash-cli $DEB_BIN
cp $SRC_PATH/zcutil/fetch-params.sh $DEB_BIN/zcash-fetch-params
cp $SRC_PATH/src/hushd $DEB_BIN
cp $SRC_PATH/src/hush-cli $DEB_BIN
cp $SRC_PATH/zcutil/fetch-params.sh $DEB_BIN/hush-fetch-params
# Copy docs
cp $SRC_PATH/doc/release-notes/release-notes-1.0.0.md $DEB_DOC/changelog
cp $SRC_DEB/changelog $DEB_DOC/changelog.Debian
cp $SRC_DEB/copyright $DEB_DOC
cp -r $SRC_DEB/examples $DEB_DOC
# Copy manpages
cp $SRC_DOC/man/zcashd.1 $DEB_MAN
cp $SRC_DOC/man/zcash-cli.1 $DEB_MAN
cp $SRC_DOC/man/zcash-fetch-params.1 $DEB_MAN
cp $SRC_DOC/man/hushd.1 $DEB_MAN
cp $SRC_DOC/man/hush-cli.1 $DEB_MAN
cp $SRC_DOC/man/hush-fetch-params.1 $DEB_MAN
# Copy bash completion files
cp $SRC_PATH/contrib/bitcoind.bash-completion $DEB_CMP/zcashd
cp $SRC_PATH/contrib/bitcoin-cli.bash-completion $DEB_CMP/zcash-cli
cp $SRC_PATH/contrib/bitcoind.bash-completion $DEB_CMP/hushd
cp $SRC_PATH/contrib/bitcoin-cli.bash-completion $DEB_CMP/hush-cli
# Gzip files
gzip --best -n $DEB_DOC/changelog
gzip --best -n $DEB_DOC/changelog.Debian
gzip --best -n $DEB_MAN/zcashd.1
gzip --best -n $DEB_MAN/zcash-cli.1
gzip --best -n $DEB_MAN/zcash-fetch-params.1
gzip --best -n $DEB_MAN/hushd.1
gzip --best -n $DEB_MAN/hush-cli.1
gzip --best -n $DEB_MAN/hush-fetch-params.1
cd $SRC_PATH/contrib
# Create the control file
dpkg-shlibdeps $DEB_BIN/zcashd $DEB_BIN/zcash-cli
dpkg-shlibdeps $DEB_BIN/hushd $DEB_BIN/hush-cli
dpkg-gencontrol -P$BUILD_DIR -v$DEBVERSION
# Create the Debian package

Loading…
Cancel
Save