Bitcoin Forum

Bitcoin => Project Development => Topic started by: joey325 on March 12, 2014, 11:45:31 PM



Title: [Bounty]How to make a program in C# that can retrive hash rate of cgminer
Post by: joey325 on March 12, 2014, 11:45:31 PM
I will give a bounty to anyone who can show me in C# how to receive that current hash rate of a CGMiner instance. thanks in advance!


Title: Re: [Bounty]How to make a program in C# that can retrive hash rate of cgminer
Post by: jazarja on March 13, 2014, 12:07:07 AM
how much is the bounty?


Title: Re: [Bounty]How to make a program in C# that can retrive hash rate of cgminer
Post by: furuknap on March 13, 2014, 12:08:33 AM
I will give a bounty to anyone who can show me in C# how to receive that current hash rate of a CGMiner instance. thanks in advance!

Is doing this through the RPC API acceptable? If so, it's a simple matter of reading some JSON. I could probably whip up an example for you.

.b


Title: Re: [Bounty]How to make a program in C# that can retrive hash rate of cgminer
Post by: joey325 on March 13, 2014, 12:13:59 AM
I will give a bounty to anyone who can show me in C# how to receive that current hash rate of a CGMiner instance. thanks in advance!

Is doing this through the RPC API acceptable? If so, it's a simple matter of reading some JSON. I could probably whip up an example for you.

.b

Yeah that's fine. Let me know how much BTC is reasonable for the job. thanks for the quick response!


Title: Re: [Bounty]How to make a program in C# that can retrive hash rate of cgminer
Post by: furuknap on March 13, 2014, 01:05:11 AM
I will give a bounty to anyone who can show me in C# how to receive that current hash rate of a CGMiner instance. thanks in advance!

Is doing this through the RPC API acceptable? If so, it's a simple matter of reading some JSON. I could probably whip up an example for you.

.b

Yeah that's fine. Let me know how much BTC is reasonable for the job. thanks for the quick response!

This isn't much of an effort because I had a few classes ready made. Please donate what you feel it's worth to you to Sean's Outpost at http://seansoutpost.com/donate/, they need it more than I do. Feel free to post the transaction after you donate, though :-)

I've uploaded a sample VS2013 project for you. You need to add JSON.NET from Nuget (or elsewhere) and please note that I only have a GPU rig available so you may need to create an ASIC and FPGA class similar to the GPU class I included. I've left some comments to indicate where. The format should be pretty straight forward and you can use the same pattern to pick up other properties from your devices too, like temperature, voltage, memory/GPU clock, etc.

https://mega.co.nz/#!U1AXRSQD!GEsYONyxidTWzY32zcM-S0b_PrmNVDJot77JbOPHkEw

No license or credit required, no support provided. It's all open-source and I've removed all built .exes. The file is about 8 kB.

If you don't have VS2013, just ignore the .sln file and open the csproj file in an earlier version. If you don't have any of those, all the class files are in the program.cs file.

.b


Title: Re: [Bounty]How to make a program in C# that can retrive hash rate of cgminer
Post by: furuknap on March 19, 2014, 07:06:32 AM
You're quite welcome!