Quantcast
Channel: Byte Miner » admin
Viewing all articles
Browse latest Browse all 12

Litecoin Mining on Amazon EC2

$
0
0

LiteCoin mining on Amazon EC2 was profitable when using g2.2xlarge spot instances. Although the historical average spot price for g2.2xlarge instances has already nearly doubled (presumably because of miners bidding the price up), it will remain profitable at  LTC prices (~$41) until the spot price exceeds ~$0.20 per hour. Prices obviously vary, so make your own judgement!

You can currently get roughly 185 khash/s from the g2.2xlarge instances if you use both the GPU and CPUs: ~150 khash/s from the GPU, and ~35 khash/s from CPU mining with six threads. If you use seven or eight threads, you starve the GPU mining and overall performance drops.

Note that EC2 limits you to 10 g2.2xlarge spot instances per region, so you’ll need to run them in multiple regions to get more than 10 instances; however, even with only 10 instances, you should be able to mine ~1.2 LTC (~$35) per day at the current difficulty level.

To start mining, you’ll need to create an account on a pool. WeMineLTC.com is easy to get started with quickly and seems to work well enough. After creating an account, you’ll want to setup two workers per EC2 instance — one for GPU mining and one for CPU mining. For the GPU worker, I would recommend setting the “Suggest Diff” at 16 and “Max Diff” at 128. For the CPU worker, set “Suggest Diff” at 8 and “Max Diff” at 64.

In the EC2 management console, you’ll want to go to the Spot Requests page and click “Request Spot Instances”. Select Amazon Linux AMI (HVM) 2013.09.1, and the GPU instance g2.2xlarge. On the following page, just change the number of instances to 10 and set your maximum price to something reasonable (i.e. less than $0.20 or it won’t be profitable).

Once your spot instance requests have been filled and your instances have launched, login with SSH and set them up:

On a Mac, I used iTerm which can direct keyboard input to all tabs (so I had all 10 instances open at once!):

 

—START INPUT TO ALL TABS—  

    4  sudo yum -y install git
    5  git clone https://github.com/adammeghji/ansible-ltc-mining-on-ec2
    7  cd ansible-ltc-mining-on-ec2/
    9  mv inventory.yml inventory.yml.old && echo "[ltcminers]" > inventory.yml && curl ifconfig.me >> inventory.yml && cat inventory.yml
    9  
   10 cat ltcminers.yml
   11  vi ltcminers.yml

Search and replace user/password by doing,

       :1,$ s/m41w0rk3r/<your_wemineltc_password>/g
       :1,$ s/marmsu/<your_wemineltc_user>/g

—STOP INPUT TO ALL TABS— 
edit user/pass accordingly
—START INPUT TO ALL TABS—
   12    :wq
   14  sudo yum -y install python-jinja2.noarch 
   15  cd
   16  .ssh
   17  vi aws.pem
   18. Copy paste from <amazon_private_key>.pem via TextEdit

   18 chmod 400 aws.pem  

   19  :wq 
   20  cd
   21  cd ansible*
   15  make 
—STOP INPUT TO ALL TABS—

Using above steps, I was able to launch 10 instances in under 15 mins.

You can choose to do it manually, but spot instances means the servers would eventually die and doing manually is not an option TBH.

Here are manual steps anyway:

sudo yum -y groupinstall "Development Tools"
sudo yum -y install git libcurl-devel python-devel screen rsync yasm numpy openssl-devel
wget http://developer.download.nvidia.com/compute/cuda/5_5/rel/installers/cuda_5.5.22_linux_64.run
sudo sh cuda_5.5.22_linux_64.run

That last step is the CUDA installer, which will ask you a few questions — you’ll want to accept everything and keep the default paths.

Next, setup the GPU miner, CudaMiner (note that the latest version is broken when compiling on this AMI as of December 3, hence the git reset to the previous revision):

git clone https://github.com/cbuchner1/CudaMiner
cd CudaMiner
git reset –-hard 88c6da6d5c2b798d1de7031e8dbcc2678f635e4b
./configure
PATH=/usr/local/cuda-5.5/bin:$PATH make

Start a screen session and launch CudaMiner to start mining!

screen
LD_LIBRARY_PATH=/usr/local/cuda-5.5/lib64 ./cudaminer -o stratum+tcp://us3.wemineltc.com:3333 -u YOUR_ACCOUNT.YOUR_MINER -p YOUR_MINER_PASSWORD -C 1

(Detach from the screen by pressing Ctrl+A, then D.)

To install cpuminer:

cd ~
git clone https://github.com/pooler/cpuminer
cd cpuminer/
./autogen.sh
./configure CFLAGS="-O3"
make

You’ll need to setup the stratum mining proxy because cpuminer doesn’t have stratum support built in, which is required to connect to the WeMineLTC pool. To setup the stratum mining proxy:

cd ~
git clone https://github.com/bandroidx/stratum-mining-proxy
cd stratum-mining-proxy/
sudo python distribute_setup.py
cd litecoin_scrypt/
sudo python setup.py install
cd ..
sudo python setup.py develop
chmod +x mining_proxy.py
./mining_proxy.py -o stratum2.wemineltc.com -p 3333 &amp;

Then start another screen session for your CPU miner:

screen
cd ~/cpuminer/
./minerd -o http://127.0.0.1:8332 -u YOUR_ACCOUNT.YOUR_MINER -p YOUR_MINER_PASSWORD -t 6

(Detach your screen session again with Ctrl+A, then D.)

As an added bonus, you may still be able to get $100 of Amazon EC2 credit, which would give you a few free days of mining.

The post Litecoin Mining on Amazon EC2 appeared first on Byte Miner.


Viewing all articles
Browse latest Browse all 12

Latest Images

Trending Articles





Latest Images