I’ve done Crypto mining before and since the price is now almost all time high I’ll do that again, but only with my solar energy. Mining with dirty coal power isn’t ethical any more as the climate change has accelerated in the past few years.
To start ETH mining here are some prerequisites:
- Energy efficient video cards, in this case I got RTX 3070. 3060TI is also a good choice but it was sold out already
- A desktop computer where you can attach multiple video cards to PCI express slots. But I’m not focusing hardware installation here, ie. not showing how to install the card and connect cables, etc.
- My OS is Ubuntu 20.04 so I choose t-rex miner which has better support for Nvidia Ampere architecture. The releases can be found here
Here are the steps with which I set up t-rex miner on my Ubuntu 20.04 desktop:
# as root user sudo -i # install nvidia 460 driver for Ubuntu apt install nvidia-driver-460 # install t-rex to /opt/t-rex mkdir /opt/t-rex wget https://github.com/trexminer/T-Rex/releases/download/0.19.9/t-rex-0.19.9-linux-cuda11.1.tar.gz tar -zxvf t-rex-0.19.9-linux-cuda11.1.tar.gz -C /opt/t-rex # change ownership for security reasons chown -R nobody:nogroup /opt/t-rex
Now in directory
/opt/t-rex there are many shell script(.sh) files. I was using ethermine.org so I had a look at
ETH-ethermine.sh, it has:
#!/bin/sh ./t-rex -a ethash -o stratum+tcp://eu1.ethermine.org:4444 -u <ETH wallet address> -p x -w <worker name>
Since I’m proudly an experienced Linux user, I choose to create a systemd service out of that shell script:
# cat /etc/systemd/system/ethminer.service [Unit] Description=Ethereum Miner [Service] Type=simple User=nobody ExecStart=/opt/t-rex/t-rex -a ethash -o stratum+tcp://us2.ethermine.org:4444 -u <my ETH wallet address> -p "" -w <my worker name, can be hostname> Restart=on-failure [Install] WantedBy=multi-user.target
You might want to change the endpoint to asia1/eu1, whichever is geographically closer. The user is set to nobody so it won’t cause harm to my system if it wants to. Then the service can be enabled and started with
# reload systemd as a new service is added # following commands run as root user systemctl daemon-reload # enable the service so it starts automatically systemctl enable ethminer # start the service systemctl start ethminer # check status systemctl status -l ethminer # watch the logs journalctl -f |grep t-rex Jan 24 13:55:30 hostname t-rex: 20210124 13:55:30 Mining at us2.ethermine.org:4444, diff: 4.00 G ...
According to other miners online, the TDP of 3070 is better set as 50%(130W), because it can run hotter with higher wattage but won’t make it compute faster. Here’s how I use a cronjob to set TDP to 130W except when I’m playing a game(assuming I’ll stop the miner when playing some game on it).
EDIT: 115W is good enough.
# still as root user, as only root can use <code>nvidia-</code>smi command # crontab -l */10 * * * * /bin/ps -C t-rex && /usr/bin/nvidia-smi -i 0 -pl 115 2>&1 >>/var/log/nvidia.log
This can be verified in
t-rex ‘s logs
journalctl -f |grep t-rex Jan 24 13:55:30 hostname t-rex: 20210124 13:55:30 GPU #0: Gigabyte RTX 3070 - 52.07 MH/s, [T:53C, P:129W, F:60%, E:404kH/W], 1370/1370 R:0% # it's running at 129W and temperature is 53 degree and fan speed cruising at 60%
Regarding mining solely with solar energy, there can be 3 approaches:
- Switch electricity supplier to the renewable-friendly ones such as Amber, so you can use solar energy generated by community and enjoy the low wholesale price and mine crypto when the sun shines. This requires the API access supplier so you know when the energy is from renewables and cheap
- Install and use your own solar energy to mine crypto when the sun shines. This requires API access from your inverter so the miner script knows when to start mining with enough solar energy.
- Install solar and battery so it’s guaranteed to mine with your own solar energy( until the battery runs flat of course )
I’m going with the last option, an average solar system might be just as expensive as a 3090 and a Tesla PowerWall 2 for 3 3090s 🙂