Last active
September 19, 2022 08:27
-
-
Save jaidhyani/71476669c43e79887db93caadb238a92 to your computer and use it in GitHub Desktop.
Ethereum mining script (for use with systemd)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#requirements | |
# -nc | |
# -genoil's ethminer (https://github.com/Genoil/cpp-ethereum) | |
# a CUDA-compatable GPU | |
# this is obviously hacky and gross, uses hardcoded paths to personal dirs, etc | |
# but should be easily adaptable | |
ethminer="/home/jai/cpp-ethereum/build/ethminer/ethminer" | |
addr="0x000000000000000000000000000" #REPLACE WITH YOUR ETHEREUM ADDRESS | |
$ethminer -v 1 --farm-recheck 200 -U -S eth-us-west1.nanopool.org:9999 -O $addr.`hostname -s` & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wrote this to have my machine instantly go into ethmining when it boots, which should net about $70/month right now. I stop the miner whenever I want to do any work with the GPU myself, or when I boot into Windows for gaming. When I'm done, I can just restart the service or reboot the machine and it'll go right back into mining. Also logs to seashells, so I can monitor it from wherever if I want.
Here's the service file at
/lib/systemd/system/ethmine.service
:Run
sudo systemctl enable ethmine.service
to enable mining on bootsudo service ethmine stop
andsudo service ethmine start
to manually control