Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##Basic Miner watching program written in python
- ##L8nit3tr0ubl3
- ##Import required modules
- from pycgminer import CgminerAPI
- import socket
- import json
- import os
- from time import sleep
- from easygui import *
- ##Define 'cgminer' as per 'Thomas Sileo's' instructions
- cgminer = CgminerAPI()
- ##Modify host using user input
- msg1 = "Please enter your miner IP.\n"
- title1 = "L8nit3's EyesOnMiner-Beta3"
- cgminer.host = enterbox(msg1,title1)
- msg2 = "How often should the data update? in seconds.\n"
- update = enterbox(msg2,title1)
- ##Define devices and correct data for display
- def antminer():
- loop = 1
- while loop == 1:
- summary = cgminer.summary()
- HW = float(summary['SUMMARY'][0]['Hardware Errors'])
- diffa = float(summary['SUMMARY'][0]['Difficulty Accepted'])
- diffr = float(summary['SUMMARY'][0]['Difficulty Rejected'])
- x = HW + diffa + diffr
- speed = summary['SUMMARY'][0]['GHS 5s']
- accepted = summary['SUMMARY'][0]['Accepted']
- best = summary['SUMMARY'][0]['Best Share']
- rejected = round(summary['SUMMARY'][0]['Device Rejected%'],6)
- percent = round(HW / x * 100,6)
- uptime = round(float(summary['SUMMARY'][0]['Elapsed'] / 60.0 / 60.0),2)
- os.system('cls' if os.name == 'nt' else 'clear')
- found = summary['SUMMARY'][0]['Found Blocks']
- if found == 0:
- message = "Keep Trying!"
- else :
- message = "$$$YAY$$$"
- print ""
- print "##########################################################"
- print "#"
- print "# ANTMINER S1 & S3 STATISTICS"
- print "#"
- print "##########################################################"
- print "#"
- print "# Your current GH/s = ", "|", speed
- print "# "
- print "# Your Accepted # = ", "|", ('{:,}'.format(accepted))
- print "# "
- print "# Your rejected % = ", "|", rejected
- print "# "
- print "# Your current HW% = ", "|", percent
- print "# "
- print "# Your best share diff = ", "|", ('{:,}'.format(best))
- print "# "
- print "# Your uptime in hours = ", "|", uptime
- print "#"
- print "# Found Blocks Total = ", "|", found, message
- print "# "
- print "##########################################################"
- print ""
- sleep(int(update))
- def s7():
- loop = 1
- while loop == 1:
- summary = cgminer.summary()
- HW = float(summary['SUMMARY'][0]['Hardware Errors'])
- diffa = float(summary['SUMMARY'][0]['Difficulty Accepted'])
- diffr = float(summary['SUMMARY'][0]['Difficulty Rejected'])
- x = HW + diffa + diffr
- speed = summary['SUMMARY'][0]['GHS 5s']
- accepted = summary['SUMMARY'][0]['Accepted']
- best = summary['SUMMARY'][0]['Best Share']
- rejected = round(summary['SUMMARY'][0]['Device Rejected%'],6)
- percent = round(HW / x * 100,6)
- uptime = round(float(summary['SUMMARY'][0]['Elapsed'] / 60.0 / 60.0),2)
- os.system('cls' if os.name == 'nt' else 'clear')
- found = summary['SUMMARY'][0]['Found Blocks']
- if found == 0:
- message = "Keep Trying!"
- else :
- message = "$$$YAY$$$"
- print ""
- print "##########################################################"
- print "#"
- print "# ANTMINER S4 - S7 STATISTICS"
- print "#"
- print "##########################################################"
- print "#"
- print "# Your current TH/s = ", "|", speed / 1000
- print "# "
- print "# Your Accepted # = ", "|", ('{:,}'.format(accepted))
- print "# "
- print "# Your rejected % = ", "|", rejected
- print "# "
- print "# Your current HW% = ", "|", percent
- print "# "
- print "# Your best share diff = ", "|", ('{:,}'.format(best))
- print "# "
- print "# Your uptime in hours = ", "|", uptime
- print "#"
- print "# Found Blocks Total = ", "|", found, message
- print "# "
- print "##########################################################"
- print ""
- sleep(int(update))
- def gaw():
- loop = 1
- while loop == 1:
- summary = cgminer.summary()
- HW = float(summary['SUMMARY'][0]['Hardware Errors'])
- diffa = float(summary['SUMMARY'][0]['Difficulty Accepted'])
- diffr = float(summary['SUMMARY'][0]['Difficulty Rejected'])
- x = HW + diffa + diffr
- speed = summary['SUMMARY'][0]['MHS 1m']
- accepted = summary['SUMMARY'][0]['Accepted']
- best = summary['SUMMARY'][0]['Best Share']
- rejected = round(summary['SUMMARY'][0]['Device Rejected%'],6)
- percent = round(HW / x * 100,6)
- uptime = round(float(summary['SUMMARY'][0]['Elapsed'] / 60.0 / 60.0),2)
- os.system('cls' if os.name == 'nt' else 'clear')
- print ""
- print "##########################################################"
- print "#"
- print "# GAW FURY or ZEUS BLIZZARD STATISTICS"
- print "#"
- print "##########################################################"
- print "#"
- print "# Your current MH/S = ", "|", speed
- print "# "
- print "# Your Accepted # = ", "|", ('{:,}'.format(accepted))
- print "# "
- print "# Your rejected % = ", "|", rejected
- print "# "
- print "# Your current HW% = ", "|", percent
- print "# "
- print "# Your best share diff = ", "|", ('{:,}'.format(best))
- print "# "
- print "# Your uptime in hours = ", "|", uptime
- print "# "
- print "##########################################################"
- print ""
- sleep(int(update))
- ##Choose device to modify output (eg. hashrate)
- msg3 = "Please Choose Device Type"
- x = indexbox(msg3, choices=["Gaw/Zeus","Antminer S1 or s3","Antminer s4-s7"])
- ##Display correct data based on device type
- if x == 1:
- antminer()
- elif x == 0:
- gaw()
- elif x == 2:
- s7()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement