Setting up a dogecoin node for heavy transactions and mining. Part 2
Join the livestream here https://www.youtube.com/watch?v=8sQEm-ySDmU
Let's finally begin our solo mining
now that we've downloaded the entire dogecoin blockchain to our computer.
First we're going to need to configure our dogecoin core to listen for miners.
We can start by using the example dogecoin.conf found on github here.
copy all lines of that configuration file and paste them into a text editor.
Now we're going to remove comments on certain settings we need to run a node/server to mine from. These are the lines we want to remove the '#' comment symbol from.
listen=1
server=1
rpcuser=makeusernamehere
rpcpassword=makepwhere
rpcport=22555
I like those settings because it tells Dogecoin Core to listen for rpc connections and that is IS a node server. The rpcuser and pass should be something unique so that nobody can control your wallet. The rpc port helps us tell the miner which socket to connect with over tcp. Now we're getting into some pretty scientific stuff so I'm trying to explain while still breaking it down.
Anyway after you've removed those comments it's time to save your dogecoin.conf file. The default place listed for this in Linux is '~\home\.dogecoin\dogecoin.conf' While Windows is something like "%appdata%/Roaming/dogecoin/dogecoin.conf. Since I didn't want my blockchain to download to my main computer drive, my folder location is unique.
After you've created this dogecoin.conf file and placed it in your wallet home folder you can restart Dogecoin Core.
There's a few miners we can try to see which rates are better.
For CPU mining you can use 'cpuminer'
So far, cpuminer seems to be the easiest to use, even though it has less documentation it IS pretty straight forward. Since the website for cpuminer is already hosting binaries we don't have to compile the software either! Go ahead and download cpuminer and place it anywhere on your computer.
Now we can call it from a terminal (Linux) or a command line (M$ Windows)
So I go
./minerd
And it says :
./minerd: no URL supplied
Try `minerd --help' for more information.
Ok then lets run the --help argument
./minerd --help
Usage: minerd [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
-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)
-T, --timeout=N timeout for long polling, in seconds (default: none)
-s, --scantime=N upper bound on time spent scanning current work when
long polling is unavailable, in seconds (default: 5)
--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-redirect ignore requests to change the URL of the mining server
-q, --quiet disable per-thread hashmeter 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
-c, --config=FILE load a JSON-format configuration file
-V, --version display version information and exit
-h, --help display this help text and exit
This help output tells me that if I run minerd with arguments, it should connect and start working. So lastly I try this
./minerd --url=127.0.0.1:22555 --userpass=youruser:yourpasswerd --threads=1 --coinbase-addr=DJBTA9fBr6x7Nt1vAmdmvUELEKb3pWHC5k
Breakdown of the minerd arguments chosen: The computer you are using is known as 'localhost' and will always have the IP of 127.0.0.1 within the network interface. If you have a node on your LAN and want to mine from that you would put its LAN IP there instead. For example, I could now mine from my 40 core computer to this node without downloading the entire blockchain to another computer on the same network. The user and pass are what we decided in our dogecoin.conf file. Notice how I used my dogecoin core address for the --coinbase-addr argument. If the computer verifies any blocks I will get a reward sent to my wallet.
Now let's see how fast it mines! Here's a look at the output with those arguments.
:~$'/mnt/usb-Generic-_SD_MMC_MS_PRO/Downloads/minerd' --url=127.0.0.1:22555 --userpass=youruserhere:yourpasshere --threads=1 --coinbase-addr=DJBTA9fBr6x7Nt1vAmdmvUELEKb3pWHC5k
[2021-03-10 13:52:43] 1 miner threads started, using 'scrypt' algorithm.
[2021-03-10 13:52:43] Long-polling activated for http://127.0.0.1:22555
[2021-03-10 13:52:44] thread 0: 4104 hashes, 4.74 khash/s
You can see that while the computer is at an idle it mines an average of 2.5 khash/s. So, in the scrypt algorithm it's guessing about 2 and a half thousand possible cryptographic hashes every second in hopes of confirming a transaction in the dogecoin blockchain for a reward. Sometimes if I'm not using the computer to do other work it will idle around 4.10 khash/s.
That's all there is to CPU mining your very own dogecoin node! However, there's still more hardware in the computer that can help the hash rate increase to further aid the dogecoin network. After all, if you have a higher hash rate you're more likely to verify blocks and get rewards.
GPU Mining with CGMiner
Now for the more complicated part. For the GPU we're going to use CGminer. In order to use CGMiner you need the proprietary drivers for your graphics card or APU chipset.
Personally, I like CGminer because it works with several ASIC hardware devices and also utilizes your GPU. Most importantly, cgminer comes with a README featuring clear instructions and is a bit less vague than CPUminer.
You'll need download the latest version of cgminer and compile it. Look within the readme file for compile instructions. It was pretty straight forward with Linux.
Download & Extract CGMiner
Since I use Linux Mint I had to apt-get install some compilers and libraries in order to proceed. Here is an excerpt from the README that is linked above.
If building from git: autoconf automake If building on Ubuntu: sudo apt-get install build-essential autoconf automake libtool pkg-config \ libcurl4-openssl-dev libudev-dev libusb-1.0-0-dev \ libncurses5-dev
After installing the dependencies to build cgminer, I extract the downloaded archive (link above) and run a terminal in that folder. Here is a full length video showing step by step how to compile and use the program.
Don't worry if you see errors in the compile process because those are just outputs of the program missing certain arguments. This is more of a feature than an overall error in making the cgminer program. For what we are doing a 'vanilla' compile will be fine because we don't have any ASIC or special mining hardware.
Others who are using Windows or Mac OS will want to reference the cgminer README.
Basic *nix build instructions:
To actually build:
./autogen.sh # only needed if building from git repo
CFLAGS="-O2 -Wall -march=native" ./configure <options>
make
No installation is necessary. You may run cgminer from the build
directory directly, but you may do make install if you wish to install
cgminer to a system location or location you specified.
Building for windows:
It is actually easiest to build a windows binary using cross compilation tools
provided by "mxe" available at http://mxe.cc/ (use the 32 bit one!)
Once you have followed the instructions for building mxe:
export PATH=(path/to/mxe)/usr/bin/:$PATH
CFLAGS="-O2 -Wall -W -march=i686" ./configure --host=i686-pc-mingw32 <options>
make
Native WIN32 build instructions: see windows-build.txt but these instructions
are now hopelessly out of date.
Click here for how to compile CGminer for Windows
For Linux:
Open your terminal app in the directory you extracted cgminer to and type
./configure
then after that finishes run
Ok you should have a fully compiled cgminer after a few minutes that you can call with this instruction
./cgminer
Once you call ./cgminer it will ask you which host. Since we're mining our local node we want to enter 'localhost'. Here you will also enter your node rpc details and wallet address to collect your mining rewards. In most cases, it doesn't matter what you make the username and password but you will want to make sure you use a good wallet address.
Pool Mining
Pool mining is where you team up with other miners to uncover the block. Once any member of the dogecoin crypto pool gets a verified share (and uncovers the block) the block reward then gets shared with the entire pool of dogecoin miners. This is a good way to consistently get paid coins while mining but is much less of a lottery.
Try the unmineable miner today
https://unmineable.com/?ref=crjc-d4am
One thing that I like about the unmineable miner is that you can acquire Dogecoin and hard to get tokens like BTT and WIN. Since this unmineable miner help you obtain coins that you can't purchase in an exchange it becomes worth the extra power costs.
I highly recommend this miner if you want to do pool mining.
Just follow the above link and click 'download'. Once you're there choose the PACKED version because it includes extra miners.
After that just extract the exe to your desktop and run it. You will be asked which coin you want to mine and the address. Select doge and put your receiving address in.
So now we've covered all our bases! We have a full doge node and a miner program to aid the dogecoin network. This setup definitely will not use enough power to make a dent on my electricity bill while still mining the dogecoin blockchain. If you found this guide useful and would like more please tip some doge to address DJBTA9fBr6x7Nt1vAmdmvUELEKb3pWHC5k You can also use the QR code shown below.
Comments
Post a Comment