ZCash on Ubuntu & Debian

ZCash is the newest crypto-currency on the block. As of this writing the project is at version 1.0.1 of its client. And, the project seems Debian/Ubuntu friendly as the project maintainers have been pushing the official client in pre-built deb packages for general consumption. Very nice. Thank you z.cash project!

There seems to be a lot of help/instructions on the web. I’ve tried to summarize what I have found at various locations into this recipe below. But, https://z.cash should be considered the final authority on setup and configuration.

This write up intends to provide quick and dirty instructions on:

  1. Installing the packages
  2. Configuring ZCash
  3. Controlling daemon and mining behavior with user level crontab entries

I make the following assumptions:

  1. You have the ability to elevate to root
  2. You are OK with running the ZCash node all the time
  3. You would like to mine coins in the background in your off hours
  4. You would like to participate in a mining pool
  5. You do not want to mine coins during your work hours
  6. You will be running the ZCashd daemon as a regular user
  7. You don’t want to bother with a init.d or systemd script for the moment

At the end of the recipe I pose a few questions. Please comment or add to the discussion if you wish. I hope in advance you find this write-up useful so let’s begin!

Elevate to Root and Install:

$ sudo -s
$ sudo apt-get install apt-transport-https
$ wget -qO – https://apt.z.cash/zcash.asc | sudo apt-key add –
$ echo “deb [arch=amd64] https://apt.z.cash/ jessie main” | sudo tee /etc/apt/sources.list.d/zcash.list
$ apt-get update && sudo apt-get install zcash

Become a regular user and complete the configuration:

Return to regular user after sudo tasks above…
$
exit

Prime ZCash (keys and zkSnark stuff)…
$ zcash-fetch-params

Create configuration directory…
$ mkdir -p ~/.zcash

Add entries to the configuration file…
$ echo “addnode=mainnet.z.cash” >~/.zcash/zcash.conf
$ echo “rpcuser=username” >>~/.zcash/zcash.conf
$ echo “rpcpassword=head -c 32 /dev/urandom | base64” >>~/.zcash/zcash.conf
$ echo ‘equihashsolver=tromp’ >> ~/.zcash/zcash.conf
$ echo ‘#gen=1’ >> ~/.zcash/zcash.conf
$ echo “#genproclimit=$(nproc)” >> ~/.zcash/zcash.conf

Note: the last two entries above are going into the zcash.conf file commented out. This is OK as we will set these parameters in the crontab entries below. You may decide you want to just run ZCash without my crontab entries so you’ll be able to just uncomment those configuration lines.

Create an address (You will use this instead of my address in the crontab entries below when mining coins and will add the suffix rig1, rig2, etc for each machine where you are mining coin.)…
$ zcash-cli z_getnewaddress
$ zcash-cli z_listaddresses

Make you user level crontab entries…
$ crontab -e

# Start the ZCash daemon on reboot using only one (1) core for mining
@reboot /usr/bin/zcashd -reindex -showmetrics=0 -gen=1 -genproclimit=1 -stratum=stratum+tcp://us1-zcash.flypool.org:3333 -user=t1PBheBAnP8iAPjCWbmPsrgyjW7mWpKv4Ct.rig1

# Kill the ZCash daemon running on one (1) core @ 5:25 PM — E.g After Work
25 17   * * *   /usr/bin/pkill zcashd
# Start the ZCash daemon using more processing power (8 cores instead of 1) — E.g After Work
30 17   * * *   /usr/bin/zcashd -reindex -showmetrics=0 -gen=1 -genproclimit=8 -stratum=stratum+tcp://us1-zcash.flypool.org:3333 -user=t1PBheBAnP8iAPjCWbmPsrgyjW7mWpKv4Ct.rig1

# Kill the ZCash daemon using many cores @ 7:25 AM — E.g. Before Work
25 07   * * *   /usr/bin/pkill zcashd
# Start the ZCash @ 7:30 AM using only one (1) core for mining — E.g. Before Work
30 07   * * *   /usr/bin/zcashd -reindex -showmetrics=0 -gen=1 -genproclimit=1 -stratum=stratum+tcp://us1-zcash.flypool.org:3333 -user=t1PBheBAnP8iAPjCWbmPsrgyjW7mWpKv4Ct.rig1

Note:  flypool.org is just the first mining pool I found that didn’t require an account so I have been using it for testing. Please leave a comment below if you know of a good one and wish to make a recommendation. In addition I have seen that there are other mining packages out there that can be compiled and installed with little trouble but for now I’m content to try out the base client for pool mining.

Note: genproclimit is just how many cores you wish to use when mining. At the command line issue the “nproc” command to learn/confirm how many cores you have in your system. Adjust the genproclimit in the crontab entries to suit your needs.

Note: Simply using zcashd -daemon isn’t a bad option either if your not worried about system responsiveness. Your crontab -e entry would just be @reboot /usr/bin/zcashd -daemon just make sure you uncomment the gen and genproclimit lines in ~/.zcash/zcash.conf

Items I’m curious about:

  1. What is the ETA on the complete/definitive manual?
  2. ETA on “official” Android/iOS app?
  3. Is it good practice to use a Tor proxy or is this overkill?
  4. Can all of the command line options found in “zcashd –help” be used in the ~/.zcash/zcash.conf file?
  5. Will there be “official” GUIs from the project to administer:
    1. mining (including pool)?,
    2. wallet(s)?
    3. transaction processing?
      1. If so I hope there it is implemented in KDE or Java SWING so that it behaves the same on Windows/Linux/Mac etc.
      2. Minimize to system tray on KDE Plasma/Gnome/Windows/Etc.
  6. Will there be an “official” z.cash mining pool hosted at z.cash?
    1. A mining contribution going back to the project might be nice.
  7. Will the daemon get some usability functionality? For instance…
    1. Mine when processor is available?
    2. Or, “nice” settings in the zcash.conf file?
    3. Or, more sophisticated date/time or sleep controls than afforded by my crontab approach above?
    4. Again, would be great if all this could be controlled and monitored via an “official” GUI
  8. Will the “official” client get GPU mining capabilities to take advantage of graphics cards?
    1. As mentioned above I have noticed some alternate mining software is becoming available but haven’t tried them as of yet.
  9. There are a number of “Crypto-Currency Exchanges” so will one or more of these be designated as “definitive” by the project?
    1. I’ve noticed that http://kraken.com has already added zcash trading
      1. Not a plug. Just an observation that it was fast considering the project has only been “live” for a short time.
  10. What will the peer review look like on the new currency?
  11. How much peer review does the project require to confirm that the currency is secure and anonymous?

Finally, thank you to the members of the Z.Cash project for the new Crypto-Currency! Please check them out directly at: https:/z.cash

10 thoughts on “ZCash on Ubuntu & Debian

  1. Received a tip regarding this post on my personal email:

    Set gen=1 and genproclimit=$(nproc) in ~/.zcash/zcash.conf then just make one crontab -e entry of:

    @reboot /usr/bin/nice -n 19 /usr/bin/zcashd -daemon -reindex -stratum=stratum+tcp://us1-zcash.flypool.org:3333 -user=t1PBheBAnP8iAPjCWbmPsrgyjW7mWpKv4Ct.rig1

    and that should be sufficient to let you continue to mine and let your system be responsive without multiple crontab entries.

    Thanks for the feedback!

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s