cpuminer

Cpuminer-opt

Cpuminer-opt, short for CPU Miner Optimized, represents a refined edition of a software tailored for mining activities on central processing units (CPUs). Its primary purpose is to facilitate the extraction of various cryptocurrencies using the CPU, as opposed to employing more specialized tools like ASIC miners (processors specifically crafted for mining).

Developer communities collaborate on creating optimized versions of mining programs, aiming to improve the overall performance and efficiency of CPU mining. Cpuminer-opt commonly incorporates support for multiple mining algorithms, empowering miners to select the one most compatible with their specific hardware.

It is crucial to recognize that CPU mining efficiency is typically lower when compared to utilizing ASIC or GPU (graphics processing unit), prompting the majority of miners to favor more specialized equipment. Cpuminer-opt may prove beneficial for individuals without access to ASIC or GPU or for those engaging in testing and experimentation.

Setting up a batch file

  • cpuminer.exe: Specify the name of the executable program. For cpuminer-opt, it will be different – cpuminer-avx2.exe.
  • -o stratum+tcp://eu.vrm.mining-pool.ovh: Set the pool address.
  • :3032: Place a colon and indicate the pool port.
  • Weblogin: After the -u key, provide either the login for the pool (if registration is required) or the address of your wallet.
  • WorkerName: Specify the worker name (farm name).
  • -p WorkerPassword: Specify the password. Use ‘X’ if no password is required.

Setting up via a configuration file using Raptoreum as an example

To launch the program using the configuration file and the Raptoreum cryptocurrency, it is necessary to create a config.json file in the cpuminer-gr directory. Simply create a text file (.txt) and then change its extension to .json. Open this file for editing in any text editor, such as Notepad. Inside the file, you should insert the following code:

{
  "url": "stratum+tcps://us.flockpool.com:5555",
  "url-backup": "stratum+tcps://us-west.flockpool.com:5555",
  "user": "R9fRZ7jdrPMtj6sHxsfjnYJHZKFtThyc4u.MainPC",
  "pass": "password",
  "algo": "gr"
}

Your URL region should have the lowest ping, and the backup pool (“url-backup”) should be located below. It is recommended to use SSL port (5555). Your worker can be an identifier for any specific machine where you are engaged in mining.

The password plays a role when withdrawing funds, so set it to make it difficult to guess.

Additionally, you can utilize the Start Mining tool from Flockpool for automatic configuration of the config.json file. If you choose to use this tool, simply delete the original config.json and fill in all the parameters on the Flockpool page. After completing this process, upload the newly created configuration file and move it to the cpuminer-gr folder. Note that pool settings are typically specified on the pool itself.

Command Line Arguments

Connection to the pool:

  • -o, --url=URL mining pool address
  • -O, --userpass=U:P username:password pair for the mining pool
  • -u, --user=USERNAME username for the mining pool (can be either a wallet address or a pool login)
  • -p, --pass=PASSWORD password for the mining pool
  • --cert=FILE specify the certificate for the mining server using SSL
  • -x, --proxy=[PROTOCOL://]HOST[:PORT] connect through a proxy
  • -c, --config=FILE load a configuration file in JSON format

Connection to the server:

  • -r, --retries=N: Specify the number of attempts before switching to the backup pool (default: retry indefinitely).
  • -R, --retry-pause=N: Set the pause time between connection attempts (default: 30 seconds).
  • --time-limit=N: Maximum time [s] before exiting the program (default: 300 seconds).
  • -T, --timeout=N: Set the network connection timeout (default: 300 seconds).
  • -s, --scantime=N: Set the upper limit of time for searching the current job, in seconds (default: 10).
  • --randomize: Begin randomizing the search range to reduce the number of duplicate jobs.
  • -f, --diff-factor: Divide the difficulty by this factor (default: 1.0).
  • -m, --diff-multiplier: Multiply the difficulty by this factor (default: 1.0).

Performance:

  • -t, --threads=N: Specify the number of CPU threads (default: number of processors).
  • -1, --oneways=N: You can specify the number of “gateway” threads accompanying your “standard” threads. The default method is determined by your CPU command set (default: 0).
  • --cpu-affinity: Set the affinity to the main CPU core using the mask 0x3 for cores 0 and 1.
  • --cpu-priority: Set the priority. 0 – idle, 2 normal, 5 – highest.
  • --max-rate=N[KMG]: Mine only if the net hash rate is less than the specified value.
  • --max-diff=N: Mine only if the difficulty is less than the specified value. You can configure with --resume-diff=N to set the resumption mining value.
  • --ryzen: Force the use of AVX and disable AVX2. Ryzen 1 *** is much faster.
  • -n, --nfactor: Specify the N-Factor.

Program interface:

  • -q, --quiet: Disable the output of hash rates for each thread.
  • --no-color: Disable colored console output.
  • -D, --debug: Enable debug output.
  • -P, --protocol-dump: Enable protocol event logging.
  • --show-diff: Display the current block and network difficulty.
  • -B, --background: Run the miner in the background.

Solo mining:

  • --coinbase-addr=ADDR: Specify the payout address for solo mining.
  • --coinbase-sig=TEXT: Specify textual data for insertion, if possible.
  • --no-longpoll: Disable X-Long-Polling support.
  • --no-getwork: Disable getwork support.
  • --no-gbt: Disable getblocktemplate support.
  • --no-stratum: Disable X-Stratum protocol support.
  • --no-extranonce: Disable Stratum extranonce protocol support.
  • --no-redirect: Ignore requests to change the mining server URL.

Testing:

  • --benchmark: Run the program in offline testing mode.
  • --cputest: Run the processor algorithm hash debugging mode.

API:

  • -b, --api-bind: Miner API port (default: 127.0.0.1:4068), 0 to disable.
  • --api-remote: Allow remote control of the program.

Reference:

  • -V, --version: Display version information and exit.
  • -h, --help: Display help text and exit.

Other settings:

  • --cpu-affinity-stride N: Specify how many processors to skip when assigning affinity based on features; cannot be used together with ‘–cpu-affinity’ (default: 1). See README.md for more detailed information.
  • --cpu-affinity-default-index N: Specify which processor to run affinity for default threads (default: 0). Refer to README.md for more detailed information.
  • --cpu-affinity-oneway-index N: Specify which processor to run affinity for oneway threads (default: [After default threads]). See README.md for more detailed information.
  • --cpu-priority-oneway 0-5: Specify the priority of oneway threads (0 is the lowest, 5 is the highest) (default: 0).

PC requirements for Cpuminer-opt

  • Processor architecture should be x86_64 with a minimum of SSE2 support, covering Intel Core2 and later models, as well as their AMD counterparts.
  • To benefit from AES_NI optimization, a processor with AES_NI is necessary, including Intel Westmere and newer, and AMD equivalents. Additional optimization is accessible for specific algorithms on processors equipped with AVX and AVX2, such as Sandybridge and Haswell, respectively.
  • Older processors can be supported by an alternative program, cpuminer-multi TPruvot, albeit with reduced performance.
  • ARM processors are not compatible.
  • 64-bit Windows OS is compatible using mingw_w64 and msys or precompiled binaries.
  • MacOS, OSx, and Android are not compatible.
  • The pool operates with the Stratum protocol. Some algorithms may function using getwork or GBT. Results may vary (YMMV).

Releases:

3.22.3

  • Faster SALSA SIMD hashing for yespower, yescrypt, and scryptn2.
  • Addressed several compiler warnings with gcc-12.

3.20.2

  • stratum+ssl, in addition to stratum+tcp, is now recognized as a valid protocol specifier in the URL for establishing a secure stratum connection.
  • The complete URL, including the protocol, is now displayed in the stratum connection log and periodic summary log.
  • Minor optimizations for Cubehash, AVX2, and AVX512.
  • Byte order and prehashing optimization for blake256 and blake512, AVX2, and AVX512.

3.19.4

  • Fixed memory allocation for Verthash on non-hugepages, which was not functioning in version 3.19.3.
  • The new option stratum-keepalive prevents stratum timeouts when no shares are found.
  • Resolved a display error related to optimizations for certain algorithms.

3.19.2

  • Fixed the log displaying incorrect memory usage for scrypt, broken in v3.19.1.
  • Reduced log noise when responses to submitted shares are lost due to stratum protocol errors.
  • Optimized prehashing for the X16r family with AVX2 and AVX512.
  • Minor speed improvement for Hamsi with AVX2 and AVX512.

3.19.1

  • CPU builds with AVX or below are disabled in the assembly.
  • Zen3 build renamed to avx2-sha-vaessupport; Alderlake and Zen3 both fall under this category.
  • Zen build renamed to avx2-sha, supporting Zen1 & Zen2.
  • avx512-sha build removed; Rocketlake processors can utilize avx512-sha-vaes.
  • Refer to README.txt for compatibility details.
  • Addressed several compiler warnings that first appeared in GCC 11.
  • Other minor fixes.
Ranking
( No ratings yet )
miningbro.com/ author of the article
Did you like the article? Share with friends:
Mining BRO