how to create a ethereum miner code example

Example 1: how to mine ethereum

1. Install Geth, (Make sure its an SSD because it won't work with an HDD)
   (I recommend to create an Ethereum Folder and inside a Geth folder on the
   drive you are using and install it there)
   link to geth: https://geth.ethereum.org/downloads

2. add geth to path:
   press windows key, search environment variables. press enter.
   press "Environment Variables"
   under system variables double click "Path". press new,
   and type there the location where Geth is installed
   (make sure you have enough storage in your SSD)
   
3. or if you have another SSD you can use that is better, so use that one.
   if you dont so just skip this step:
   press win+R, type %AppData%, go one folder back, go to Local, copy the path.
   open CMD and type:
   mklink /J <Path to local>\Ethereum <The path to the Ethereum Folder at the other drive you are planning to use>
   
4. install Ethminer.
   link to download: https://github.com/ethereum-mining/ethminer/releases
   (just extract the folder, and put it in your path, like earlier)
   (your browser might think its a virus. its not.)
   DO IT AT YOUR OWN RISK. IF YOU DONT FEEL COMFORTABLE DOWNLOADING IT SO DONT
   
5. in CMD type the command:
   geth account new
   (this is basically creating the wallet account you will be mining to.)
   (when it asks you to create a password, you wont be able to see what you are
   typing, so make sure you are typing everything correctly)
   copy the public adress it gives you.
   go to the Ethereum folder from earlier, and backup the keystores to a
   couple of places on your computer. or even on a disk on key or something.
   this is basically the private key for the wallet you created.
   NEVER EVER SHARE IT WITH ANYONE
   (you should also import that account into your ethereum wallet, for easy
   management, like to metamask or MyEtherWallet there you would be also able
   to goet the private key string.)
   
6. Now, once you are ready to start syncing with the blockchain,
   (it would take about 12< ) so send this command on CMD:
   geth --rpc --etherbase <pulbic address> --syncmode=fast --cache=2048
   where <public address> is the newly created wallet public address
   and cache is the ammount of ram you are giving it in KB (eg. 2GB is 2048KB)
   Make sure you are using --cache because if you dont its gonna run for ever 
   because you wont be giving it enough ram
   also make sure that you use the --fast so it would sync in fast mode.
   you dont need the full blockchain to be a valid node.
   
7. Once you finish syncing, open a new CMD (Dont close the other one):
   Type in the command:
   ethminer -G -P http://127.0.0.1:8545
   
And here you go! you started mining!
you should consider joining a pool, depends on your graphics card.
Before you start mining you should calculate your profitability here:
https://etherscan.io/ether-mining-calculator
Just change the hashrate, power consumption, and cost per kW/h.
Good luck!

Example 2: how to mine ethereum

Answer Bellow/Above by Xerothermic Xenomorph is writen by me. I wasn't logged in
when I wrote it unfortunatly. so show some appreciation here if you like my
answer. grepper if you are seeing this, can you help me with this issue?

Tags:

Misc Example