Mining with Azure Batch

Azure Batch and Pool VM

  • Connect to http://portal.azure.com
  • Create a new Batch Account (free) and associated Storage Account with pool allocation mode “Batch Service” so you don’t need Key Vault
  • Open Batch Account and select Pools
  • Add a new pool with the following settings
    • Image Type = Marketplace (Linux/Windows)
    • Publisher = Canonical
    • Offer = Ubuntu Server
    • Sku = 16.04 LTS
    • Node Size =
      • F8 – XMR Monero
      • NC6 – ETH Ethereum
    • Mode = Fixed
    • Low priority = 3
    • Resize timeout = 90 minutes
  • Wait for resize operation if succeed or not as we are using Low Priority VM so it may fail if Azure has other higher priority VM
  • Click on Nodes and review if VM is there
  • Select the VM and verify Overview = Idle
  • Click on Connect and add a new user with Administrator privilege

Monero CPU miner in Ubuntu F16 VM

  • Create the following setup_xmr_f8_v1.sh file:
sudo apt-get --assume-yes update
sudo apt-get --assume-yes install libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev screen git nano
git clone https://github.com/fireice-uk/xmr-stak-cpu.git
cd xmr-stak-cpu/
cmake .
make install
cd bin/
mv config.txt config.txt.ori
wget https://<your_storage_account>.blob.core.windows.net/miner/f16/config.txt
sudo sysctl -w vm.nr_hugepages=128
screen -dmS monero sudo ./xmr-stak-cpu
  • Create the following config.txt file:
"cpu_threads_conf" :
[
 { "low_power_mode" : true, "no_prefetch" : true, "affine_to_cpu" : 0 },
 { "low_power_mode" : true, "no_prefetch" : true, "affine_to_cpu" : 1 },
 { "low_power_mode" : true, "no_prefetch" : true, "affine_to_cpu" : 2 },
 { "low_power_mode" : true, "no_prefetch" : true, "affine_to_cpu" : 3 },
 { "low_power_mode" : true, "no_prefetch" : true, "affine_to_cpu" : 4 },
 { "low_power_mode" : true, "no_prefetch" : true, "affine_to_cpu" : 5 },
 { "low_power_mode" : true, "no_prefetch" : true, "affine_to_cpu" : 6 },
 { "low_power_mode" : true, "no_prefetch" : true, "affine_to_cpu" : 7 },
],
"use_slow_memory" : "warn",
"nicehash_nonce" : false,
"aes_override" : null,
"use_tls" : false,
"tls_secure_algo" : true,
"tls_fingerprint" : "",
"pool_address" : "pool.minexmr.com:7777",
"wallet_address" : "<wallet_id>.VMf8",
"pool_password" : "x",
"call_timeout" : 10,
"retry_time" : 10,
"giveup_limit" : 0,
"h_print_time" : 60,
"daemon_mode" : true,
"output_file" : "./xmr.log",
"httpd_port" : 51000,
"prefer_ipv4" : true

Ethereum GPU miner in Ubuntu with NC6 VM

  • Create the following setup_eth_nc6_v1.sh file:
CUDA_REPO_PKG=cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
wget -O /tmp/${CUDA_REPO_PKG} http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i /tmp/${CUDA_REPO_PKG}
rm -f /tmp/${CUDA_REPO_PKG}
sudo apt-get --assume-yes update
sudo apt-get --assume-yes install cuda-drivers
sudo apt-get --assume-yes install software-properties-common
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get --assume-yes update
sudo apt-get --assume-yes install ethereum ethminer
wget https://github.com/ethereum-mining/ethminer/releases/download/v0.11.0/ethminer-0.11.0-Linux.tar.gz
tar -xf ethminer-0.11.0-Linux.tar.gz
cd bin
./ethminer --farm-recheck 200 -G -S us1.ethermine.org:4444 -FS us2.ethermine.org:4444 -O <wallet_id>.nc6

 

Upload files to Storage Account

  • Install Azure Storage Explorer
  • Connect to Azure subscription
  • Select Azure Storage Account created for Azure Batch
  • Browse to Blob Containers
  • Right click on Blob containers -> Create a new container
  • Right click on new container -> Set public level access
  • Set “Public read access for blob only”
  • Create 2 new folder f8 and nc6
  • Upload the 3 files in correct folder as reported below:
https://<your_storage-account>.blob.core.windows.net/miner/f8/setup_xmr_f8_v1.sh
https://<your_storage-account>.blob.core.windows.net/miner/f8/config.txt
https://<your_storage-account>.blob.core.windows.net/miner/nc6/setup_eth_nc6_v1.sh
  • Remember to edit setup_xmr_f8_v1.sh and point to correct config.txt file location

Create a Start task for pool

  • Select the pool
  • Select Start Task
  • Max retry = 0
  • Command line = sudo ./setup_xmr_f8_v1.sh
  • User identity = Pool autouser, Admin
  • Wait for success = False
  • Resource files
  • Environment settings = not configured

 

Monitor Linux resource

  • Monitor xmr miner =
cd /mnt/batch/tasks/startup/wd/xmr-stak-cpu/bin
tail -s 5 -n 20 -f xmr.log
  • Other monitoring tools =

Review this post = https://inglele.wordpress.com/2017/05/19/ethereum-block-reward/

Source:

Advertisements