Cryptocurrency Mining Setup and Notes

From myWiki
Revision as of 12:19, 18 February 2020 by Stevet (talk | contribs)

Setup Ubuntu Server 16.04.3

Ethereum (geth)

sudo add-apt-repository ppa:ethereum/ethereum -y
sudo apt update
sudo apt install ethereum -y

Import ethereum key or create new account

geth account list

Uninstall AMDGPU Graphics stack

# Use this for Pro components
$ sudo amdgpu-pro-uninstall

Reboot after uninstall process completes

Install AMDGPU Pro Variant package

tar -Jxvf amdgpu-pro-19.50-NNNNNN.tar.xz
cd amdgpu-pro-19.50-NNNNNN
sudo ./amdgpu-pro-install -y --opencl=pal,legacy --headless
sudo apt install mesa-common-dev
sudo apt install clinfo

Notes:

In BIOS boot to onboard VGA first

Don't start GUI in headless (server) setup

sudo systemctl set-default multi-user.target

Make user part of video user group

sudo usermod -a -G video <userid>

Static IP Edit /etc/network/interfaces assuming enp4s0 is the ethernet interface id.

auto enp4s0
iface enp4s0 inet static 
  address 192.168.0.x
  netmask 255.255.255.0
  network 192.168.0.0
  broadcast 192.168.0.255
  gateway 192.168.0.1
  dns-nameservers 192.168.0.1 8.8.8.8 8.8.4.4

If the hostname is modified, update /etc/hostname & /etc/hosts

Problems with DHCP timeout, edit /etc/dhcp/dhcpclient.conf

timeout 15 #from 300

Ethminer

git repository download

Zcash

website

Mining

ethermine.org (ethereum & zcash)

Screen

screen    (start)
<ctl>-a d (exit) 
screen -r (reconnect)

Change default gateway temporarily

sudo ip route change default via 192.168.1.1 dev <interface>

Create the file /etc/udev/rules.d/70-persistent-net.rules with the following content

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="02:01:02:03:04:05", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="eth0"

Ethereum wallet notes:

You can use the go-ethereum libraries to generate an account

import "github.com/ethereum/go-ethereum/crypto"
import "encoding/hex"
// Create an account
key, err := crypto.GenerateKey()
// Get the address
address := crypto.PubkeyToAddress(key.PublicKey).Hex()
// 0x8ee3333cDE801ceE9471ADf23370c48b011f82a6
// Get the private key
privateKey := hex.EncodeToString(key.D.Bytes())
// 05b14254a1d0c77a49eae3bdf080f926a2df17d8e2ebdf7af941ea001481e57f