The purpose of this guide is to get you started with mining Noir on Linux. This guide is intended for Ubuntu 16.04 but similar steps should work with other Debian distributions.
Please let us know if you experience issues following this guide. A helpful community is always available to assist on Discord. Alternatively, feel free to contribute to it! Noir is a community coin and we are always welcoming contributions that help Noir grow.
The steps in this section explain how to properly obtain and build cpuminer-opt, which is the recommended miner on Linux.
First, update the apt package manger to obtain the latest packages and install the necessary miner dependences:
sudo apt-get updatesudo apt-get install automake autoconf pkg-config libcurl4-openssl-dev libjansson-dev \libssl-dev libgmp-dev autotools-dev automake make \libcurl4-openssl-dev g++ libssl-dev libgmp3-dev build-essential \screen automake m4 openssl libssl-dev git libjson0 libjson0-dev \libcurl4-openssl-dev autoconf python-software-properties -y
Once the dependencies are done installing, clone cpuminer from the Github repository and run the build script.
cd ~git clone https://github.com/JayDDee/cpuminer-optcd cpuminer-opt./build.sh
Next, enter the following command, ensuring to update the following fields in <brackets>:
<WALLET_ADDRESS>: Your Noir wallet address
-tflag and threads is optional. This indicates the number of threads to mine with. Depending on your hardware specifications, tweaking this number can help improve performance. If this is left off, the default will use the number of cores for your processor.
./cpuminer -a lyra2z330 -o stratum+tcp://pool.noirofficial.org:3000 -u <WALLET_ADDRESS> -p x -t <threads>
Optionally, you can run the miner on startup. There are multiple ways to do this, and one approach is outlined below. Run the following commands and upon reboot of your machine you should see the miner running in the background.
First, create a shell script using your favorite Linux text editor:
cd ~vi runMiner.sh
Next, enter the following command in the file. This assumes you cloned the miner in your home directory, so if you put it elsewhere you will need to update the paths. Be sure to update the <username>, <worker name>, <password>, and <threads> parameters as described in Running the Miner above.
#! /bin/bashcd ~/cpuminer-opt./cpuminer -a lyra2z330 -o stratum+tcp://pool.noirofficial.org:3000 -u <WALLET_ADDRESS> -p x -t <threads>
Next, make your script executable and verify you entered everything correctly by running it. If everything is configured correctly, you should see accepted shares after a few minutes.
sudo chmod a+x ~/runMiner.sh./runMiner.sh
If everything above is running correctly, terminate the script with Ctrl+C. Next, move the script to the
sudo mv ~/runMiner.sh /usr/local/bin
Next, we will switch to the root user and remove
exit 0 from
/etc/rc.local if it exists:
sudo su - # Switch to rootsed -i s/'exit 0'//g /etc/rc.local
Next, we will add the miner script to
/etc/rc.local and add back the
exit 0 using the
>> for redirection of output to a file. Be sure to replace <username> with your user account on Linux.
echo "su - <username> -c runMiner.shexit 0" >> /etc/rc.local
Finally, exit from the root user and restart:
exitsudo shutdown -r now
Upon startup, run
top and you should see
cpuminer running in the background:
ps -ef | grep cpuminer