Giter Site home page Giter Site logo

aws-ethereum-miner's Introduction

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)

Important!

  • Crypto mining on AWS is not always profitable. Do your own research!

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

Quick start

  1. Have your BTC wallet address ready for payouts (even if mining RVN, ERG, KAS, or ETC).
  2. Login to your AWS account.
  3. 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.

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-default-vpc.yml if you want to spin up the instances in the Default VPC (most users).
    • Use template-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 the miner program with the right options for mining with the 2miners 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 -> miner -> 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 BTC wallet address ready. Best to use a non-custodial wallet like Guarda or Electrum or even better a hardware wallet like Ledger or Trezor.
  • Login to your AWS account.
  • Click the Launch link or create the stack manually:
  • Check your mining progress in 2miners 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.
  • When done delete the stack.

Author

Michael Ludvig, you're welcome :)

aws-ethereum-miner's People

Contributors

mludvig avatar wilfi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-ethereum-miner's Issues

How to add .log file to tail

Hi michael ,

Eithminer had /tmp/ethminer.log which we ususally tail or look to make sure instance are mining. But with new template in action is there is way to tail the logs?

Consider different miner software to increase profitability

I can see that ethminer is being used. This is quite outdated and would cause low hashrate, hence low profitability.

I would suggest considering other miner software programs such as:

T-rex (NVIDIA GPUs only)
Teamredminer (AMD GPUs only)
lolminer (both GPUs)

Which IAM role permissions should we use to run the stack?

Hi,

I'm tried to run your stack using a Cloudformation IAM role, but it fails in the beginning by giving me permission errors;

The following resource(s) failed to create: [LambdaExecutionRole, InstanceRole, NotificationTopic]. Rollback requested by user.

AWSCloudFormation is not authorized to perform: iam:CreateRole on resource: arn:aws:iam::5****07:role/ethminerA-LambdaExecutionRole-KV***

AWSCloudFormation is not authorized to perform: iam:CreateRole on resource: arn:aws:iam::5****07:role/ethminerA-InstanceRole-Q5***

AWSCloudFormation is not authorized to perform: SNS:CreateTopic on resource: arn:aws:sns:us-east-1:5****07:ethminerA-NotificationTopic-XE*** because no identity-based policy allows the SNS:CreateTopic action

Looks like the IAM role should be some additional permissions to more services.
If possible, please paste in your repo and add to the README the policy/role JSON you use.

Thanks!

Enable CPU Monero mining on Eth miners

I want to propose that we also use the CPU resources on these spot instances while mining Ethereum.
This can be done by spinning up something like XMRig and connecting it to a Monero wallet.

Spot Instance not launching

I am having the below error since i have launched the CFT. I have ran it for about 12 hours. I am not sure what config i can mess with to correct this. Can you help?
Screen Shot 2022-05-25 at 11 16 54 PM

feature request

Hello,

Wanted to know if it were possible to add Zcash or any other coins that are offered in ethermine.org to be profitable using the existing CF template?

Support for RVN

Hey Michael, thank you for this repository! Great job! Do you have anything similar for RVN or DOGE? Thanks a lot!

Mining on g4ad.xlarge with Radeon Pro V520

Thanks for your work in the AWS mining field, @mludvig !

I was looking around at the different instances with GPU's and I found the G4ad instances.
They all seem to have AMD Radeon Pro V520 GPUs that looks really good for mining.

This youtube video showcasing (a slight modified version of V520) 70 MH/s mining ETH!
https://www.youtube.com/watch?v=WMaPkCYJ1WA

The price of g4ad.xlarge linux on demand is just $0,38 pr. hour! I have done some calculations, and with this info it seems like its the pest price pr. MH/s coming in at 184 MH/s pr. $1 (Linux on demand price).

Have you tested the G4AD instances? If so, what was your results?

Error on ASG - UnfulfillableCapacity

Hi Michael,

First thanks for this awesome template!

I am getting those errors, no matter the configuration...

Launching a new EC2 instance. Status Reason: Could not launch Spot Instances. UnfulfillableCapacity - Unable to fulfill capacity due to your request configuration. Please adjust your request and try again. Launching EC2 instance failed.

Status Reason: Could not launch Spot Instances. InvalidFleetConfiguration - Your requested instance type (p3.8xlarge) is not supported in your requested Availability Zone (us-east-2c). Launching EC2 instance failed.

  • us-east-2a, us-east-2b, us-east-2c

Enable GPU/CPU ZCash

Hey, thanks for this fabulous script that works without a hitch for eth!
I would like to know if it is possible to activate CPU and GPU mining to mine Zcash?

Have you already tested it maybe?

Got it working manually

Hey Michael,
Great articles and background! I appreciate it!

I got instances to successfully launch using your template, but they didn't produce any results. I couldn't connect to them using SSM for some reason, so I couldn't really tell you what was going on.

What did work was to build the instance by hand, and add the ubuntu user to the "video" and "render" groups. Does that make any sense? If so, I'm not quite sure how to drop that into the YAML template, in which case I think I could create a new AMI.

Will post back here as I learn more, but if you have any thoughts in the meantime they are most welcome!

best Regards,
Tom Wood

.

.

Modified for Flux mining

Hi, I modified the code for the default vpc to download the miniZ miner and then run it with its command line options. I am not sure why, but when I upload this modified template, the process seems to get stuck on the Lambda function fluxminer-test-AsgUpdaterLambda-sur4A5k5pDIb and I cannot find any logs to tell me what's stopping it from creating instances.
template-flux-default-vpc.template.yml.zip

Support for RVN?

I read your article and another persons article about this setup and its really amazing how you made all this work so nicely. Could this be adapted for mind Ravencoin? I know it's probably not profitable, but the gamble is that it could become profitable at some point, so accumulating some coin would be nice. In fact, since we are on the subject, it would be cool to have a config file that would let you choose the miner to use for a particular coin. I'd love to mine a few of the less popular coins and see the results. Sadly, I am not a coder. :)

1/2 checks passed

Hi Michael,

I have three instances running, two with no issues (each with 2/2 checks passed), both g5.xlarge. But there is a g5g.xlarge with 1/2 checks passed.
Is that one running but in an unproductive way? Is AWS charging me for that one anyway?
I tried to reboot that instance but didn't solve the problem.

Specify worker names in ethminer

For ethminer I noticed you can specify worker names using a format like 0x123456789012345678901234567890.Worker.

Idk if in cloud template you can get instance id or some kind of worker index. I guess you could just a random number for each worker so it'll show up in pools dashboards like ethermine.

Launching with stack with 'g4ad.2xlarge' specified

I am getting the following error when launching the template with 'g4ad.2xlarge' specified:
Received response status [FAILED] from custom resource. Message returned: Error: No wanted instance types match the available types. (RequestId: 5*******-****-****-****-*********)
And the stack is getting rolled back.
However, I have no trouble launching the stack with 'g4ad.xlarge'/'g4ad.8xlarge' specified. And no problem launching g4ad.2xlarge instances (both Spot and On-Demand) with the given instance template manually from the console.
Screen Shot

Instance type

Hi Michael,

I was wondering if it would make sense to use a 3-yr ISP Effective Hourly (Linux) plan, which can be cheaper.
If so, can you set that option as a parameter?

Thanks

Error with the ethminer stack

Hello

Seems to have an error with my ethminer stack
deleted it by mistake ...

and when i re created it i have a problem with the lambda function
tried to delete the lambda Function but won't let me do it either

image

Can anyone help me with this problem

thanks

Security Group(s) not linked to the VPCs in Auto Scaling Group

Hi Michael.

Getting the following message when CF is trying to create MinerAsg:

One or more security groups in the launch template are not linked to the VPCs configured in the Auto Scaling group (Service: AmazonAutoScaling; Status Code: 400; Error Code: ValidationError; Request ID: c5e48098-77fd-4082-a5cc-96cbf8bb4061; Proxy: null)

Tried searching on the message and reviewing the docs to no avail -- any assistance is appreciated!

c5

Runner.sh is empty

After create the instance the runner.sh is empty so ethermine can't be executed.

ETH Miner not running

hi there,

many thanks for providing the template, I have applied it to our AWS Gd5 but it seems that its still not running although I can see the instance has been created successfully. Appreciate if you could enlighten us.

Screen Shot 2022-02-08 at 11 53 26 AM

Also,Screen Shot 2022-02-08 at 10 53 37 AM would like to apply this to Google Cloud of Alibaba Cloud if it can also be done there, Open for Collabs or custom work if you're open to it.

Screen Shot 2022-02-08 at 10 53 25 AM

How to run multiple instances of this on AWS? + Some general questions

I've launched one instance of this on AWS. But how do launch multiple miners with multiple workers?

Also, how do I detect the hash rate for these things and benchmark them like you did? I want to try benchmarking them on other cryptocurrencies as well.

Will this instance run for 24 hours?

Not able to launch

Got following error in cloudformation:

The following resource(s) failed to create: [MinerAsg]. Rollback requested by user.
Logicalid: eth-mining

One or more security groups in the launch template are not linked to the VPCs configured in the Auto Scaling group (Service: AmazonAutoScaling; Status Code: 400; Error Code: ValidationError; Request ID: 86ca4481-6267-4aa0-89df-3258e20bf110; Proxy: null)
LogicalId: MinerAsg

CFN template created and Running But No Hash rate

Cloud Formation Template uploaded and running. But i couldn't get any active workers and hash rate.

I have replaced my ETH wallet address and checked the miner address in ethermine, No active workers. I did connected SSH client to the instance.

Now how to check whether the mining starts on the instance or not? If not how to troubleshoot. Kindly help.

Mining in Oracle

Hello! Great work!
My question: Will your templates work in Oracle web services? I have some free credits and want to use them to mine cryptos.
Thank you

About g4ad AMD GPU's

Has anyone tried it and got it working? I tried to run the machine with the previous methods, but I was not successful with NBMiner and T-rex miners, I get the "no GPU detected" problem, I think the problem is caused by CUDA, still couldn't find a solution.
I suppose that it will be more cost efficient but also curious about how much return they will provide.
Do you have any experience about that new GPU instances ?

Instances showing error after running a while

ail -f /tmp/ethminer.log
/lib/x86_64-linux-gnu/libc.so.6(+0x3efd0) [0x7f7fa1385fd0]
./ethminer() [0x493b8a]
./ethminer() [0x48d26a]
./ethminer() [0x48d54c]
./ethminer() [0x48fd86]
./ethminer() [0x48ff39]
./ethminer() [0x42a2d0]
./ethminer() [0x773aaf]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76db) [0x7f7fa1cf56db]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f7fa1468a3f]

Error: no usable mining device found

Why launching instance from aws gui with "launch gui":
manually selecting ami-0476917f2861069bf (us-east-1)
(but tried also with Amazon Linux 2 AMI with AMD Radeon Pro Driver)
g4adxlarge instance type
ssh into instance
downloading ethminer
launching ethminer and getting:
Error: no usable mining device found

lolminer fails to start up sometimes

will throw a message like this on boot

Cloud-init v. 20.3-2-g371b392c-0ubuntu1~18.04.1 running 'modules:final' at Mon, 31 May 2021 09:34:36 +0000. Up 38.97 seconds.
ci-info: no authorized SSH keys fingerprints found for user ubuntu.
Cloud-init v. 20.3-2-g371b392c-0ubuntu1~18.04.1 finished at Mon, 31 May 2021 09:34:37 +0000. Datasource DataSourceEc2Local.  Up 39.30 seconds

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.