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:
- Installing the packages
- Configuring ZCash
- Controlling daemon and mining behavior with user level crontab entries
I make the following assumptions:
- You have the ability to elevate to root
- You are OK with running the ZCash node all the time
- You would like to mine coins in the background in your off hours
- You would like to participate in a mining pool
- You do not want to mine coins during your work hours
- You will be running the ZCashd daemon as a regular user
- 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…
Prime ZCash (keys and zkSnark stuff)…
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:
- What is the ETA on the complete/definitive manual?
- ETA on “official” Android/iOS app?
- Is it good practice to use a Tor proxy or is this overkill?
- Can all of the command line options found in “zcashd –help” be used in the ~/.zcash/zcash.conf file?
- Will there be “official” GUIs from the project to administer:
- mining (including pool)?,
- transaction processing?
- If so I hope there it is implemented in KDE or Java SWING so that it behaves the same on Windows/Linux/Mac etc.
- Minimize to system tray on KDE Plasma/Gnome/Windows/Etc.
- Will there be an “official” z.cash mining pool hosted at z.cash?
- A mining contribution going back to the project might be nice.
- Will the daemon get some usability functionality? For instance…
- Mine when processor is available?
- Or, “nice” settings in the zcash.conf file?
- Or, more sophisticated date/time or sleep controls than afforded by my crontab approach above?
- Again, would be great if all this could be controlled and monitored via an “official” GUI
- Will the “official” client get GPU mining capabilities to take advantage of graphics cards?
- As mentioned above I have noticed some alternate mining software is becoming available but haven’t tried them as of yet.
- There are a number of “Crypto-Currency Exchanges” so will one or more of these be designated as “definitive” by the project?
- I’ve noticed that http://kraken.com has already added zcash trading
- Not a plug. Just an observation that it was fast considering the project has only been “live” for a short time.
- I’ve noticed that http://kraken.com has already added zcash trading
- What will the peer review look like on the new currency?
- 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”
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!
LikeLiked by 1 person
[…] Zcash — https://gesker.wordpress.com/2016/11/04/zcash-on-ubuntu-debian/ […]
zcashd running but no worker on flypool.org
What could be the reason?
I’m seeing the same behavior. Not sure why. Also, since the last upgrade from time to time I’m not seeing even local mining work. Odd. But, as ZEC is pretty new I kind of expect a few bugs.
Just out of curiosity have basic transactions worked well for you?
Looks like we are not the only ones having an issue with the main zcashd in pool mining.
I try to use zcash proxy and connect many mainers to one zcashd – it`s work, and then – one zcashd to pool as BIG worker – it`s not work
I’ve still had no luck getting the latest version of the primary zcashd to participate in flypool. But, at least for a basic cpu miner I followed the instructions here:
I made a symbolic link (ln- s) from the generated executable compiled based on those instructions to ~/bin/miner
E.g. ln -s $PathToExecutableFromDirectionsAbove ~/bin/miner
and then made the crontab -e entry
@reboot /usr/bin/nice -19 ~/bin/miner -l us1-zcash.flypool.org:3333 -u t1PBheBAnP8iAPjCWbmPsrgyjW7mWpKv4Ct.myWorker1
I hope this helps you until the main zcashd works better at mining in participation with a pool while still running as a processing node.
Posted follow up question to the behavior we are seeing on the main zcash forum here:
I created an issue on github with regard to stratum / pool mining. Hopefully the project maintainers will look upon the issue favorably.
This item was also posted on the main zcash forums at:
Comments are closed.