Quick intro on how to use Tanguy Pruvot’s version of the “cpuminer-multi” tool to CPU mine Monero Coins.
This guide is continually updated on the wiki. Please see there to get the latest version.
♦ Version: 1, 01/10/2015
♦ This tutorial is provided as a service to the community and if you decide to follow these instructions, you do this on your own responsibility.
♦ Never run miners and such applications with root rights, ie. never sudo them.
Currently, in the year 2015, Monero’s hash-based memory-bound proof-of-work algorithm CryptoNight still is considered ASIC resistant and even a pure CPU miner is able to produce coins. I have not made the calculation if the energy-cost to equipment-costs to money-gain relation is advantageous, but, hey, it’s for the fun :)
Before start mining, you need a Monero address. There are multiple ways to get one, and one possibility is described here.
In this guide, we use Tanguy Pruvot’s version of the “cpuminer-multi” tool. It’s one of the most advanced CPU miner applications, supporting an impressive amount of algorithms. Cryptonight, used by Monero, is one of them.
On way of setting up the CPU miner is described on this page. Alternative ways of performing the installation are of course fine.
Running the Miner
Running the Miner on its own is not efficient. His work will very likely result in Stale Blocks, ie. Blocks that have already been found by other Miners. To increase efficiency and to obtain a relatively predicable Mining Reward return, the best is to use a Mining Pool.
The Mining Pool URL is configured at the command line. The exact syntax should be described on the pool’s web page. In this example, I use http://xmr.poolto.be. (Note: I’m not related to the owner of this pool, I don’t get ‘a bonus’ if you use this pool, and the server is not located in Belgium).
A classic command line looks like this:
./cpuminer -a cryptonight -o stratum+tcp://xmr.poolto.be:2999 -u -p x --api-bind 0 -a : Mining Algorithm, "cryptonight" in case of Monero. -u : User, in case of the Monero Pool server, it's the address that will receive the Mining Reward. -p : Password, received from server owner, most of times 'x' for public servers. -o : Pool server URL, with stratum+tcp: - Protocol //xmr.poolto.be - Server Address :2999 - Server Port --api-bind 0 : Disables the Miner's remote monitoring functionality. No listening port is open. See the installation tutorial for more information.
Example log/console output:
monero@NOSHIP ~/cpuminer-multi $ ./cpuminer -a cryptonight -o stratum+tcp://xmr.poolto.be:2999 -u 45mezmBHxtCivwct1xhKXycUcKHDhmkBAP9wRuEVsK1BjX7TxVVBZSYAPXY7mMbRmC8vYqYnr4ggwJDQEGCUJXLHKr56hwJ -p x --api-bind 0 ** cpuminer-multi 1.2-dev by Tanguy Pruvot (tpruvot@github) ** BTC donation address: 1FhDPLPpw18X4srecguG3MxJYe4a1JsZnd [2015-09-27 14:16:46] Using JSON-RPC 2.0 [2015-09-27 14:16:46] CPU Supports AES-NI: NO [2015-09-27 14:16:46] Starting Stratum on stratum+tcp://xmr.poolto.be:2999 [2015-09-27 14:16:46] 4 miner threads started, using 'cryptonight' algorithm. [2015-09-27 14:16:48] Stratum difficulty set to 500 [2015-09-27 14:16:50] CPU #1: 34.61 H/s [2015-09-27 14:16:50] CPU #0: 33.65 H/s [2015-09-27 14:16:50] CPU #2: 30.65 H/s [2015-09-27 14:16:51] CPU #3: 22.59 H/s [2015-09-27 14:16:51] CPU #0: 30.98 H/s [2015-09-27 14:16:51] accepted: 1/1 (100.00%), 118.83 H/s yes! [2015-09-27 14:16:52] CPU #2: 31.06 H/s :
To exit the Miner, hit CTRL+C.
Please verify that the output shows “….H/s yes!”. When “….H/s nooooo!” appears, your result submission has not been accepted and “something” is wrong. Please note that “something is wrong” is merely the only information that you get about the problem – happy debugging!
Error Handling and Autonomous Operation
If you plan to let the Miner run as background process, in a terminal window or as daemon, you need to keep an eye on the log/output. For more information, please have a look to the section Error Handling and Autonomous Operation in the dedicated article about the miner tool.
monero@NOSHIP ~/cpuminer-multi $ ./cpuminer --help ** cpuminer-multi 1.2-dev by Tanguy Pruvot (tpruvot@github) ** BTC donation address: 1FhDPLPpw18X4srecguG3MxJYe4a1JsZnd Usage: cpuminer-multi [OPTIONS] Options: -a, --algo=ALGO specify the algorithm to use scrypt scrypt(1024, 1, 1) (default) scrypt:N scrypt(N, 1, 1) sha256d SHA-256d axiom Shabal-256 MemoHash blake Blake-256 (SFR) blakecoin Blakecoin blake2s Blake-2 S bmw BMW 256 c11/flax C11 cryptolight Cryptonight-light cryptonight Monero dmd-gr Diamond-Groestl drop Dropcoin fresh Fresh groestl GroestlCoin heavy Heavy keccak Keccak luffa Luffa lyra2re Lyra2RE lyra2rev2 Lyra2REv2 (Vertcoin) myr-gr Myriad-Groestl neoscrypt NeoScrypt(128, 2, 1) nist5 Nist5 pluck Pluck:128 (Supcoin) pentablake Pentablake quark Quark qubit Qubit shavite3 Shavite3 skein Skein+Sha (Skeincoin) skein2 Double Skein (Woodcoin) s3 S3 x11 X11 x13 X13 x14 X14 x15 X15 zr5 ZR5 -o, --url=URL URL of mining server -O, --userpass=U:P username:password pair for mining server -u, --user=USERNAME username for mining server -p, --pass=PASSWORD password for mining server --cert=FILE certificate for mining server using SSL -x, --proxy=[PROTOCOL://]HOST[:PORT] connect through a proxy -t, --threads=N number of miner threads (default: number of processors) -r, --retries=N number of times to retry if a network call fails (default: retry indefinitely) -R, --retry-pause=N time to pause between retries, in seconds (default: 30) --time-limit=N maximum time [s] to mine before exiting the program. -T, --timeout=N timeout for long poll and stratum (default: 300 seconds) -s, --scantime=N upper bound on time spent scanning current work when long polling is unavailable, in seconds (default: 5) --randomize Randomize scan range start to reduce duplicates -f, --diff-factor Divide req. difficulty by this factor (std is 1.0) -m, --diff-multiplier Multiply difficulty by this factor (std is 1.0) -n, --nfactor neoscrypt N-Factor --coinbase-addr=ADDR payout address for solo mining --coinbase-sig=TEXT data to insert in the coinbase when possible --no-longpoll disable long polling support --no-getwork disable getwork support --no-gbt disable getblocktemplate support --no-stratum disable X-Stratum support --no-extranonce disable Stratum extranonce support --no-redirect ignore requests to change the URL of the mining server -q, --quiet disable per-thread hashmeter output --no-color disable colored output -D, --debug enable debug output -P, --protocol-dump verbose dump of protocol-level activities -S, --syslog use system log for output messages -B, --background run the miner in the background --benchmark run in offline benchmark mode --cputest debug hashes from cpu algorithms --cpu-affinity set process affinity to cpu core(s), mask 0x3 for cores 0 and 1 --cpu-priority set process priority (default: 0 idle, 2 normal to 5 highest) -b, --api-bind IP/Port for the miner API (default: 127.0.0.1:4048) --api-remote Allow remote control --max-temp=N Only mine if cpu temp is less than specified value (linux) --max-rate=N[KMG] Only mine if net hashrate is less than specified value --max-diff=N Only mine if net difficulty is less than specified value -c, --config=FILE load a JSON-format configuration file -V, --version display version information and exit -h, --help display this help text and exit