• Stars
    star
    268
  • Rank 153,144 (Top 4 %)
  • Language
    Python
  • Created almost 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CloudFormation template for mining Ethereum crypto currency on AWS

AWS Ethereum Classic (ETC) miner

CloudFormation template for mining Ethereum Classic (ETC) crypto currency on AWS GPU-enabled EC2 instances

Important!

  • After September 15, 2022 it is no longer possible to mine Ethereum (ETH) coins. However you can still mine Ethereum Classic (ETC) although the profitability is not that great. The templates here have been updated for ETC mining.

  • Reach out to me if you need help with any customisation, e.g. to add support for other crypto currencies, etc.

Quick start

  1. Login to your AWS account and have your ETC wallet address ready.

  2. Launch the stack in one or more of the cheapest regions. Sometimes spot capacity is not available in a particular region, in that case try a different one.

  3. Most users should use the Default VPC template. However if your AWS account is very old and still supports EC2-Classic instances you will have to use the Custom VPC template instead and select the VPC and Subnets manually (and yes you can select the default VPC and default subnets). Do not worry - you will be prompted by the Default VPC template if this is the case.

    TL;DR Start with the Default VPC template and see if it works.

You will have an opportunity to check the stack details, enter the wallet address, etc, before the stack is launched.

Region Default VPC Custom VPC
ap-northeast-1 Tokyo Launch to Default VPC Launch to Custom VPC
ap-northeast-2 Seoul Launch to Default VPC Launch to Custom VPC
ap-northeast-3 Osaka Launch to Default VPC Launch to Custom VPC
ap-south-1 Mumbai Launch to Default VPC Launch to Custom VPC
ap-southeast-1 Singapore Launch to Default VPC Launch to Custom VPC
ap-southeast-2 Sydney Launch to Default VPC Launch to Custom VPC
ca-central-1 Central Launch to Default VPC Launch to Custom VPC
eu-central-1 Frankfurt Launch to Default VPC Launch to Custom VPC
eu-north-1 Stockholm Launch to Default VPC Launch to Custom VPC
eu-west-1 Ireland Launch to Default VPC Launch to Custom VPC
eu-west-2 London Launch to Default VPC Launch to Custom VPC
eu-west-3 Paris Launch to Default VPC Launch to Custom VPC
sa-east-1 SΓ£o Paulo Launch to Default VPC Launch to Custom VPC
us-east-1 N. Virginia Launch to Default VPC Launch to Custom VPC
us-east-2 Ohio Launch to Default VPC Launch to Custom VPC
us-west-1 N. California Launch to Default VPC Launch to Custom VPC
us-west-2 Oregon Launch to Default VPC Launch to Custom VPC

The following Opt-in regions must be enbled in AWS Account settings before use...

Region Default VPC Custom VPC
af-south-1 Cape Town Launch to Default VPC Launch to Custom VPC
ap-east-1 Hong Kong Launch to Default VPC Launch to Custom VPC
eu-south-1 Milan Launch to Default VPC Launch to Custom VPC
me-south-1 Bahrain Launch to Default VPC Launch to Custom VPC

Which region should I use?

Not all instance types are available in all regions. Use the table below to choose the region which supports your desired instance type.

Also note that the Spot and On-Demand prices differ between the regions. The US regions are typically slightly cheaper but often have availability issues, especially on Spot. The non-US regions are a little more expensive but may have the desired instance types available more readily.

Instance regions

What does the template do?

  • Spins up an AutoScaling Group with Spot Instances of the specified instance types, with the most efficient attempted first (usually g5.xlarge, g4dn.xlarge, etc ...)
    • Use template-etc-default-vpc.yml if you want to spin up the instances in the Default VPC (most users).
    • Use template-etc-custom-vpc.yml if you have your own VPC that you want to use (advanced users). The Subnets must have direct or NAT access to the internet! Make sure that the VPC matches the Subnets selected!!
  • Runs etcminer with the right options for mining with the etc.ethermine.org pool upon the instance start.

Increase resource quotas

All right you have created the stack but no instances seem to be running. If you navigate to EC2 -> Autoscaling groups -> etcminer -> Events tab you may see this error:

Failed: Launching a new EC2 instance.

Status Reason: Max spot instance count exceeded. Launching EC2 instance failed.

AWS accounts have default limits (quotas) on some resources. You may find, for example, that your quota for All G and VT Spot Instance Requests in a particular region is 0 and you therefore can't start any g4dn.xlarge instances. It pays to request the quotas increase which can be done with this simple command (you can do this from the CloudShell):

export AWS_REGION=us-west-2 # Oregon
export CODE=L-3819A6DF      # All G and VT Spot Instance Requests (for g5.xlarge, g4dn.xlarge, etc)
# export CODE=L-7212CCBC    # All P Spot Instance Requests (for p3.2xlarge, p3dn.24xlarge or p4d.24xlarge)
export VCPUS=96             # 96 vCPUs - can accommodate e.g. 24x g4dn.xlarge or 1x p4d.24xlarge

aws --region ${AWS_REGION} service-quotas request-service-quota-increase --service-code ec2 --quota-code ${CODE} --desired-value ${VCPUS}

Choose the number of vCPU and the Quota code according to your needs.

Expand to Los Angeles (us-west-2-lax-1)

Spot instance capacity for g4dn.xlarge instances is in short supply in the cheapest regions, even though the spot prices are still very very low. You may have to wait for a long time to get an instance.

Interestingly the Los Angeles local zone seems to have plenty of g4dn spot capacity at the same price as Oregon, however you have to opt-in to be able to use it. Here is how (you can do this from the CloudShell):

  1. Opt-in to the LAX zone with:
    aws --region us-west-2 ec2 modify-availability-zone-group --group-name us-west-2-lax-1 --opt-in-status opted-in
    
  2. Create new default subnets in the 2 LAX AZs in the default Oregon VPC:
    aws --region us-west-2 ec2 create-default-subnet --availability-zone us-west-2-lax-1a
    aws --region us-west-2 ec2 create-default-subnet --availability-zone us-west-2-lax-1b
    
  3. Delete and re-deploy the CFN stack in us-west-2 (Oregon) - it will pick up the 2 new AZs and launch the instances.

Tell me more ...

Check out the instructions in my Medium article, it contains some important considerations. Alternatively, if you think you know what you are doing follow these instructions:

  • Have your ETC wallet address ready. Best to use MetaMask as it will let you manage the Ethermine pool payouts.
  • Login to your AWS account.
  • Click the Launch link or create the stack manually:
  • Check your mining progress on Ethermine ETC dashboard.
    • Note that it takes some time (15 ~ 30 mins) before your stats start to appear, and
    • The reported hashrate speed ramps up slowly to the sustained rate over the first hour or so, I believe due to delays in reporting and some averaging.
    • From my tests the hashrate reported by the ethminer process is correct and that's what you get paid out. Even if the dashboard speed is lower.
  • When done delete the stack.

Author

Michael Ludvig, you're welcome :)

Did you make some profit using this template and want to say thanks? Any ETH or ETC tip sent to my address will be much appreciated: 0x99b36B44cf319c9E0ed4619ee2050B21ECac2c15

0x99b36B44cf319c9E0ed4619ee2050B21ECac2c15

Thanks! :)

More Repositories

1

aws-ssm-tools

Handy tools for AWS Systems Manager - ssm-session, ecs-session, ssm-ssh and ssm-tunnel
Python
231
star
2

smtp-cli

The ultimate command line SMTP client
Perl
185
star
3

mini-printf

Minimal printf() implementation for embedded projects.
C
165
star
4

yubikey-ldap

LDAP schema and tools for Yubico YubiKey authentication
Python
58
star
5

aws-utils

Useful AWS scripts and utilities
Shell
50
star
6

sss_deobfuscate

Decode obfuscated ldap_default_authtok from sssd.conf
Python
22
star
7

aws-crypto-miner

CloudFormation template for mining Ravencoin (RVN), Ergo (ERG), Kaspa (KAS), and Ethereum Classic (ETC) altcoins on AWS GPU-enabled EC2 instances, with a support for payouts in Bitcoin (BTC)
Python
16
star
8

gcp-ethereum-miner

Mine ETH on Google Cloud Platform
Shell
15
star
9

amazon-textract-parser

Amazon "Textract Results Parser" (trp) module packaged and improved for ease of use.
Python
15
star
10

nagios-plugins

Useful set of Nagios plugins
Perl
13
star
11

amazon-textract-cloudformation

Automated solution for parsing PDF files using Amazon Textract. Complete solution with CloudFormation template, Step Function State Machine, Lambda functions, etc.
Python
9
star
12

aws-ipranges-updater

Update AWS RouteTable and/or SecurityGroup with selected AWS IP prefixes
Python
5
star
13

ipset-init

IPset "init script" for automatic loading and saving existing ipset tables.
5
star
14

aws-polly

Make Raspberry Pi talk with AWS Polly
Python
3
star
15

ddns-cli

Dynamic DNS updater
Python
3
star
16

aws-cloudwatch-logmailer

AWS CloudWatch Logs watcher and mailer.
Python
3
star
17

net-policy

Manage per-user network policy with LDAP, OpenVPN and Linux firewall
Python
2
star
18

sms-cli

Command line SMS sender
Python
2
star
19

aws-standard-templates

CloudFormation templates for creating some standard EC2 stacks.
Python
2
star
20

messagemedia-simple

Easy to use Python module for sending SMS and MMS messages through MessageMedia API.
Python
1
star
21

filebench

Filebench is a file system and storage benchmark that allows to generate a large variety of workloads using rich Workload Model Language (WML). See http://filebench.sourceforge.net for more info.
C
1
star
22

scan2pdf

Scan documents to PDF from Linux command line.
Shell
1
star
23

guess-number-gym

Guess a Number - simple OpenAI Gym for reinforcement learning
Python
1
star
24

zoneminder-filter

Filter ZoneMinder events using image recognition (AWS Rekognition)
Python
1
star
25

ec2-start-stop

Demo of AWS EC2 Instance Start/Stop scheduling
Python
1
star