Guide to Solo Mining Zcash

Austin Williams edited this page Aug 16, 2017 · 18 revisions

Zcash Solo Mining

This guide is no longer applicable. You should use third-party GPU mining software and mine to a pool now. This wiki will remain here for historical purposes.

This is an unofficial guide to Zcash solo mining. I put this together because I noticed a lot of folks over in the zcash forums were interested in something like this. I'm not affiliated with the zcash project or developers in any way, and this guide is based solely on what I've learned while floundering with the software. Use this guide at your own risk.

The first part of this guide is taken from the Public-Sprout-Guide. In particular, the Getting Started, Compiling, and Testing sections are copied here almost verbatim. If you struggle with any of these sections, see the Public Beta Guide.

DISCALIMER: This is beta software and it changes rapidly. I make no promises that I'll keep this guide up-to-date. Use at your own risk.

DISCLAIMER: Solo mining is almost pointless now with the network hashrate as high as it is. You would be much better off pool mining. That said, if you do want to solo mine, here's how.

Getting Started

I start with a fresh install of Ubuntu and run updates:

$ sudo apt-get update

Then install the dependencies:

$ sudo apt-get install build-essential pkg-config libgtest-dev libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake

Then fetch the zcash repository with git and run fetch-params.sh like so:

$ git clone https://github.com/zcash/zcash.git
$ cd zcash/
$ git checkout origin
$ ./zcutil/fetch-params.sh

This will fetch the public beta proving and verifying keys and place them into ~/.zcash-params/. These keys are, together, nearly 1.5GB in size, so it may take some time to download them.

Compiling

Ensure you have successfully installed all system package dependencies as described above. Then run the build:

$ ./zcutil/build.sh -j$(nproc)

This should compile the dependencies and build zcashd.

Testing

The tests take a while to run but I encourage you to do them anyway. For the first set of tests run:

$ ./qa/zcash/full-test-suite.sh

If you notice any failed tests, please inform the zcash devs.

To run the next set of tests run:

$ ./qa/pull-tester/rpc-tests.sh

Again, if you get any failures, please inform the zcash devs.

Solo Mining Configuration

We need to set up a config file, so first we make a directory for it:

$ mkdir -p ~/.zcash

Next we need to create a config file and give it some configurations. First we create and edit the file:

$ nano ~/.zcash/zcash.conf

Enter the following in the file:

addnode=mainnet.z.cash
rpcuser=rpcusername
rpcpassword=rpcpassword
gen=1
genproclimit=4
equihashsolver=tromp

Naturally, you'll want to use a random password. You'll also want to set the genproclimit to the number of cores on which you want to mine. Then save the file (within nano you do this via CTRL+X then Y).

Starting the Miner

Now that your config file is set up, you start the zcash server via:

$ ~/zcash/./src/zcashd -daemon

Give your server a few seconds to finish loading. You can check to see if it's working via:

$ ~/zcash/./src/zcash-cli getinfo

Give your node time to catch up with the blockchain. You can see how many blocks your node has received/checked by running the following command and looking at the line labelled blocks:

$ ~/zcash/./src/zcash-cli getinfo

That's it! You're mining zcash!

Useful Commands

Now that your miner is running, there are some commands you'll want to familiarize yourself with.

Stop/Start Mining

If you want to stop mining use the command: $ ~/zcash/./src/zcash-cli setgenerate false

You can start up again via the command: $ ~/zcash/./src/zcash-cli setgenerate true

It can take a few seconds for your node to startup/stop after issuing these commands. Be patient.

See Your Mined Coins

To check if you've mined coins first run the command:

$ ~/zcash/./src/zcash-cli listtransactions

This will output a list of all transactions associated with your wallet, along with their details. Any transaction in that list that has "generated" : true is coinbase transaction. Those are coins that you've mined!

Note: It takes some time (100 blocks) for the coinbase transactions to "settle" and show up in your wallet balance. Any coinbase transaction that has "category" : "immature" is one that you've successfully mined but hasn't settled yet.

Be patient, and after 100 blocks this will switch to "generated" : true -- at which time those mined coins will show up in your wallet balance and will be spendable.

Checking Your Wallet Balance

You can see your balance by running the following command and looking for "balance": xxxxx:

$ ~/zcash/./src/zcash-cli getinfo

Note that your mined coins won't show up in your balance until they are 100 blocks deep.

Beyond Mining

To learn how to send/receive your coins, protect them, and perform private spends, you should head back to this part of the Public-Beta-Guide

Donations

Donations are appreciated but not expected. If you feel like showing some love for me putting this guide together can do so here:

QRC

BTC: 1AwkkQrKPNPPKkyALd9KfnzCu6Q1CWniPZ

Thank you!

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.