Disclaimer: this is an old post from my blog that is currently down because I don't want to pay for AWS
Ethereum
Ethereum (Eth) is a cryptocurrency, like Bitcoin (which you've probably seen in the news since it recently hit $10,000), a digital currency based on a blockchain and cryptography. Later on, I'll show you how to mine Ethereum.
Cryptos
Cryptocurrencies use cryptography to create more of themselves, and to verify and secure transfers. The rate of production is defined at creation of the system, and often tapers down to eventually result in a limited amount of the crypto that will not increase, like gold or other precious minerals. They are produced by the entirety of the system, which also verify the ledgers, as the system is a network of trust-less parties, who have a financial incentive to secure the system (their own currency in the system, and a reward for 'mining' the new block). Using a gaming rig (like I am) or any computer with a suitable graphics card (GPU) to mine ethereum is a great way to start out and learn about blockchain technologies, as well as make some money.
Mine Ethereum
Mining Eth is basically solving a puzzle, that both verifies and secures the transactions in the previous 'block', and generates more Eth, at a rate of 5 Eth per block. The miners guess at the answer of the puzzle until one wins, verifying the block and winning the Ethereum. To solve the puzzle, you use a hash with the block's header metadata, which contains a time-stamp and version, as well as a hash of the transactions. This is hashed with a 'nonce' value, which is the only thing that changes, to reach a specific result. It's almost impossible to fake this work, which is why it's rather secure, and it takes almost no time for the other nodes to verify the hash.
Difficulty
While it's supposed to happen, the increasing speed of the network can make it faster & faster to mine Ethereum. This led to the 'difficulty' of the network, which increases when the speed of each block being mined decreases below ~12 seconds. This reduces the probability of the correct hash being generated. The difficulty reduces the probability by increasing the limit within which correct hashes can occur; if the difficulty made the limit 1000 (which is way too small but for simplicity), then only hashes between 0-0fff are acceptable. This would be an extremely low difficulty, the difficulty for ethereum is much higher.
How to Mine Ethereum on Linux
First, you'll need a Linux distro installed, which isn't too hard to figure out if you haven't done it before. I use Ubuntu 16.04, and I'm not going to explain installation here for brevity. However, you will need a certain level of hardware to mine Ethereum. You should be mining with a GPU, as the CPU doesn't have the power to mine at the current difficulty, and it needs to have at least ~2.4 GB of memory, so really you need at least 3GB. This is because the algorithm for mining (Ethhash) requires a large file (the DAG) to mine, which is to deter ASIC mining like what happened with BTC. Other than this, just get the fastest GPU you can if you're picking one up. The faster it is, the more Hashes per second, and the more blocks you'll mine.
Software
There's a bit of software required, but hopefully if you managed to install Linux, you know how to use apt-get a bit.
Geth & Ethminer
Geth is the main ethereum software, which runs the node for the network, as well as being used for accounts. Ethminer is the main mining software, which does the hashes and generates the DAG, as well as sending the shares.
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum geth ethminer
To create your account with geth, and generate your private key for the wallet, use:
geth account new
Enter a passphrase, write it down, as it's the only way to access the money within that wallet, and also write down/copy what's in the {...} starting with 0x, as that's your address. That's how people send money.
NVIDIA Driver
You'll need a GPU driver to run ethminer, and also to overclock your GPU if you decide to. First, download the driver you need, which you can find here, if you have a NVIDIA GPU. Then you need to install some dependencies for it and run the installer, using:
sudo apt-get install linux-headers-amd64 build-essential
chmod +x YOUR_DRIVER_NAME.run
sudo ./YOUR_DRIVER_NAME.run
Now you can run a benchmark for it, using ethminer. This will generate the DAG file, and then run a benchmark to find out the H/s your GPU does. You may have to run twice, the second after the DAG is generated.
ethminer -M -G
Stratum Proxy
There are several ways to increase your hashpower without buying more GPUs or a full rig. The easiest is using the stratum proxy for mining. At the end of this post, I'll explain how to set up mining without the proxy as well. The proxy runs a mining server proxy on your computer, and queries your host server for new jobs, as well as sending your shares to the server. This reduces the time spent communicating between the distant host server and your computer from the actual hashing of the ethminer.
Source Code
You can download the full fork here, unzip and rename if you want. You can check out the GitHub here. First, you need to setup your configurations, which are set in the eth-proxy/eth-proxy.conf file:
- Set your wallet address from earlier
WALLET = "WALLET_FROM_GETH"
- If you want to have a worker ID
ENABLE_WORKER_ID = TRUE
- Monitoring email
MONITORING = TRUE
MONITORING_EMAIL = "YOUR_EMAIL";
- Set your pool:
POOL-HOST = "YOUR_POOL_NAME"
- If you changed the pool above, move the backups around so that the closer ones are prioritized.
I used dwarfpool as it had the easiest setup, and worked out with stratum-proxy. The stratum-proxy has the servers for dwarfpool at the beginning of the eth-proxy.conf file, which made it really easy. The only error I had was that coin was not set, so I went into the stratum file to config_default.py and added Coin = "ETH&"; to it.
Running the Server
You need to install some dependencies as well, mainly python and twisted-python.
sudo apt-get install python-twisted
Install any dependencies it prompts you with, then head to the main directory in terminal, and run:
python ./eth-proxy.py
And head to http://127.0.0.1:8080/ to check if it's running, it will show Ethereum stratum proxy and some info about it.
Mine Ethereum
Since you now have a wallet, the stratum-proxy, and the mining software with drivers, we can mine Ethereum. All you need to do is run:
./ethminer --farm-recheck 200 -G -F http://127.0.0.1:8080/rig1
Run this in the ethminer directory, and provided you let the benchmark run, it will immediately start running & mining. It will create a buffer for the DAG and connect to the server, hopefully immediately maximizing the hashrate. It will show up every 200 ms (which is what the --farm-recheck parameter is for), but show in H/sec and the hashes achieved in the 200 ms. Shares will show up either accepted or REJECTED, which can be used for monitoring autonomously.
If you decided not to get the stratum proxy, use this:
./ethminer --farm-recheck 200 -G -F YOUR_SERVER
In a later post, I'll explain several other things you can do to improve mining speed as well as runtime. These will include autonomous monitoring and restarts, reducing downtime, as well as GPU overclocking, which will directly increase hashpower.
If I helped at all, please donate to a broke-ass college student: ETH: 0x9b7C9B7FC5A56baD3a71A1F5Ed9F359399a2Eb11
BTC: 1NP3YKtJzjbQmSjguZQtgG1XJb3pt3DWQ6
Coins mentioned in post:
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
@petertag, thank you for supporting @steemitboard as a witness.
Here is a small present to show our gratitude
Click on the badge to view your Board of Honor.
Once again, thanks for your support!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit