README 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954
  1. This is a multi-threaded multi-pool FPGA and ASIC miner for bitcoin.
  2. This code is provided entirely free of charge by the programmer in his spare
  3. time so donations would be greatly appreciated. Please consider donating to the
  4. address below.
  5. Con Kolivas <kernel@kolivas.org>
  6. 15qSxP1SQcUX3o4nhkfdbgyoWEFMomJ4rZ
  7. DOWNLOADS:
  8. http://ck.kolivas.org/apps/cgminer
  9. GIT TREE:
  10. https://github.com/ckolivas/cgminer
  11. Support thread:
  12. http://bitcointalk.org/index.php?topic=28402.0
  13. IRC Channel:
  14. irc://irc.freenode.net/cgminer
  15. License: GPLv3. See COPYING for details.
  16. SEE ALSO API-README, ASIC-README and FGPA-README FOR MORE INFORMATION ON EACH.
  17. ---
  18. EXECUTIVE SUMMARY ON USAGE:
  19. Single pool:
  20. cgminer -o http://pool:port -u username -p password
  21. Multiple pools:
  22. cgminer -o http://pool1:port -u pool1username -p pool1password -o http://pool2:port -u pool2usernmae -p pool2password
  23. Single pool with a standard http proxy:
  24. cgminer -o "http:proxy:port|http://pool:port" -u username -p password
  25. Single pool with a socks5 proxy:
  26. cgminer -o "socks5:proxy:port|http://pool:port" -u username -p password
  27. Single pool with stratum protocol support:
  28. cgminer -o stratum+tcp://pool:port -u username -p password
  29. Solo mining to local bitcoind:
  30. cgminer -o http://localhost:8332 -u username -p password --btc-address 15qSxP1SQcUX3o4nhkfdbgyoWEFMomJ4rZ
  31. The list of proxy types are:
  32. http: standard http 1.1 proxy
  33. http0: http 1.0 proxy
  34. socks4: socks4 proxy
  35. socks5: socks5 proxy
  36. socks4a: socks4a proxy
  37. socks5h: socks5 proxy using a hostname
  38. If you compile cgminer with a version of CURL before 7.19.4 then some of the above will
  39. not be available. All are available since CURL version 7.19.4
  40. If you specify the --socks-proxy option to cgminer, it will only be applied to all pools
  41. that don't specify their own proxy setting like above
  42. After saving configuration from the menu, you do not need to give cgminer any
  43. arguments and it will load your configuration.
  44. Any configuration file may also contain a single
  45. "include" : "filename"
  46. to recursively include another configuration file.
  47. Writing the configuration will save all settings from all files in the output.
  48. ---
  49. BUILDING CGMINER FOR YOURSELF
  50. DEPENDENCIES:
  51. Mandatory:
  52. pkg-config http://www.freedesktop.org/wiki/Software/pkg-config
  53. libtool http://www.gnu.org/software/libtool/
  54. Optional:
  55. curl dev library http://curl.haxx.se/libcurl/
  56. (libcurl4-openssl-dev - Must tell configure --disable-libcurl otherwise
  57. it will attempt to compile it in)
  58. curses dev library
  59. (libncurses5-dev or libpdcurses on WIN32 for text user interface)
  60. libudev dev library (libudev-dev)
  61. (This is only required for USB device support and is linux only)
  62. If building from git:
  63. autoconf
  64. automake
  65. If building on Red Hat:
  66. sudo yum install autoconf automake autoreconf libtool openssl-compat-bitcoin-devel.x86_64 \
  67. curl libcurl libcurl-devel openssh
  68. If building on Ubuntu:
  69. sudo apt-get install build-essential autoconf automake libtool pkg-config \
  70. libcurl3-dev libudev-dev
  71. CGMiner specific configuration options:
  72. --enable-ants1 Compile support for Antminer S1 Bitmain (default
  73. disabled)
  74. --enable-avalon Compile support for Avalon (default disabled)
  75. --enable-bab Compile support for BlackArrow Bitfury (default
  76. disabled)
  77. --enable-bflsc Compile support for BFL ASICs (default disabled)
  78. --enable-bitforce Compile support for BitForce FPGAs (default
  79. disabled)
  80. --enable-bitfury Compile support for BitFury ASICs (default disabled)
  81. --enable-bitmine_A1 Compile support for Bitmine.ch A1 ASICs (default
  82. disabled)
  83. --enable-drillbit Compile support for Drillbit BitFury ASICs (default
  84. disabled)
  85. --enable-hashfast Compile support for Hashfast (default disabled)
  86. --enable-icarus Compile support for Icarus (default disabled)
  87. --enable-klondike Compile support for Klondike (default disabled)
  88. --enable-knc Compile support for KnC miners (default disabled)
  89. --enable-avalon2 Compile support for Avalon2 (default disabled)
  90. --enable-minion Compile support for Minion BlackArrow ASIC (default
  91. disabled)
  92. --enable-modminer Compile support for ModMiner FPGAs(default disabled)
  93. --enable-spondoolies Compile support for Spondoolies (default disabled)
  94. --disable-libcurl Disable building with libcurl for getwork and GBT
  95. support
  96. --without-curses Compile support for curses TUI (default enabled)
  97. --with-system-libusb Compile against dynamic system libusb (default use
  98. included static libusb)
  99. Basic *nix build instructions:
  100. To actually build:
  101. ./autogen.sh # only needed if building from git repo
  102. CFLAGS="-O2 -Wall -march=native" ./configure <options>
  103. make
  104. No installation is necessary. You may run cgminer from the build
  105. directory directly, but you may do make install if you wish to install
  106. cgminer to a system location or location you specified.
  107. Native WIN32 build instructions: see windows-build.txt
  108. ---
  109. Usage instructions: Run "cgminer --help" to see options:
  110. Usage: cgminer [-DdElmpPQqUsTouOchnV]
  111. Options for both config file and command line:
  112. --anu-freq <arg> Set AntminerU1 frequency in MHz, range 150-500 (default: 200)
  113. --api-allow <arg> Allow API access only to the given list of [G:]IP[/Prefix] addresses[/subnets]
  114. --api-description <arg> Description placed in the API status header, default: cgminer version
  115. --api-groups <arg> API one letter groups G:cmd:cmd[,P:cmd:*...] defining the cmds a groups can use
  116. --api-listen Enable API, default: disabled
  117. --api-mcast Enable API Multicast listener, default: disabled
  118. --api-mcast-addr <arg> API Multicast listen address
  119. --api-mcast-code <arg> Code expected in the API Multicast message, don't use '-'
  120. --api-mcast-des <arg> Description appended to the API Multicast reply, default: ''
  121. --api-mcast-port <arg> API Multicast listen port (default: 4028)
  122. --api-network Allow API (if enabled) to listen on/for any address, default: only 127.0.0.1
  123. --api-port <arg> Port number of miner API (default: 4028)
  124. --avalon-auto Adjust avalon overclock frequency dynamically for best hashrate
  125. --avalon-cutoff <arg> Set avalon overheat cut off temperature (default: 60)
  126. --avalon-fan <arg> Set fanspeed percentage for avalon, single value or range (default: 20-100)
  127. --avalon-freq <arg> Set frequency range for avalon-auto, single value or range
  128. --avalon-options <arg> Set avalon options baud:miners:asic:timeout:freq:tech
  129. --avalon-temp <arg> Set avalon target temperature (default: 50)
  130. --bab-options <arg> Set BaB options max:def:min:up:down:hz:delay:trf
  131. --balance Change multipool strategy from failover to even share balance
  132. --benchfile <arg> Run cgminer in benchmark mode using a work file - produces no shares
  133. --benchfile-display Display each benchfile nonce found
  134. --benchmark Run cgminer in benchmark mode - produces no shares
  135. --bfl-range Use nonce range on bitforce devices if supported
  136. --bflsc-overheat <arg> Set overheat temperature where BFLSC devices throttle, 0 to disable (default: 85)
  137. --bitburner-fury-voltage <arg> Set BitBurner Fury core voltage, in millivolts
  138. --bitburner-fury-options <arg> Override avalon-options for BitBurner Fury boards baud:miners:asic:timeout:freq
  139. --bitburner-voltage <arg> Set BitBurner (Avalon) core voltage, in millivolts
  140. --bitmain-auto Adjust bitmain overclock frequency dynamically for best hashrate
  141. --bitmain-cutoff Set bitmain overheat cut off temperature
  142. --bitmain-fan Set fanspeed percentage for bitmain, single value or range (default: 20-100)
  143. --bitmain-freq Set frequency range for bitmain-auto, single value or range
  144. --bitmain-hwerror Set bitmain device detect hardware error
  145. --bitmain-options Set bitmain options baud:miners:asic:timeout:freq
  146. --bitmain-temp Set bitmain target temperature
  147. --bxf-bits <arg> Set max BXF/HXF bits for overclocking (default: 54)
  148. --bxf-temp-target <arg> Set target temperature for BXF/HXF devices (default: 82)
  149. --bxm-bits <arg> Set BXM bits for overclocking (default: 54)
  150. --btc-address <arg> Set bitcoin target address when solo mining to bitcoind
  151. --btc-sig <arg> Set signature to add to coinbase when solo mining (optional)
  152. --compact Use compact display without per device statistics
  153. --debug|-D Enable debug output
  154. --disable-rejecting Automatically disable pools that continually reject shares
  155. --drillbit-options <arg> Set drillbit options <int|ext>:clock[:clock_divider][:voltage]
  156. --expiry|-E <arg> Upper bound on how many seconds after getting work we consider a share from it stale (default: 120)
  157. --failover-only Don't leak work to backup pools when primary pool is lagging
  158. --fix-protocol Do not redirect to a different getwork protocol (eg. stratum)
  159. --hfa-hash-clock <arg> Set hashfast clock speed (default: 550)
  160. --hfa-fail-drop <arg> Set how many MHz to drop clockspeed each failure on an overlocked hashfast device (default: 10)
  161. --hfa-fan <arg> Set fanspeed percentage for hashfast, single value or range (default: 10-85)
  162. --hfa-name <arg> Set a unique name for a single hashfast device specified with --usb or the first device found
  163. --hfa-noshed Disable hashfast dynamic core disabling feature
  164. --hfa-options <arg> Set hashfast options name:clock (comma separated)
  165. --hfa-temp-overheat <arg> Set the hashfast overheat throttling temperature (default: 95)
  166. --hfa-temp-target <arg> Set the hashfast target temperature (0 to disable) (default: 88)
  167. --hotplug <arg> Seconds between hotplug checks (0 means never check)
  168. --klondike-options <arg> Set klondike options clock:temptarget
  169. --load-balance Change multipool strategy from failover to quota based balance
  170. --log|-l <arg> Interval in seconds between log output (default: 5)
  171. --lowmem Minimise caching of shares for low memory applications
  172. --minion-chipreport <arg> Seconds to report chip 5min hashrate, range 0-100 (default: 0=disabled)
  173. --minion-freq <arg> Set minion chip frequencies in MHz, single value or comma list, range 100-1400 (default: 1000)
  174. --minion-idlecount Report when IdleCount is >0 or changes
  175. --minion-overheat Enable directly halting any chip when the status exceeds 100C
  176. --minion-temp <arg> Set minion chip temperature threshold, single value or comma list, range 120-160 (default: 135C)
  177. --monitor|-m <arg> Use custom pipe cmd for output messages
  178. --nfu-bits <arg> Set nanofury bits for overclocking, range 32-63 (default: 50)
  179. --net-delay Impose small delays in networking to not overload slow routers
  180. --no-submit-stale Don't submit shares if they are detected as stale
  181. --pass|-p <arg> Password for bitcoin JSON-RPC server
  182. --per-device-stats Force verbose mode and output per-device statistics
  183. --protocol-dump|-P Verbose dump of protocol-level activities
  184. --queue|-Q <arg> Minimum number of work items to have queued (0+) (default: 1)
  185. --quiet|-q Disable logging output, display status and errors
  186. --quota|-U <arg> quota;URL combination for server with load-balance strategy quotas
  187. --real-quiet Disable all output
  188. --rotate <arg> Change multipool strategy from failover to regularly rotate at N minutes (default: 0)
  189. --round-robin Change multipool strategy from failover to round robin on failure
  190. --scan-time|-s <arg> Upper bound on time spent scanning current work, in seconds (default: -1)
  191. --sched-start <arg> Set a time of day in HH:MM to start mining (a once off without a stop time)
  192. --sched-stop <arg> Set a time of day in HH:MM to stop mining (will quit without a start time)
  193. --sharelog <arg> Append share log to file
  194. --shares <arg> Quit after mining N shares (default: unlimited)
  195. --socks-proxy <arg> Set socks4 proxy (host:port)
  196. --syslog Use system log for output messages (default: standard error)
  197. --temp-cutoff <arg> Temperature where a device will be automatically disabled, one value or comma separated list (default: 95)
  198. --text-only|-T Disable ncurses formatted screen output
  199. --url|-o <arg> URL for bitcoin JSON-RPC server
  200. --usb <arg> USB device selection
  201. --user|-u <arg> Username for bitcoin JSON-RPC server
  202. --userpass|-O <arg> Username:Password pair for bitcoin JSON-RPC server
  203. --verbose Log verbose output to stderr as well as status output
  204. --widescreen Use extra wide display without toggling
  205. --worktime Display extra work time debug information
  206. Options for command line only:
  207. --config|-c <arg> Load a JSON-format configuration file
  208. See example.conf for an example configuration.
  209. --default-config <arg> Specify the filename of the default config file
  210. Loaded at start and used when saving without a name.
  211. --help|-h Print this message
  212. --ndevs|-n Display all USB devices and exit
  213. --version|-V Display version and exit
  214. Silent USB device (ASIC and FPGA) options:
  215. --icarus-options <arg> Set specific FPGA board configurations - one set of values for all or comma separated
  216. --icarus-timing <arg> Set how the Icarus timing is calculated - one setting/value for all or comma separated
  217. --usb-dump (See FPGA-README)
  218. See FGPA-README or ASIC-README for more information regarding these.
  219. ASIC only options:
  220. --anu-freq <arg> Set AntminerU1 frequency in hex, range 150-500 (default: 200)
  221. --avalon-auto Adjust avalon overclock frequency dynamically for best hashrate
  222. --avalon-cutoff <arg> Set avalon overheat cut off temperature (default: 60)
  223. --avalon-fan <arg> Set fanspeed percentage for avalon, single value or range (default: 20-100)
  224. --avalon-freq <arg> Set frequency range for avalon-auto, single value or range
  225. --avalon-options <arg> Set avalon options baud:miners:asic:timeout:freq:tech
  226. --avalon-temp <arg> Set avalon target temperature (default: 50)
  227. --bab-options <arg> Set BaB options max:def:min:up:down:hz:delay:trf
  228. --bflsc-overheat <arg> Set overheat temperature where BFLSC devices throttle, 0 to disable (default: 90)
  229. --bitburner-fury-options <arg> Override avalon-options for BitBurner Fury boards baud:miners:asic:timeout:freq
  230. --bitburner-fury-voltage <arg> Set BitBurner Fury core voltage, in millivolts
  231. --bitburner-voltage <arg> Set BitBurner (Avalon) core voltage, in millivolts
  232. --bxf-temp-target <arg> Set target temperature for BXF devices (default: 82)
  233. --bxm-bits <arg> Set BXM bits for overclocking (default: 50)
  234. --hfa-hash-clock <arg> Set hashfast clock speed (default: 550)
  235. --hfa-fail-drop <arg> Set how many MHz to drop clockspeed each failure on an overlocked hashfast device (default: 10)
  236. --hfa-fan <arg> Set fanspeed percentage for hashfast, single value or range (default: 10-85)
  237. --hfa-name <arg> Set a unique name for a single hashfast device specified with --usb or the first device found
  238. --hfa-noshed Disable hashfast dynamic core disabling feature
  239. --hfa-temp-overheat <arg> Set the hashfast overheat throttling temperature (default: 95)
  240. --hfa-temp-target <arg> Set the hashfast target temperature (0 to disable) (default: 88)
  241. --klondike-options <arg> Set klondike options clock:temptarget
  242. See ASIC-README for more information regarding these.
  243. FPGA only options:
  244. --bfl-range Use nonce range on bitforce devices if supported
  245. See FGPA-README for more information regarding this.
  246. Cgminer should automatically find all of your Avalon ASIC, BFL ASIC, BitForce
  247. FPGAs, Icarus bitstream FPGAs, Klondike ASIC, ASICMINER usb block erupters,
  248. KnC ASICs, BaB ASICs, Hashfast ASICs, ModMiner FPGAs, BPMC/BGMC BF1 USB ASICs,
  249. Bi*fury USB ASICs, Onestring miner USB ASICs, Hexfury USB ASICs, Nanofury USB
  250. ASICs, Antminer U1/U2/U2+ USB ASICs, Cointerra devices and BFx2 USB ASICs.
  251. ---
  252. SETTING UP USB DEVICES
  253. WINDOWS:
  254. On windows, the direct USB support requires the installation of a WinUSB
  255. driver (NOT the ftdi_sio driver), and attach it to the chosen USB device.
  256. When configuring your device, plug it in and wait for windows to attempt to
  257. install a driver on its own. It may think it has succeeded or failed but wait
  258. for it to finish regardless. This is NOT the driver you want installed. At this
  259. point you need to associate your device with the WinUSB driver. The easiest
  260. way to do this is to use the zadig utility which you must right click on and
  261. run as administrator. Then once you plug in your device you can choose the
  262. "list all devices" from the "option" menu and you should be able to see the
  263. device as something like: "BitFORCE SHA256 SC". Choose the install or replace
  264. driver option and select WinUSB. You can either google for zadig or download
  265. it from the cgminer directory in the DOWNLOADS link above.
  266. When you first switch a device over to WinUSB with zadig and it shows that
  267. correctly on the left of the zadig window, but it still gives permission
  268. errors, you may need to unplug the USB miner and then plug it back in. Some
  269. users may need to reboot at this point.
  270. LINUX:
  271. On linux, the direct USB support requires no drivers at all. However due to
  272. permissions issues, you may not be able to mine directly on the devices as a
  273. regular user without giving the user access to the device or by mining as
  274. root (administrator). In order to give your regular user access, you can make
  275. him a member of the plugdev group with the following commands:
  276. sudo usermod -G plugdev -a `whoami`
  277. If your distribution does not have the plugdev group you can create it with:
  278. sudo groupadd plugdev
  279. In order for the USB devices to instantly be owned by the plugdev group and
  280. accessible by anyone from the plugdev group you can copy the file
  281. "01-cgminer.rules" from the cgminer archive into the /etc/udev/rules.d
  282. directory with the following command:
  283. sudo cp 01-cgminer.rules /etc/udev/rules.d/
  284. After this you can either manually restart udev and re-login, or more easily
  285. just reboot.
  286. OSX:
  287. On OSX, like Linux, no drivers need to be installed. However some devices
  288. like the bitfury USB sticks automatically load a driver thinking they're a
  289. modem and the driver needs to be unloaded for cgminer to work:
  290. sudo kextunload -b com.apple.driver.AppleUSBCDC
  291. sudo kextunload -b com.apple.driver.AppleUSBCDCACMData
  292. There may be a limit to the number of USB devices that you are allowed to start.
  293. The following set of commands, followed by a reboot will increase that:
  294. sudo su
  295. touch /etc/sysctl.conf
  296. echo kern.sysv.semume=100 >> /etc/sysctl.conf
  297. chown root:wheel /etc/sysctl.conf
  298. chmod 0644 /etc/sysctl.conf
  299. Some devices need superuser access to mine on them so cgminer may need to
  300. be started with sudo
  301. i.e.:
  302. sudo cgminer <insert commands here>
  303. ---
  304. Advanced USB options:
  305. The --usb option can restrict how many USB devices are found:
  306. --usb 1:2,1:3,1:4,1:*
  307. or
  308. --usb BAS:1,BFL:1,MMQ:0,ICA:0,KLN:0
  309. or
  310. --usb :10
  311. You can only use one of the above 3
  312. The first version
  313. --usb 1:2,1:3,1:4,1:*
  314. allows you to select which devices to mine on with a list of USB
  315. bus_number:device_address
  316. All other USB devices will be ignored
  317. Hotplug will also only look at the devices matching the list specified and
  318. find nothing new if they are all in use
  319. You can specify just the USB bus_number to find all devices like 1:*
  320. which means any devices on USB bus_number 1
  321. This is useful if you unplug a device then plug it back in the same port,
  322. it usually reappears with the same bus_number but a different device_address
  323. You can see the list of all USB devices on linux with 'sudo lsusb'
  324. Cgminer will list the recognised USB devices
  325. with the '-n' option or the
  326. '--usb-dump 0' option
  327. The '--usb-dump N' option with a value of N greater than 0 will dump a lot
  328. of details about each recognised USB device
  329. If you wish to see all USB devices, include the --usb-list-all option
  330. The second version
  331. --usb BAS:1,BFL:1,MMQ:0,ICA:0,KLN:0
  332. allows you to specify how many devices to choose based on each device
  333. driver cgminer has - the current USB drivers are:
  334. AVA, BAS, BFL, BF1, DRB, HFA, ICA, KLN and MMQ.
  335. N.B. you can only specify which device driver to limit, not the type of
  336. each device, e.g. with BAS:n you can limit how many BFL ASIC devices will
  337. be checked, but you cannot limit the number of each type of BFL ASIC
  338. Also note that the MMQ count is the number of MMQ backplanes you have
  339. not the number of MMQ FPGAs
  340. The third version
  341. --usb :10
  342. means only use a maximum of 10 devices of any supported USB devices
  343. Once cgminer has 10 devices it will not configure any more and hotplug will
  344. not scan for any more
  345. If one of the 10 devices stops working, hotplug - if enabled, as is default
  346. - will scan normally again until it has 10 devices
  347. --usb :0 will disable all USB I/O other than to initialise libusb
  348. ---
  349. WHILE RUNNING:
  350. The following options are available while running with a single keypress:
  351. [U]SB management [P]ool management [S]ettings [D]isplay options [Q]uit
  352. U gives you:
  353. [S]ummary of device information
  354. [E]nable device
  355. [D]isable device
  356. [U]nplug to allow hotplug restart
  357. [R]eset device USB
  358. [L]ist all known devices
  359. [B]lacklist current device from current instance of cgminer
  360. [W]hitelist previously blacklisted device
  361. [H]otplug interval (0 to disable)
  362. P gives you:
  363. Current pool management strategy: Failover
  364. [F]ailover only disabled
  365. [A]dd pool [R]emove pool [D]isable pool [E]nable pool
  366. [C]hange management strategy [S]witch pool [I]nformation
  367. S gives you:
  368. [Q]ueue: 1
  369. [S]cantime: 60
  370. [E]xpiry: 120
  371. [W]rite config file
  372. [C]gminer restart
  373. D gives you:
  374. [N]ormal [C]lear [S]ilent mode (disable all output)
  375. [D]ebug:off
  376. [P]er-device:off
  377. [Q]uiet:off
  378. [V]erbose:off
  379. [R]PC debug:off
  380. [W]orkTime details:off
  381. co[M]pact: off
  382. [T]oggle status switching:enabled
  383. [Z]ero statistics
  384. [L]og interval:5
  385. Q quits the application.
  386. The running log shows output like this:
  387. [2013-11-09 11:04:41] Accepted 01b3bde7 Diff 150/128 AVA 1 pool 0
  388. [2013-11-09 11:04:49] Accepted 015df995 Diff 187/128 AVA 1 pool 0
  389. [2013-11-09 11:04:50] Accepted 01163b68 Diff 236/128 AVA 1 pool 0
  390. [2013-11-09 11:04:53] Accepted 9f745840 Diff 411/128 BAS 1 pool 0
  391. The 8 byte hex value are the 1st nonzero bytes of the share being submitted to
  392. the pool. The 2 diff values are the actual difficulty target that share reached
  393. followed by the difficulty target the pool is currently asking for.
  394. ---
  395. Also many issues and FAQs are covered in the forum thread
  396. dedicated to this program,
  397. http://forum.bitcoin.org/index.php?topic=28402.0
  398. DISPLAY:
  399. The display is roughly split into two portions, the top status window and the
  400. bottom scrolling log window.
  401. STATUS WINDOW
  402. The status window is split into overall status and per device status.
  403. Overall status:
  404. The output line shows the following:
  405. (5s):2.469T (1m):2.677T (5m):2.040T (15m):1.014T (avg):2.733Th/s
  406. These are exponentially decaying average hashrates over 5s/1m/5m/15m and an
  407. average since the start.
  408. Followed by:
  409. A:290391 R:5101 HW:145 WU:37610.4/m
  410. Each column is as follows:
  411. A: The total difficulty of Accepted shares
  412. R: The total difficulty of Rejected shares
  413. HW: The number of HardWare errors
  414. WU: The Work Utility defined as the number of diff1 shares work / minute
  415. (accepted or rejected).
  416. alternating with:
  417. ST: 22 SS: 0 NB: 2 LW: 356090 GF: 0 RF: 0
  418. ST is STaged work items (ready to use).
  419. SS is Stale Shares discarded (detected and not submitted so don't count as rejects)
  420. NB is New Blocks detected on the network
  421. LW is Locally generated Work items
  422. GF is Getwork Fail Occasions (server slow to provide work)
  423. RF is Remote Fail occasions (server slow to accept work)
  424. Followed by:
  425. Connected to pool.com diff 3.45K with stratum as user me
  426. The diff shown is the current vardiff requested by the pool currently being
  427. mined at.
  428. Followed by:
  429. Block: ca0d237f... Diff:5.01G Started: [00:14:27] Best share: 1.18M
  430. This shows a short stretch about the current block, when the new block started,
  431. and the all time best difficulty share you've found since starting cgminer
  432. this time.
  433. Per device status:
  434. 6: HFS Random : 645MHz 85C 13% 0.79V | 2.152T / 1.351Th/s
  435. Each column is as follows:
  436. Temperature (if supported)
  437. Fanspeed (if supported)
  438. Voltage (if supported)
  439. A 5 second exponentially decaying average hash rate
  440. An all time average hash rate
  441. alternating with
  442. 6: HFS Random : 645MHz 86C 13% 0.80V | A:290348 R:1067 HW:88 WU:18901.8/m
  443. The total difficulty of accepted shares
  444. The total difficulty of rejected shares
  445. The number of hardware erorrs
  446. The work utility defined as the number of diff1 shares work / minute
  447. LOG WINDOW
  448. All running information is shown here, usually share submission results and
  449. block update notifications, along with device messages and warnings.
  450. [2014-03-29 00:24:09] Accepted 1397768d Diff 3.35K/2727 HFS 0 pool 0
  451. [2014-03-29 00:24:13] Stratum from pool 0 detected new block
  452. ---
  453. MULTIPOOL
  454. FAILOVER STRATEGIES WITH MULTIPOOL:
  455. A number of different strategies for dealing with multipool setups are
  456. available. Each has their advantages and disadvantages so multiple strategies
  457. are available by user choice, as per the following list:
  458. FAILOVER:
  459. The default strategy is failover. This means that if you input a number of
  460. pools, it will try to use them as a priority list, moving away from the 1st
  461. to the 2nd, 2nd to 3rd and so on. If any of the earlier pools recover, it will
  462. move back to the higher priority ones.
  463. ROUND ROBIN:
  464. This strategy only moves from one pool to the next when the current one falls
  465. idle and makes no attempt to move otherwise.
  466. ROTATE:
  467. This strategy moves at user-defined intervals from one active pool to the next,
  468. skipping pools that are idle.
  469. LOAD BALANCE:
  470. This strategy sends work to all the pools on a quota basis. By default, all
  471. pools are allocated equal quotas unless specified with --quota. This
  472. apportioning of work is based on work handed out, not shares returned so is
  473. independent of difficulty targets or rejected shares. While a pool is disabled
  474. or dead, its quota is dropped until it is re-enabled. Quotas are forward
  475. looking, so if the quota is changed on the fly, it only affects future work.
  476. If all pools are set to zero quota or all pools with quota are dead, it will
  477. fall back to a failover mode. See quota below for more information.
  478. The failover-only flag has special meaning in combination with load-balance
  479. mode and it will distribute quota back to priority pool 0 from any pools that
  480. are unable to provide work for any reason so as to maintain quota ratios
  481. between the rest of the pools.
  482. BALANCE:
  483. This strategy monitors the amount of difficulty 1 shares solved for each pool
  484. and uses it to try to end up doing the same amount of work for all pools.
  485. ---
  486. QUOTAS
  487. The load-balance multipool strategy works off a quota based scheduler. The
  488. quotas handed out by default are equal, but the user is allowed to specify any
  489. arbitrary ratio of quotas. For example, if all the quota values add up to 100,
  490. each quota value will be a percentage, but if 2 pools are specified and pool0
  491. is given a quota of 1 and pool1 is given a quota of 9, pool0 will get 10% of
  492. the work and pool1 will get 90%. Quotas can be changed on the fly by the API,
  493. and do not act retrospectively. Setting a quota to zero will effectively
  494. disable that pool unless all other pools are disabled or dead. In that
  495. scenario, load-balance falls back to regular failover priority-based strategy.
  496. While a pool is dead, it loses its quota and no attempt is made to catch up
  497. when it comes back to life.
  498. To specify quotas on the command line, pools should be specified with a
  499. semicolon separated --quota(or -U) entry instead of --url. Pools specified with
  500. --url are given a nominal quota value of 1 and entries can be mixed.
  501. For example:
  502. --url poola:porta -u usernamea -p passa --quota "2;poolb:portb" -u usernameb -p passb
  503. Will give poola 1/3 of the work and poolb 2/3 of the work.
  504. Writing configuration files with quotas is likewise supported. To use the above
  505. quotas in a configuration file they would be specified thus:
  506. "pools" : [
  507. {
  508. "url" : "poola:porta",
  509. "user" : "usernamea",
  510. "pass" : "passa"
  511. },
  512. {
  513. "quota" : "2;poolb:portb",
  514. "user" : "usernameb",
  515. "pass" : "passb"
  516. }
  517. ]
  518. ---
  519. SOLO MINING
  520. Solo mining can be done efficiently as a single pool entry or a backup to
  521. any other pooled mining and it is recommended everyone have solo mining set up
  522. as their final backup in case all their other pools are DDoSed/down for the
  523. security of the network. To enable solo mining, one must be running a local
  524. bitcoind/bitcoin-qt or have one they have rpc access to. To do this, edit your
  525. bitcoind configuration file (bitcoin.conf) with the following extra lines,
  526. using your choice of username and password:
  527. rpcuser=username
  528. rpcpassword=password
  529. Restart bitcoind, then start cgminer, pointing to the bitcoind and choose a
  530. btc address with the following options, altering to suit their setup:
  531. cgminer -o http://localhost:8332 -u username -p password --btc-address 15qSxP1SQcUX3o4nhkfdbgyoWEFMomJ4rZ
  532. ---
  533. LOGGING
  534. cgminer will log to stderr if it detects stderr is being redirected to a file.
  535. To enable logging simply add 2>logfile.txt to your command line and logfile.txt
  536. will contain the logged output at the log level you specify (normal, verbose,
  537. debug etc.)
  538. In other words if you would normally use:
  539. ./cgminer -o xxx -u yyy -p zzz
  540. if you use
  541. ./cgminer -o xxx -u yyy -p zzz 2>logfile.txt
  542. it will log to a file called logfile.txt and otherwise work the same.
  543. There is also the -m option on linux which will spawn a command of your choice
  544. and pipe the output directly to that command.
  545. The WorkTime details 'debug' option adds details on the end of each line
  546. displayed for Accepted or Rejected work done. An example would be:
  547. <-00000059.ed4834a3 M:X D:1.0 G:17:02:38:0.405 C:1.855 (2.995) W:3.440 (0.000) S:0.461 R:17:02:47
  548. The first 2 hex codes are the previous block hash, the rest are reported in
  549. seconds unless stated otherwise:
  550. The previous hash is followed by the getwork mode used M:X where X is one of
  551. P:Pool, T:Test Pool, L:LP or B:Benchmark,
  552. then D:d.ddd is the difficulty required to get a share from the work,
  553. then G:hh:mm:ss:n.nnn, which is when the getwork or LP was sent to the pool and
  554. the n.nnn is how long it took to reply,
  555. followed by 'O' on it's own if it is an original getwork, or 'C:n.nnn' if it was
  556. a clone with n.nnn stating how long after the work was recieved that it was cloned,
  557. (m.mmm) is how long from when the original work was received until work started,
  558. W:n.nnn is how long the work took to process until it was ready to submit,
  559. (m.mmm) is how long from ready to submit to actually doing the submit, this is
  560. usually 0.000 unless there was a problem with submitting the work,
  561. S:n.nnn is how long it took to submit the completed work and await the reply,
  562. R:hh:mm:ss is the actual time the work submit reply was received
  563. If you start cgminer with the --sharelog option, you can get detailed
  564. information for each share found. The argument to the option may be "-" for
  565. standard output (not advisable with the ncurses UI), any valid positive number
  566. for that file descriptor, or a filename.
  567. To log share data to a file named "share.log", you can use either:
  568. ./cgminer --sharelog 50 -o xxx -u yyy -p zzz 50>share.log
  569. ./cgminer --sharelog share.log -o xxx -u yyy -p zzz
  570. For every share found, data will be logged in a CSV (Comma Separated Value)
  571. format:
  572. timestamp,disposition,target,pool,dev,thr,sharehash,sharedata
  573. For example (this is wrapped, but it's all on one line for real):
  574. 1335313090,reject,
  575. ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000,
  576. http://localhost:8337,ASC0,0,
  577. 6f983c918f3299b58febf95ec4d0c7094ed634bc13754553ec34fc3800000000,
  578. 00000001a0980aff4ce4a96d53f4b89a2d5f0e765c978640fe24372a000001c5
  579. 000000004a4366808f81d44f26df3d69d7dc4b3473385930462d9ab707b50498
  580. f681634a4f1f63d01a0cd43fb338000000000080000000000000000000000000
  581. 0000000000000000000000000000000000000000000000000000000080020000
  582. ---
  583. BENCHMARK
  584. The --benchmark option hashes a single fixed work item over and over and does
  585. not submit shares to any pools.
  586. The --benchfile <arg> option hashes the work given in the file <arg> supplied.
  587. The format of the work file is:
  588. version,merkleroot,prevhash,diffbits,noncetime
  589. Any empty line or any line starting with '#' or '/' is ignored.
  590. When it reaches the end of the file it continues back at the top.
  591. The format of the data items matches the byte ordering and format of the
  592. the bitcoind getblock RPC output.
  593. An example file containing bitcoin block #1 would be:
  594. # Block 1
  595. 1,0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098,00000000001
  596. 9d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f,1d00ffff,1231469665
  597. However, the work data should be one line without the linebreak in the middle
  598. If you use --benchfile <arg>, then --benchfile-display will output a log line,
  599. for each nonce found, showing the nonce value in decimal and hex and the work
  600. used to find it in hex.
  601. ---
  602. RPC API
  603. For RPC API details see the API-README file
  604. ---
  605. FAQ
  606. Q: I have multiple USB stick devices but I can't get them all to work at once?
  607. A: Very few USB hubs deliver the promised power required to run as many devices
  608. as they fit if all of them draw power from USB.
  609. Q: I've plugged my devices into my USB hub but nothing shows up?
  610. A: RPis and Windows have incomplete or non-standard USB3 support so they may
  611. never work. It may be possible to get a USB3 hub to work by plugging it into
  612. a USB2 hub. When choosing a hub, USB2 hubs are preferable whenever possible
  613. due to better support all round.
  614. Q: Can I mine on servers from different networks (eg xxxcoin and bitcoin) at
  615. the same time?
  616. A: No, cgminer keeps a database of the block it's working on to ensure it does
  617. not work on stale blocks, and having different blocks from two networks would
  618. make it invalidate the work from each other.
  619. Q: Can I configure cgminer to mine with different login credentials or pools
  620. for each separate device?
  621. A: No.
  622. Q: Can I put multiple pools in the config file?
  623. A: Yes, check the example.conf file. Alternatively, set up everything either on
  624. the command line or via the menu after startup and choose settings->write
  625. config file and the file will be loaded one each startup.
  626. Q: The build fails with gcc is unable to build a binary.
  627. A: Remove the "-march=native" component of your CFLAGS as your version of gcc
  628. does not support it. Also -O2 is capital o 2, not zero 2.
  629. Q: Can you implement feature X?
  630. A: I can, but time is limited, and people who donate are more likely to get
  631. their feature requests implemented.
  632. Q: Work keeps going to my backup pool even though my primary pool hasn't
  633. failed?
  634. A: Cgminer checks for conditions where the primary pool is lagging and will
  635. pass some work to the backup servers under those conditions. The reason for
  636. doing this is to try its absolute best to keep the devices working on something
  637. useful and not risk idle periods. You can disable this behaviour with the
  638. option --failover-only.
  639. Q: Is this a virus?
  640. A: Cgminer is being packaged with other trojan scripts and some antivirus
  641. software is falsely accusing cgminer.exe as being the actual virus, rather
  642. than whatever it is being packaged with. If you installed cgminer yourself,
  643. then you do not have a virus on your computer. Complain to your antivirus
  644. software company. They seem to be flagging even source code now from cgminer
  645. as viruses, even though text source files can't do anything by themself.
  646. Q: Can you modify the display to include more of one thing in the output and
  647. less of another, or can you change the quiet mode or can you add yet another
  648. output mode?
  649. A: Everyone will always have their own view of what's important to monitor.
  650. The defaults are very sane and I have very little interest in changing this
  651. any further. There is far more detail in the API output than can be reasonably
  652. displayed on the small console window, and using an external interface such
  653. as miner.php is much more useful for setups with many devices.
  654. Q: What are the best parameters to pass for X pool/hardware/device.
  655. A: Virtually always, the DEFAULT parameters give the best results. Most user
  656. defined settings lead to worse performance.
  657. Q: What happened to CPU and GPU mining?
  658. A: Their efficiency makes them irrelevant in the bitcoin mining world today
  659. and the author has no interest in supporting alternative coins that are better
  660. mined by these devices.
  661. Q: GUI version?
  662. A: No. The RPC interface makes it possible for someone else to write one
  663. though.
  664. Q: I'm having an issue. What debugging information should I provide?
  665. A: Start cgminer with your regular commands and add -D -T --verbose and provide
  666. the full startup output and a summary of your hardware and operating system.
  667. Q: Why don't you provide win64 builds?
  668. A: Win32 builds work everywhere and there is precisely zero advantage to a
  669. 64 bit build on windows.
  670. Q: Is it faster to mine on windows or linux?
  671. A: It makes no difference in terms of performance. It comes down to choice of
  672. operating system for their various features and your comfort level. However
  673. linux is the primary development platform and is virtually guaranteed to be
  674. more stable.
  675. Q: My network gets slower and slower and then dies for a minute?
  676. A; Try the --net-delay option if you are on a getwork or GBT server.
  677. Q: How do I tune for p2pool?
  678. A: It is also recommended to use --failover-only since the work is effectively
  679. like a different block chain, and not enabling --no-submit-stale. If mining with
  680. a BFL (fpga) minirig, it is worth adding the --bfl-range option.
  681. Q: I run PHP on windows to access the API with the example miner.php. Why does
  682. it fail when php is installed properly but I only get errors about Sockets not
  683. working in the logs?
  684. A: http://us.php.net/manual/en/sockets.installation.php
  685. Q: What is a PGA?
  686. A: At the moment, cgminer supports 3 FPGAs: BitForce, Icarus and ModMiner.
  687. They are Field-Programmable Gate Arrays that have been programmed to do Bitcoin
  688. mining. Since the acronym needs to be only 3 characters, the "Field-" part has
  689. been skipped.
  690. Q: What is an ASIC?
  691. A: They are Application Specify Integrated Circuit devices and provide the
  692. highest performance per unit power due to being dedicated to only one purpose.
  693. Q: What is stratum and how do I use it?
  694. A: Stratum is a protocol designed for pooled mining in such a way as to
  695. minimise the amount of network communications, yet scale to hardware of any
  696. speed. With versions of cgminer 2.8.0+, if a pool has stratum support, cgminer
  697. will automatically detect it and switch to the support as advertised if it can.
  698. If you input the stratum port directly into your configuration, or use the
  699. special prefix "stratum+tcp://" instead of "http://", cgminer will ONLY try to
  700. use stratum protocol mining. The advantages of stratum to the miner are no
  701. delays in getting more work for the miner, less rejects across block changes,
  702. and far less network communications for the same amount of mining hashrate. If
  703. you do NOT wish cgminer to automatically switch to stratum protocol even if it
  704. is detected, add the --fix-protocol option.
  705. Q: Why don't the statistics add up: Accepted, Rejected, Stale, Hardware Errors,
  706. Diff1 Work, etc. when mining greater than 1 difficulty shares?
  707. A: As an example, if you look at 'Difficulty Accepted' in the RPC API, the number
  708. of difficulty shares accepted does not usually exactly equal the amount of work
  709. done to find them. If you are mining at 8 difficulty, then you would expect on
  710. average to find one 8 difficulty share, per 8 single difficulty shares found.
  711. However, the number is actually random and converges over time, it is an average,
  712. not an exact value, thus you may find more or less than the expected average.
  713. Q: My keyboard input momentarily pauses or repeats keys every so often on
  714. windows while mining?
  715. A: The USB implementation on windows can be very flaky on some hardware and
  716. every time cgminer looks for new hardware to hotplug it it can cause these
  717. sorts of problems. You can disable hotplug with:
  718. --hotplug 0
  719. Q: What should my Work Utility (WU) be?
  720. A: Work utility is the product of hashrate * luck and only stabilises over a
  721. very long period of time. Assuming all your work is valid work, bitcoin mining
  722. should produce a work utility of approximately 1 per 71.6MH. This means at
  723. 5GH you should have a WU of 5000 / 71.6 or ~ 69. You cannot make your machine
  724. do "better WU" than this - it is luck related. However you can make it much
  725. worse if your machine produces a lot of hardware errors producing invalid work.
  726. ---
  727. This code is provided entirely free of charge by the programmer in his spare
  728. time so donations would be greatly appreciated. Please consider donating to the
  729. address below.
  730. Con Kolivas <kernel@kolivas.org>
  731. 15qSxP1SQcUX3o4nhkfdbgyoWEFMomJ4rZ