gominer is an application for performing Proof-of-Work (PoW) mining on the Decred network after the activation of DCP0011 using BLAKE3. It supports solo and stratum/pool mining using OpenCL and CUDA devices.
Binaries are not currently available. See the Building
(Windows, Linux) section for details on how to build
gominer
from source.
gominer
gominer
needs to acquire work in order to have something to solve. Currently, the only supported method is solo mining via a dcrd
RPC server. There are plans to support dcrpool for pooled mining in the future.
In order to communicate with the dcrd
RPC server, gominer
must be configured
with dcrd
's RPC server credentials.
rpcuser
and rpcpass
entries in the dcrd.conf
file
%LOCALAPPDATA%\Dcrd\dcrd.conf
~/.dcrd/dcrd.conf
~/Library/Application Support/Dcrd/dcrd.conf
gominer.conf
file at the platform-specific path that contains the
exact same rpcuser=
and rpcpass=
lines you obtained from the
dcrd.conf
file in the previous step
%LOCALAPPDATA%\Gominer\gominer.conf
~/.gominer/gominer.conf
~/Library/Application Support/Gominer/gominer.conf
gominer.conf
config file should have at least the following lines:
rpcuser=<same rpcuser from dcrd.conf>
rpcpass=<same rpcpass from dcrd.conf>
Next, dcrd
must be configured with a mining address to send the payment for
mined blocks. That is accomplished by either launching dcrd
with the
--miningaddr=Ds...
CLI flag or adding a miningaddr=Ds...
to the
aforementioned dcrd.conf
file and restarting dcrd
.
gominer
provides a benchmark mode where no work is submitted in order to test
your setup.
gominer -B
Ensure you have configured gominer
with dcrd
's RPC
credentials as well as dcrd
with a miningaddr
. Once the credentials and
mining address have been configured, simply run gominer to begin mining.
gominer
The username for pools running dcrpool is
the payment address for receiving rewards and a unique name identifying the
client formatted as address.name
.
Run the following command replacing the pooldomain:port
with the appropriate
domain name and port of the desired pool to connect to and the address.name
as previously described:
gominer --pool stratum+tcp://pooldomain:port --pooluser address.name
There is no other known pool software aside from
dcrpool, that supports the latest Decred
consensus rules at the current time. However, as long as the pool software
supports the stratum protocol with the same semantics implemented by dcrpool
,
the following command should serve as a starting point:
gominer --pool stratum+tcp://pooldomain:port --pooluser username --poolpass password
There is a built-in status API to report miner information. You can set an
address and port with --apilisten
. There are configuration examples on
sample-gominer.conf. If no port is specified, then it
will listen by default on 3333
.
Example usage:
$ gominer --apilisten="localhost"
Example output:
$ curl http://localhost:3333/
> {
"validShares": 0,
"staleShares": 0,
"invalidShares": 0,
"totalShares": 0,
"sharesPerMinute": 0,
"started": 1504453881,
"uptime": 6,
"devices": [{
"index": 2,
"deviceName": "GeForce GT 750M",
"deviceType": "GPU",
"hashRate": 110127366.53846154,
"hashRateFormatted": "110MH/s",
"fanPercent": 0,
"temperature": 0,
"started": 1504453880
}],
"pool": {
"started": 1504453881,
"uptime": 6
}
}
Gominer works with OpenCL (both AMD and NVIDIA) and CUDA (NVIDIA only). At the current time, most users have reported that OpenCL gives them higher hashrates on NVIDIA.
Once you decide on OpenCL or CUDA, you will need to install the graphics driver for your GPU as well as the headers for OpenCL or CUDA depending on your choice.
The exact packages are dependent on the specific Linux distribution, but, generally speaking, you will need the latest AMDGPU-PRO display drivers for AMD cards and the latest NVIDIA graphics display drivers for NVIDIA cards. Then, depending on whether you will build the OpenCL or CUDA version, the specific set of toolsets, headers and libraries will have to be installed.
For OpenCL, the packages are typically named something similar to
mesa-opencl-dev
(for AMD) or nvidia-opencl-dev
(for NVIDIA).
If you're using OpenCL, it is also recommended to install your distribution's
equivalent of the clinfo
package if you have any issues to ensure your device
can be detected by OpenCL. When clinfo
is unable to detect your device,
gominer
will not be able to either.
For CUDA, on distributions where it is available via the standard package
manager, the required files are usually found as nvidia-cuda-toolkit
. NVIDIA
also provides its own CUDA Toolkit
downloads.
The following sections provide instructions for building various combinations
of gominer
:
This section provides instructions for building gominer
on a computer with an
NVIDIA graphics card running Ubuntu 23.04. Both OpenCL and CUDA build
instructions are provided.
The following steps are applicable for both OpenCL and CUDA builds of gominer
:
ubuntu-drivers devices
sudo ubuntu-drivers autoinstall
sudo apt install nvidia-driver-525-server
git
and go
sudo apt install git golang
sudo reboot
gominer
source code
git clone https://github.com/decred/gominer
gominer
forsudo apt install nvidia-opencl-dev
gominer
cd gominer
go build -tags opencl
gominer
detects your GPU(s)
./gominer -l
gominer
sudo apt install nvidia-cuda-toolkit
gominer
:
cd gominer
go generate -tags cuda .
gominer
detects your GPU(s):
./gominer -l
gominer
This section provides instructions for building gominer
on a computer running
Debian bookworm. Both OpenCL (using either AMD or NVIDIA graphics cards)
and CUDA (NVIDIA graphics cards only) build instructions are provided.
/etc/apt/sources.list
and appending contrib non-free
to the
deb
repository
$EDITOR /etc/apt/sources.list
deb http://ftp.us.debian.org/debian bookworm-updates main contrib non-free
deb http://security.debian.org bookworm-security main contrib non-free
sudo apt update
git
and go
:
sudo apt install git golang
gominer
source code
git clone https://github.com/decred/gominer
Proceed to install the appropriate graphics card driver and supporting firmware, based on the hardware available on the computer:
sudo apt install firmware-linux firmware-linux-nonfree libdrm-amdgpu1 xserver-xorg-video-amdgpu
sudo apt install nvidia-driver
gominer
forThis build mode supports both AMD and NVIDIA graphics cards.
sudo apt install opencl-headers mesa-opencl-icd ocl-icd-libopencl1
ln -s /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 /usr/lib/libOpenCL.so
gominer
cd gominer
go build -tags opencl
gominer
detects your GPU(s)
./gominer -l
gominer
Note that this requires having an NVIDIA graphics card installed on the computer.
sudo apt install nvidia-cuda-toolkit
gominer
:
cd gominer
go generate -tags cuda .
gominer
detects your GPU(s):
./gominer -l
gominer
Gominer works with OpenCL (both AMD and NVIDIA) and CUDA (NVIDIA only).
At the current time, most users have reported that OpenCL gives them higher
hashrates on NVIDIA. Additionally, building the CUDA-enabled version of
gominer
on Windows is a much more involved process. For these reasons, unless
you really want to run the CUDA version for a specific reason, it is recommended
to use OpenCL.
The following steps are applicable for both OpenCL and CUDA builds of gominer
:
Run MSYS2 now.
MSYS2 MINGW64
shell from the start menu
MSYS2
installer will launch the UCRT64
shell by default if
you didn't uncheck Run MSYS2 now
as instructed. That shell will not work,
so close it if you forgot to uncheck it in the installer.MSYS2 MINGW64
shell enter the following commands to install
gcc
, git
, go
, unzip
:
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-tools mingw-w64-x86_64-go git unzip
git clone https://github.com/decred/gominer
MSYS2 MINGW64
shell and relaunch it
gominer
forThe following is needed when performing an OpenCL build:
MSYS2 MINGW64
shell enter the following commands to install
the light OpenCL SDK:
wget https://github.com/GPUOpen-LibrariesAndSDKs/OCL-SDK/files/1406216/lightOCLSDK.zip
unzip -d /c/appsdk lightOCLSDK.zip
cd /c/appsdk/lib/x86_64
cp /c/Windows/SysWOW64/atiadlxx.dll .
gendef atiadlxx.dll
dlltool --output-lib libatiadlxx.a --input-def atiadlxx.def
cd ~/gominer
go build -tags opencl
gominer
detects your GPU(s)
./gominer -l
gominer
cd ~/gominer
go build -tags opencl
gominer
detects your GPU(s)
./gominer -l
gominer
Building the CUDA-enabled gominer
on a Windows platform is tricky, requires
several GB worth of downloads and while we have made attempts at detecting the
necessary tools and automating the building process, it is not guaranteed to
work, in particular as newer or older versions of the various tools are
installed.
This guide has been tested on a Windows 10 machine, with an NVIDIA graphics card
installed, using Microsoft Visual Studio Community Edition 2022 and NVIDIA CUDA
Toolkit version 12.2. If the automatic builder for gominer
does not work on
your system, you many need to manually setup the various
tools.
After fulfilling the Windows prerequisites, follow the following instructions:
go generate -tags cuda .
gominer
detects your GPU(s):
./gominer -l
gominer
GPU | Hashrate |
---|---|
NVIDIA GTX 1060 | 3.0 Gh/s |
AMD RX 580 | 3.7 Gh/s |
NVIDIA 1660 Super | 5.0 Gh/s |
AMD Vega 56 | 7.0 Gh/s |
NVIDIA RTX 3060 Ti | 8.7 Gh/s |
NVIDIA GTX 3080 Mobile | 9.4 Gh/s |
NVIDIA RTX 3070 | 10.1 Gh/s |
NVIDIA RTX 2080 | 10.4 Gh/s |
NVIDIA Tesla V100 | 13.9 Gh/s |
NVIDIA Tesla V100S | 14.6 Gh/s |
NVIDIA RTX 4070 | 14.9 Gh/s |
NVIDIA RTX 3080 | 15.2 Gh/s |
NVIDIA RTX 3090 | 17.6 Gh/s |
AMD 7900 XTX | 23.8 Gh/s |