Advertisement
Guest User

Mining

a guest
Jan 9th, 2023
2,455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.28 KB | None | 0 0
  1. # _ _ ______ _ __ ____ _____ _ __ _____ _ _ _ _
  2. # | | | ||___ / | | / / / ___|_ _| | / /| _ || \ | (_) |
  3. # | | | | / / _ __ _ __ | |/ / / /___ | | | |/ / \ V / | \| |_| |_
  4. # | | | | / / | '__| '_ \| \ | ___ \ | | | \ / _ \ | . ` | | __|
  5. # |_| |_|./ /__| | | | | | |\ \| \_/ |_| |_| |\ \| |_| || |\ | | |_
  6. # (_) (_)\_____/_| |_| |_\_| \_/\_____/\___/\_| \_/\_____/\_| \_/_|\__|
  7. #######################################################################################################################################################
  8.  
  9. "Okay, I really want to mine Monero. How can I do that? How can I make it more efficient/profitable?"
  10.  
  11. ########################################################################################################################################################
  12.  
  13. Mining is a tricky subject to give umbrella guidance on, so I will try to cover as much as I can given my own experience and knowledge. Feel free to ask in the general if you have any questions this guide doesn't answer.
  14.  
  15. While there are several programs that can be used for mining, by far the most popular is XMRIG
  16. (pro tip: if you have a dedicated node, see how much of its resources it's regularly using. See if you can tell monerod to mine on one or two threads without effecting sync times and temps. Every little hash counts!)
  17.  
  18. You can get XMRIG in a few forms and flavors, my favorite is building it from source.
  19.  
  20. https://github.com/xmrig/xmrig
  21. (precompiled binaries can be found at https://xmrig.com/download)
  22. I compile it myself because precompiled XMRIG binaries ship with a default 1% donation to the XMRIG devs, which cannot be changed, however it can be set to 0 if you compile from source.
  23.  
  24. To get the code on your machine you can either download the .zip and unpack it or you can use git to clone it.
  25. >git clone https://github.com/xmrig/xmrig.git
  26.  
  27. The file you'd be looking for to change that value will be /src/donate.h , all you have to do is change these two lines of code:
  28.  
  29. constexpr const int kDefaultDonateLevel = 1;
  30. constexpr const int kMinimumDonateLevel = 1;
  31.  
  32. to
  33.  
  34. constexpr const int kDefaultDonateLevel = 0;
  35. constexpr const int kMinimumDonateLevel = 0;
  36.  
  37.  
  38. ******IF YOU DO THIS PLEASE PLEASE PLEASE CONSIDER SENDING THE XMRIG DEVS A LITTLE BIT OF MONERO******
  39.  
  40.  
  41. Then you can compile the code into a working version of XMRIG. The way you do this will be different depending on what OS you are using, but there is *probably* a guide out there on how to do it on whatever your machine is running.
  42. Let's assume you are following the steps I was just outlining, sitting in ~/xmrig/src/
  43. >cd .. until you are back in ~/xmrig/
  44. >Make a directory named "build" (mkdir build)
  45. >cd build
  46. >cmake ..
  47. >make
  48.  
  49. Most of the time this should work. Your new binary will be located in the ~/xmrig/build/ directory.
  50. Okay, now you have a working version of XMRIG with no dev donation, I would suggest you add it to your systems $PATH so you can run it from any directory. (linux users can just copy it to /usr/bin/ to accomplish this)
  51.  
  52. Now how to run it? Where to run it? When to run it?
  53.  
  54. >How to run it?
  55. There are two ways to instruct your miner how, where and what to mine.
  56. A config file
  57. https://xmrig.com/docs/miner/config
  58. or command line options
  59. https://xmrig.com/docs/miner/command-line-options
  60. There's no difference if you pick one over the other, just use whatever is easiest for you to set up.
  61.  
  62. This brings up the question "What pool should I mine in?"
  63.  
  64. short answer- any TOR mining pool or p2pool
  65.  
  66. long answer- Try to find a healthy middle ground between small and large pools. If any one pool has more than 15% of the total network hashrate, see what your other options are.
  67. More consistent payment is NOT the same as earning more, your rig will perform the same regardless of your pool choice, with the exception of choosing a pool that is so small it rarely ever solves blocks.
  68. Ideally pick a pool that has between 1 and 10% of the total network hashrate that has an adustable payout threshold.
  69.  
  70. On that pools website you will likely find an example config file they have neatly crafted just for you. Add in the correct values (usually wallet address and rig ID) and let it run.
  71. This pools site will likely also have a dashboard where you can plug in the address you are mining to and see all kinds of stats on your rig.
  72.  
  73. If you have a dedicated rig, I would take a good, long look at how you can strip away components to consume as little power as possible while maintaining the same hashrate and temps.
  74. Know your chips and boards- Does that CPU have integrated graphics or will you also need a cheap GPU to get a screen to display? Did you buy cheap RAM which is now kneecapping your performance?
  75. Do you REALLY need a 1TB boot drive or can you just use a $10 USB that you can make dozens of clones of? What about networking?- does your board ship with built-in WiFi or will you need some other solution?
  76. Also look into how you can add startup scripts to your dedicated rig, so XMRIG automatically runs with your specified config file or command line options whenever the machine boots up.
  77.  
  78. One simple trick to massively increase performance is using hugepages (large pages on windows)
  79. Once again the methods are different between Linux and Windows, but on Linux you can set them with
  80.  
  81. sysctl vm.nr_hugepages=(NUMBER)
  82.  
  83. (recommended number is 1280)
  84.  
  85. For windows I'd recommend this guide.
  86. https://yewtu.be/watch?v=vNltWzqwPGE
  87. You will need to run XMRIG with sudo/doas to actually utilize hugepages.
  88.  
  89. >Where/When to run it?
  90. This all depends on what machine you are using, what else it's doing, what it's capable of and how much electricity costs where you are located, but heat tends to set the pace in most cases, you want to keep your machine as cool as possible.
  91. If you can mine on 50% of the machines threads, but temps spike up to 83*c and keep climbing, you might be better off turning that device into some kind of file server or perhaps a node or dedicated wallet device. (maybe it just needs a re-paste?)
  92. Exercise extreme caution if mining on a laptop, If you can remove the battery and prop the laptop up (like a /\ shape) then you're fine, happy mining. If you cannot, I would avoid it as mining on laptops may lead to damaged hardware (battery issues, usually)
  93.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement