Bitcoin Forum
May 02, 2024, 05:03:46 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3] 4 5 6 7 8 »  All
  Print  
Author Topic: [ANN] NiceHash Control 1.1.1 - Auto profit switching control for NiceHash servic  (Read 29974 times)
crazycoin
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
July 05, 2014, 07:58:56 PM
 #41

Hi, is there any chance to get Linux version of the program?
1714669426
Hero Member
*
Offline Offline

Posts: 1714669426

View Profile Personal Message (Offline)

Ignore
1714669426
Reply with quote  #2

1714669426
Report to moderator
1714669426
Hero Member
*
Offline Offline

Posts: 1714669426

View Profile Personal Message (Offline)

Ignore
1714669426
Reply with quote  #2

1714669426
Report to moderator
1714669426
Hero Member
*
Offline Offline

Posts: 1714669426

View Profile Personal Message (Offline)

Ignore
1714669426
Reply with quote  #2

1714669426
Report to moderator
If you want to be a moderator, report many posts with accuracy. You will be noticed.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714669426
Hero Member
*
Offline Offline

Posts: 1714669426

View Profile Personal Message (Offline)

Ignore
1714669426
Reply with quote  #2

1714669426
Report to moderator
1714669426
Hero Member
*
Offline Offline

Posts: 1714669426

View Profile Personal Message (Offline)

Ignore
1714669426
Reply with quote  #2

1714669426
Report to moderator
StuffOfInterest (OP)
Sr. Member
****
Offline Offline

Activity: 401
Merit: 250


View Profile
July 06, 2014, 12:38:06 AM
 #42

Hi, is there any chance to get Linux version of the program?

Sorry, but unless someone can point me to a good Linux implementation of .NET Framework Windows Forms it isn't going to happen.

The application is written in C# for Windows Forms.  The meat and potatoes part of the application is only about 450 lines right now, so it could probably be wrapped into some sort of console application.  Over half of that 450 lines is related to user interface for showing numbers and controlling the start/stop buttons.  Not sure how you would handle the UI under that scenario as currently a separate window pops up with the miner.

Unrelated, there was a nice mention of NiceHash control over at Crypto Mining Blog.  Have to admit, it gave me a bit of a rush when I saw my own work pop up on my Feedly list. Smiley

Also, a big thanks to whoever made the donation today.  Always very much appreciated.

BExR exchange rates on your phone's home screen.
Miner Control to get auto algorithm switching for multiple mining services. (please donate if you like)
Could Proof of Blockchain (PoBC) help secure a coin and avoid runaway ASIC mining?
guitarplinker
Legendary
*
Offline Offline

Activity: 1694
Merit: 1024



View Profile WWW
July 06, 2014, 12:45:31 AM
 #43

Do you plan to ever open-source this program?

If it was programmed in Basic .NET then I would like to take a look at how you set up the API/JSON in the program. I just started programming in Basic a few months ago so I know a little bit, but I'd like to figure out how to set up API and JSON to work in my programs.
StuffOfInterest (OP)
Sr. Member
****
Offline Offline

Activity: 401
Merit: 250


View Profile
July 06, 2014, 01:30:09 AM
 #44

Do you plan to ever open-source this program?

If it was programmed in Basic .NET then I would like to take a look at how you set up the API/JSON in the program. I just started programming in Basic a few months ago so I know a little bit, but I'd like to figure out how to set up API and JSON to work in my programs.

Definitely plan to release the source.  That is, once I've cleaned it up enough to avoid dropping dead of embarrassment from the bad coding practices currently in there.

Regarding JSON, I did this using the .NET built in JSON serializer vs. any 3rd party libraries such as JSON.NET.  The built in serializer is pretty crippled, but can be made to work with a little help here and there.  For your reading enjoyment, here is the code I'm using to retrieve balances via the NiceHash API:

Code: (C#)
        private void CheckBalances()
        {
            try
            {
                byte[] pageData;
                using (var client = new WebClient())
                {
                    var url = string.Format("https://www.nicehash.com/api?method=stats.provider&addr={0}", _address);
                    pageData = client.DownloadData(url);
                }
                var pageString = System.Text.Encoding.Default.GetString(pageData);
                var serializer = new JavaScriptSerializer();
                var data = serializer.DeserializeObject(pageString) as Dictionary<string, object>;
                var result = data["result"] as Dictionary<string, object>;
                var stats = result["stats"] as object[];
                foreach (var stat in stats)
                {
                    var item = stat as Dictionary<string, object>;
                    var algo = int.Parse(item["algo"].ToString());
                    var entry = _priceEntries.FirstOrDefault(o => (int)o.Id == algo);
                    if (entry == null) continue;

                    entry.Balance = ExtractDecimal(item["balance"]);
                    entry.AcceptSpeed = ExtractDecimal(item["accepted_speed"]) * 1000;
                    entry.RejectSpeed = ExtractDecimal(item["rejected_speed"]) * 1000;
                }
            }
            catch
            {
            }
        }

        private decimal ExtractDecimal(object raw)
        {
            var decimalValue = raw as decimal?;
            if (decimalValue.HasValue) return decimalValue.Value;

            var doubleValue = raw as double?;
            if (doubleValue.HasValue) return (decimal)doubleValue.Value;

            var floatValue = raw as float?;
            if (floatValue.HasValue) return (decimal)floatValue.Value;

            var longValue = raw as long?;
            if (longValue.HasValue) return (decimal)longValue.Value;

            var intValue = raw as int?;
            if (intValue.HasValue) return (decimal)intValue.Value;

            decimal parseValue;
            var style = NumberStyles.AllowDecimalPoint;
            var culture = CultureInfo.CreateSpecificCulture("en-US");

            if (decimal.TryParse(raw.ToString(), style, culture, out parseValue)) return parseValue;

            return 0;
        }

Note the empty catch statement, which is bad practice.  Also, I had to do the long winded decimal extraction method to work around issues with number representation in the parsed JSON.  Current version is overkill but at least you know it will get the job done.

If you plan on going into programming as a career, I highly recommend concentrating more on C# than Visual Basic.NET.  More opportunities out there.  Also, C# is closely related to other C derived languages (such as Java) so it will be easier to pickup some of these as you progress.  Good luck.

BExR exchange rates on your phone's home screen.
Miner Control to get auto algorithm switching for multiple mining services. (please donate if you like)
Could Proof of Blockchain (PoBC) help secure a coin and avoid runaway ASIC mining?
guitarplinker
Legendary
*
Offline Offline

Activity: 1694
Merit: 1024



View Profile WWW
July 06, 2014, 03:19:47 AM
 #45

Alright thanks for all the advice!

I can sort of follow your coding, but it's mostly way over my current coding level.

I'll also have to look into learning C#, I know it's a highly used language much more so than VB .NET.
ltc_bilic
Member
**
Offline Offline

Activity: 130
Merit: 10


View Profile
July 06, 2014, 10:04:09 AM
 #46

Just what I was looking for. But lot's of my miners are still on Win XP 32 bit, can you make the app compatible without rewriting the whole code?

Thanks for all you're work!
StuffOfInterest (OP)
Sr. Member
****
Offline Offline

Activity: 401
Merit: 250


View Profile
July 06, 2014, 11:53:19 AM
 #47

Just what I was looking for. But lot's of my miners are still on Win XP 32 bit, can you make the app compatible without rewriting the whole code?

Thanks for all you're work!

Let's give this a try.

NiceHashControl-1.0.3-xp.zip

I lowered the .NET version to 4.0, which can be run on Windows XP.  As long as you have .NET Framework 4.0 installed this should work.  Nothing in the application was using 4.5 yet so it doesn't hurt.  Be warned, at some point if I get creative and start using .NET 4.5 features there may be a freeze of the application which supports .NET 4.0.

If this version works I'll do all application targeting towards .NET 4.0 for the main version releases.

BExR exchange rates on your phone's home screen.
Miner Control to get auto algorithm switching for multiple mining services. (please donate if you like)
Could Proof of Blockchain (PoBC) help secure a coin and avoid runaway ASIC mining?
CZSpitfire
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
July 06, 2014, 03:05:48 PM
 #48

ATI remake
https://twitter.com/CryptoAlgoX/status/485789392729305088
StuffOfInterest (OP)
Sr. Member
****
Offline Offline

Activity: 401
Merit: 250


View Profile
July 06, 2014, 03:53:03 PM
 #49


Umm, no remake is necessary.  NiceHash Control can launch any miner (or a batch file which launches a miner).  It is just a matter of setting everything up in the NiceHashControl.conf file.

BExR exchange rates on your phone's home screen.
Miner Control to get auto algorithm switching for multiple mining services. (please donate if you like)
Could Proof of Blockchain (PoBC) help secure a coin and avoid runaway ASIC mining?
ltc_bilic
Member
**
Offline Offline

Activity: 130
Merit: 10


View Profile
July 06, 2014, 04:33:56 PM
 #50

OMG, you're amazing! it's working on win xp with no issues. Do you have a ltc adress so I can donate for you're work?

Is it possible to roll the app to system tray? There should be a silent mode perhaps for those of us who can run miners on a campus Wink
This is sgminer 5.0 with auto algo switching for nvidia users Wink
StuffOfInterest (OP)
Sr. Member
****
Offline Offline

Activity: 401
Merit: 250


View Profile
July 06, 2014, 04:48:54 PM
Last edit: July 07, 2014, 01:31:39 AM by StuffOfInterest
 #51

OMG, you're amazing! it's working on win xp with no issues. Do you have a ltc adress so I can donate for you're work?

Is it possible to roll the app to system tray? There should be a silent mode perhaps for those of us who can run miners on a campus Wink
This is sgminer 5.0 with auto algo switching for nvidia users Wink

LTC: LPwhwy6edinDh6gN4ZKaAVgNkArZp6qfeu
LTC: LSKw8y56gwKUpfcEtGwXph7eVyyUfFrSvt

Glad it worked for you. Guess I'll stick with .NET 4 for the builds.

Minimize to tray can go on the "to do" list.

EDIT: If anyone else wants to send LTC, please don't use the first address I provided (now struck out).  That one was to an exchange which had a far too high withdrawl fee.  Now pointed to someplace friendlier to the wallet.

BExR exchange rates on your phone's home screen.
Miner Control to get auto algorithm switching for multiple mining services. (please donate if you like)
Could Proof of Blockchain (PoBC) help secure a coin and avoid runaway ASIC mining?
ltc_bilic
Member
**
Offline Offline

Activity: 130
Merit: 10


View Profile
July 06, 2014, 07:18:19 PM
 #52

I've sent you some coins, for a beer or two Wink
StuffOfInterest (OP)
Sr. Member
****
Offline Offline

Activity: 401
Merit: 250


View Profile
July 06, 2014, 07:55:41 PM
 #53

I've sent you some coins, for a beer or two Wink

Wow, thanks!  That will actually cover a couple of bottles of wine!  Grin

BExR exchange rates on your phone's home screen.
Miner Control to get auto algorithm switching for multiple mining services. (please donate if you like)
Could Proof of Blockchain (PoBC) help secure a coin and avoid runaway ASIC mining?
StuffOfInterest (OP)
Sr. Member
****
Offline Offline

Activity: 401
Merit: 250


View Profile
July 07, 2014, 02:26:21 AM
Last edit: July 07, 2014, 02:38:45 AM by StuffOfInterest
 #54

Based on a generous donation, I've gone ahead and added in a minimize to tray capability.

NiceHashControl-1.0.4.zip

Launch with a command line parameter of "-t" and then when you minimize the app it will drop into the tool tray.  Double click the tool tray icon to restore.  Also, if a miner is running, the window will be hidden while the control app is minimized.  The miner is restored once the control app is displayed.

There is one current side effect with hiding the miner.  If the mining algorithm switches while the application is minimized the control program is not able to bring it back on screen as it starts with no user interface.  I'll work on a fix for this but it is not too high of priority right now.  The easiest workaround I know for it would be to start the miner on screen and then hide it.  This would cause a flicker in the taskbar that a user might now like if they are running in stealth mode.  Fortunately, you can still stop the miner if it is hidden so if you need to see what is happening just hit the stop button and then the auto button again.

This version is now 32-bit and Windows XP friendly by default.

Happy, hidden mining.

BExR exchange rates on your phone's home screen.
Miner Control to get auto algorithm switching for multiple mining services. (please donate if you like)
Could Proof of Blockchain (PoBC) help secure a coin and avoid runaway ASIC mining?
ltc_bilic
Member
**
Offline Offline

Activity: 130
Merit: 10


View Profile
July 07, 2014, 07:27:35 AM
 #55

Wow, that was fast! I'll give it a good test  Smiley to see how it works
Tamis
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250



View Profile
July 07, 2014, 10:55:09 AM
 #56

I'm not sure the hidden mining option is a smart move as I can only see negative reasons to use it...
ltc_bilic
Member
**
Offline Offline

Activity: 130
Merit: 10


View Profile
July 07, 2014, 11:21:44 AM
 #57

I'm not sure the hidden mining option is a smart move as I can only see negative reasons to use it...

It's an option you don't need to use it  Smiley in my case it's essential before I was running a GPU farm on a campus now I've moved all the cards to our office (yes I'm the owner - so it's not illegal anymore Wink)

Today I was testing it, but unfortunately there was not a lot of switching done today, but when I was running it yesterday I remember there were quite a lot of switching happening for 1/2 min back and forth,...so I think you should consider implementing a "5 min buffer", where it would keep track of the new price and it won't switch immediately as of now, but after 5 min if the new price is still better then current,...this would avoid the constant switching if you're specs are very similar for different algos like x11 and x13. Yes when you minimize it you cannot bring up the miner window and you can only manually stop and start in order to see what's going on well it's not an elegant solution. IMO the next step would be to include the miner window on Control Form right next to Activity tab, and print out the last few lines of what's happening, so in this case you would avoid the previous issue and have an elegant overview of what's happening with the miner. Some people would like to see the gpu temp fan speed and all the neat stuff that cuda manager has, but I don't think it's necessary because it's meant to be used with newer generation nvidia cards and those suckers are running cool and quiet  Roll Eyes

More important feature for "todo list" would be to the lack of backup pools in ccminer/cudaminer so to detect if there's a problem with hashing and miner starts running on a backup pool. When situation goes to normal tries to switch back to the most profitable nicehash algo.

Will continue to test and report back.
StuffOfInterest (OP)
Sr. Member
****
Offline Offline

Activity: 401
Merit: 250


View Profile
July 07, 2014, 11:29:24 AM
 #58

I'm not sure the hidden mining option is a smart move as I can only see negative reasons to use it...

I actually started using the option for myself as I run the miner on my main PC and putting it in the tool tray helps to unclutter the task bar.  Yes, it could be used for more nefarious reasons but hopefully people will use their own discretion.  Good way to get kicked off of a network like the fool who used a university supercomputer to mine Bitcoins.

BExR exchange rates on your phone's home screen.
Miner Control to get auto algorithm switching for multiple mining services. (please donate if you like)
Could Proof of Blockchain (PoBC) help secure a coin and avoid runaway ASIC mining?
StuffOfInterest (OP)
Sr. Member
****
Offline Offline

Activity: 401
Merit: 250


View Profile
July 07, 2014, 11:41:34 AM
 #59

Today I was testing it, but unfortunately there was not a lot of switching done today, but when I was running it yesterday I remember there were quite a lot of switching happening for 1/2 min back and forth,...so I think you should consider implementing a "5 min buffer", where it would keep track of the new price and it won't switch immediately as of now, but after 5 min if the new price is still better then current,...this would avoid the constant switching if you're specs are very similar for different algos like x11 and x13. Yes when you minimize it you cannot bring up the miner window and you can only manually stop and start in order to see what's going on well it's not an elegant solution. IMO the next step would be to include the miner window on Control Form right next to Activity tab, and print out the last few lines of what's happening, so in this case you would avoid the previous issue and have an elegant overview of what's happening with the miner. Some people would like to see the gpu temp fan speed and all the neat stuff that cuda manager has, but I don't think it's necessary because it's meant to be used with newer generation nvidia cards and those suckers are running cool and quiet  Roll Eyes

The time buffer is definitely moving up on my priority list as I was getting hit by the same flickering between x11 and x13 yesterday.  A couple of days ago I actually had it go between x11, x13, x15, and Nist5 all in the span of a couple of hours.

My plan is to implement a pre-buffer and a post-buffer for the switching.  The pre-buffer will prevent switching for an amount of time in case the algorithm switches and switches back over just a minute or two.  The post-buffer will act as a minimum amount of time to mine so that once a switch does occur it won't switch again for that amount of time.  If the kid goes to bed early enough the next couple of nights I might have time to work on it during my 9:00 PM to 10:30 PM "me time" window.

Regarding showing a section of the output in the control program, I've thought about that.  CUDA Manager does exactly that.  This wouldn't be too difficult with cudaMiner and ccminer as they use basic output which can be captured and shown elsewhere.  The problem comes in with programs like sgminer or the ccminer-splitscreen branch which has a more interactive display.  I have no idea how bad this would interact with a straight dump.

More important feature for "todo list" would be to the lack of backup pools in ccminer/cudaminer so to detect if there's a problem with hashing and miner starts running on a backup pool. When situation goes to normal tries to switch back to the most profitable nicehash algo.

Nothing I can do there.  I could be wrong but cudaMiner may support backup pools already.  I know ccminer doesn't but from what I've been reading on the appropriate thread there are a couple of people interested in implementing it.

I've thought about trying to do something from the NiceHash control program to handle switching but there are so many issues it just hasn't been worth looking too deep into so far.  Fortunately, the down time for NiceHash has been infrequent enough that it hasn't been a major issue for me.

BExR exchange rates on your phone's home screen.
Miner Control to get auto algorithm switching for multiple mining services. (please donate if you like)
Could Proof of Blockchain (PoBC) help secure a coin and avoid runaway ASIC mining?
ltc_bilic
Member
**
Offline Offline

Activity: 130
Merit: 10


View Profile
July 07, 2014, 12:03:37 PM
 #60

I don't think cudaminer nor ccminer have backup functionality at this moment, someone correct me if I'm wrong. But I've seen this: https://github.com/KBomba/failover-ccminer-bat but didn't have the time to test it out.
Pages: « 1 2 [3] 4 5 6 7 8 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!