Guangjing Wang Assistant Professor @ USF

Ethminer Notes

2019-09-01

In this post, I mainly make some notes about my test for ethminer.

Ethereum Mining

  • Basic requirements: ETH mining mainly uses graphics cards for mining. Therefore you need a PC (miner) with the following equipment:

    • Graphics card, motherboard, power supply, CPU, memory (4G recommended), hard disk (60G SSD recommended), PCI-E adapter cable, etc.
    • Among them, the graphics card determines the speed of mining, and the motherboard and power supply largely determine the stability of the mining machine.
  • Wallet address: Before mining, you must prepare your own wallet address.

    • You can obtain the wallet address through local wallet software and trading platforms. The official graphic wallet address. Register an account on the trading website, and people from the mainland are recommended to use Yunbi website.
    • People from other countries are recommended to use this poloniex, following the prompts to register the production recharge address.
  • Mining procedure: Open source Software: ethminer

Ethminer - GPU Ethereum miner
Usage: ./ethminer [OPTIONS] [pool…]

-L,--dag-load-mode UINT=0   
Set the DAG load mode. 0=parallel, 1=sequential, 2=single

-U,--cuda                   
When mining use the GPU via CUDA

-G,--opencl                 
When mining use the GPU via OpenCL

-P,--pool TEXT ...          
Specify one or more pool URLs. 

-X,--cuda-opencl            
When mining with mixed AMD(OpenCL) and CUDA GPUs

-M,--benchmark UINT=0       
Benchmark mining and exit; Specify block number to benchmark against specific DAG

-Z,--simulation UINT=0      
Mining test. Used to validate kernel optimizations. Specify block number

--tstop UINT=0              
Stop mining on a GPU if temperature exceeds value.

--tstart UINT=40            
Restart mining on a GPU if the temperature drops below, valid: 30..100

CUDA Options:
  --cuda-grid-size UINT=8192  
  Set the grid size

  --cuda-block-size UINT=128  
  Set the block size

  --cuda-devices UINT ...     
  Select list of devices to mine on (default: use all available)

  --cuda-parallel-hash UINT in {1,2,4,8}=4
  Set the number of hashes per kernel

  --cuda-schedule TEXT in {auto,spin,sync,yield}=sync
  Set the scheduler mode

  --cuda-streams UINT=2       
  Set the number of streams

Stratum Protocol

The stratum protocol is currently the most commonly used TCP communication protocol between mining machines and mining pools. The miner network is divided into several main parts such as mining machines, mining pools, and wallets. Sometimes the mining pool software and the wallet are installed together, which can be collectively called a mining pool.

  • Task subscription: When the mining machine is started, it first connects to the mining pool with the mining.subscribe method to subscribe to the work;

  • Miner login: The mining machine uses the mining.authorize method to log in to the mining pool with an account number and password. The password can be empty, and the mining pool returns true to log in successfully. This method must be performed immediately after the connection is initialized, otherwise the mining machine will not get the task of the mining pool;

  • Task assignment: This command is regularly sent to the mining machine by the mining pool. After the mining machine registers with the mining.subscribe method, the mining pool should immediately return the task with mining.notify;

  • Result submission: When the miner finds a legal share, it submits the task to the mining pool with the mining.submit method. If the mining pool returns true, the submission is successful. If it fails, there will be a specific reason in the error.


Content