mludvig / aws-ethereum-miner

CloudFormation template for mining Ethereum crypto currency on AWS
267 stars 152 forks source link

Reporting Function #61

Closed AshUK closed 1 year ago

AshUK commented 1 year ago

Currently if you wish to change your payment settings, you require either the wallet or the 'IP corresponds to the public IP address of your highest performing worker'. If you chose to use a wallet hosted by one of the large public exchanges you mostly likely wont have access to the wallet (public/private keys). It would be cool if there was a reporting lambda that collected the stats from the active miners and then published it to a cloud watch log. That could be reviewed later.

mludvig commented 1 year ago

Hi, it's difficult to tell which instance is the best performing from the Ethermine perspective because they do the stats every 10 mins and the instances typically perform very close to each other with some fluctuations so it's hard to tell what Ethermine thinks.

However Ethermine gives you a hint - e.g. that it's an instance *.*.*.107. Now all you need is a list of the public IPs of your instances and find the one that ends with .107:

for REGION in $(aws ec2 describe-regions --query 'Regions[].RegionName' --output text); do 
  echo "## $REGION"
  aws --region $REGION ec2 describe-instances --query 'Reservations[].Instances[].PublicIpAddress[]' --output text | xargs -n1 echo
done | grep 107$
52.65.152.107

If you get two or more matches you simply try all of them in turn, it's not a big deal.