DeathAndTaxes (OP)
Donator
Legendary
Offline
Activity: 1218
Merit: 1079
Gerald Davis
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 11, 2011, 03:06:42 PM |
|
Kano, I just got back from my vacation. Hopefully tonight or tomorrow I will be able to test latest version. Looks good so far.
|
|
|
|
tnkflx
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 11, 2011, 06:33:47 PM |
|
Kano,
Sorry about the long wait, I'm going to test this as soon as I can find some time... Hopefully this evening or tomorrow ;-)
|
| Operating electrum.be & us.electrum.be |
|
|
|
runeks
Legendary
Offline
Activity: 980
Merit: 1008
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 11, 2011, 11:26:47 PM Last edit: December 11, 2011, 11:59:06 PM by runeks |
|
Thank you Sir! I will be looking in to that. netstat -na displays a listening cgminer. It seems it was the missing -a switch that made it not show sockets on localhost. By the way, is this the most official description of the various API functions, or is there another place for that documentation?
|
|
|
|
runeks
Legendary
Offline
Activity: 980
Merit: 1008
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 12, 2011, 02:42:48 AM |
|
First of all, thank you for extending cgminer with this functionality! I'm planning on using it to control my Bitcoin Radiator (yes, that's right, stay tuned for updates), so it comes in handy for me. With regards to JSON, I disagree a bit on your position, but don't take that as me not appreciating your work. Though ... if someone actually has some really unexpected need for a JSON format response ... (I can think of no reason, since this format is way easier to read and parse but has a detail level equivalent to JSON for this requirement)
One reason for the JSON format would be that most languages has an implementation of it already. Thus no JSON parsing would be written, it would be handled by a separate library that has been written already. The following line in Python would replace a custom implementation of parsing your custom format: So I guess the reason to choose the JSON format is because it reduces redundancy. Chances are that in whichever language one chooses to write an application that wants to control cgminer, this language already has a JSON parsing implementation. You've written an implementation of your format in php, I'll have to write an implementation in Python, and someone who wants to use Ruby will have to write an implementation in Ruby, and so on and so forth for C, C++, Perl, bash, JavaScript, etc.
|
|
|
|
kano
Legendary
Offline
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 12, 2011, 05:38:08 AM |
|
Actually ... I've written and supplied the basics in C, Java and PHP ... If you can't work out the VERY simple code to parse the output from one of those 3 languages, then ... As I've said before, if anyone wants JSON they can add to the bounty. No one replied (fortunately) so it hasn't been added. I also said that if anyone was already listed in the bounty for me; then if they want it I guess I'll add it for them. Again, no reply to that either so JSON is out ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif)
|
|
|
|
runeks
Legendary
Offline
Activity: 980
Merit: 1008
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 12, 2011, 10:01:27 AM |
|
I tried translating your PHP example directly to Python. Does this look right? 'STATUS=S,CODE=11,MSG=Summary|SUMMARY=all,EL=42875,ALGO=sse2_64,MHS=722.96,SOL=583,Q=59563,A=517,R=66,HW=0,U=0.72,DW=10075,STATUS=S,CODE=11,MSG=Summary|SUMMARY=all,EL=42875,ALGO=sse2_64,MHS=722.96,SOL=583,Q=59563,A=517,R=66,HW=0,U=0.72,DW=10075,ST=0,GF=65,LW=0,RO=0,BC=2801|' becomes {'STATUS': {'STATUS': 'S', 'MSG': 'Summary', 'CODE': '11'}, 1: {'A': '517', 'EL': '42875', 'RO': '0', 'LW': '0', 'BC': '2801', 'SOL': '583', 'SUMMARY': 'all', 'Q': '59563', 'GF': '65', 'R': '66', 'U': '0.72', 'ALGO': 'sse2_64', 'DW': '10075', 'HW': '0', 'ST': '0', 'MHS': '722.96'}, 'SUMMARY': {'A': '517', 'EL': '42875', 'CODE': '11', 'STATUS': 'S', 'SOL': '583', 'SUMMARY': 'all', 'Q': '59563', 'R': '66', 'U': '0.72', 'ALGO': 'sse2_64', 'MSG': 'Summary', 'DW': '10075', 'HW': '0', 'MHS': '722.96'}}
'STATUS=S,CODE=17,MSG=GPU1|GPU=1,GT=69.00,FR=2575,FP=56,EN=Y,STA=ALIVE,MHS=365.10,A=271,R=19,HW=0,U=0.38,I=9|' becomes {'STATUS': {'STATUS': 'S', 'MSG': 'GPU1', 'CODE': '17'}, 'GPU1': {'FP': '56', 'A': '271', 'FR': '2575', 'GT': '69.00', 'STA': 'ALIVE', 'I': '9', 'HW': '0', 'EN': 'Y', 'U': '0.38', 'GPU': '1', 'R': '19', 'MHS': '365.10'}}
'STATUS=S,CODE=20,MSG=GPU count|GPUS,COUNT=2|' becomes {'STATUS': {'STATUS': 'S', 'MSG': 'GPU count', 'CODE': '20'}, 'GPUS': {0: 'GPUS', 'COUNT': '2'}} EDIT: The code is this:def parseResponse(message): data = {} objs = message.split('|')
for obj in objs: if (len(obj) > 0): items = obj.split(',') item = items[0] item_id = items[0].split('=', 1) if (len(item_id) == 1 or not item_id[1].isdigit()): name = item_id[0] else: name = item_id[0] + item_id[1]
if (len(name) == 0): name = "null"
if (name in data): num = 1 while ((name+str(num)) in data): num =+ 1 name =+ str(num)
counter = 0
for item in items: item_id = item.split('=', 2) if not (name in data): data[name] = {} if (len(item_id) == 2): data[name][item_id[0]] = item_id[1] else: data[name][counter] = item_id[0]
counter =+ 1
return data
|
|
|
|
kano
Legendary
Offline
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 12, 2011, 10:43:42 AM |
|
Yeah looks OK. I guess ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif) Edit: no actually the SUMMARY one is messed up there's only supposed to be 2 sections "STATUS" and "SUMMARY" One thing I noticed up front is that you are running an older version of cgminer - the newest version uses full descriptions for the field names. Current one is 2.0.8y It also has no exception to the rule of the reply format (earlier there was an exception to the rule: 'apiversion' - that's gone and now there is only 'version' which uses the same format as the rest) ... and it shows more GPU details that were missing before. Note to DeathAndTaxes if you see this: I keep thinking about the "MHS 5s" fields. That means you already have the field description correct, however, you can't search for it by full name, since it's name will change to match --log So if --log is 7 the field will be called "MHS 7s" Is that OK? Or would you prefer 2 fields instead something like: MHS Ns=1234.99 and Log Interval=5 Thus you can directly index access the field with "MHS Ns" (or both these 2 and the old 1)
|
|
|
|
DeathAndTaxes (OP)
Donator
Legendary
Offline
Activity: 1218
Merit: 1079
Gerald Davis
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 12, 2011, 01:30:38 PM |
|
Note to DeathAndTaxes if you see this: I keep thinking about the "MHS 5s" fields. That means you already have the field description correct, however, you can't search for it by full name, since it's name will change to match --log So if --log is 7 the field will be called "MHS 7s" Is that OK? Or would you prefer 2 fields instead something like: MHS Ns=1234.99 and Log Interval=5 Thus you can directly index access the field with "MHS Ns" (or both these 2 and the old 1)
Um you sure it was me? I haven't looked at the MHS fields yet. Sorry coming back from a cruise, and getting caught up at work is brutal. Hopefully I can get a chance to look at it tonight.
|
|
|
|
kano
Legendary
Offline
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 12, 2011, 07:47:06 PM |
|
No - it was me - but you seemed to be the best person to ask ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif) (it's something I've been thinking about since after I made that last change)
|
|
|
|
|
gnar1ta$
Donator
Hero Member
Offline
Activity: 798
Merit: 500
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 16, 2011, 11:06:23 PM |
|
Is this being paid out yet or still testing?
|
Losing hundreds of Bitcoins with the best scammers in the business - BFL, Avalon, KNC, HashFast.
|
|
|
-ck
Legendary
Offline
Activity: 4214
Merit: 1644
Ruu \o/
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 16, 2011, 11:20:57 PM |
|
Kano has been very responsive and quick to develop this, but very few have tested it, and no one has paid him yet. I quite like what I see so far.
|
Developer/maintainer for cgminer, ckpool/ckproxy, and the -ck kernel 2% Fee Solo mining at solo.ckpool.org -ck
|
|
|
DeathAndTaxes (OP)
Donator
Legendary
Offline
Activity: 1218
Merit: 1079
Gerald Davis
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 17, 2011, 12:13:42 AM |
|
Kano has been very responsive and quick to develop this, but very few have tested it, and no one has paid him yet. I quite like what I see so far.
I apologize for this. I was gone of vacation and since coming back I have been overwhelmed at work. I just don't have the time to put the code through its paces. However based on my limited testing I am going to pay out my portion of the bounty now. Kano shouldn't be penalized due to a lack of testing. I anticipate if any issues are discovered after payment Kano has sufficient incentive to resolve them in order to collect rest of bounty. I sent a PM to Kano to verify the address he wants payment at. Once I get that I will payout 30 BTC.
|
|
|
|
gnar1ta$
Donator
Hero Member
Offline
Activity: 798
Merit: 500
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 17, 2011, 12:43:51 AM |
|
I have no problem paying out on the progress made, just need an address - sig address ok Kano?
|
Losing hundreds of Bitcoins with the best scammers in the business - BFL, Avalon, KNC, HashFast.
|
|
|
kano
Legendary
Offline
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 17, 2011, 12:26:43 PM |
|
Yep sig is fine - just post or PM me so I know who it came from. No worries about the time as long as I get paid if I've done what's required. Though waiting longer seems to be making the bounty worth more ![Cheesy](https://bitcointalk.org/Smileys/default/cheesy.gif) (BTC is now worth more) I mainly just want to get it into ckolivas' git so I can work on it on a proper fork of his git and also sort if there are any problems he finds with what I've done and fix them. Even from my point of view there's more that I'll do (and I've already got the extra interface programs and PHP web page written as everyone already knows) Though the next thing I will probably do is look at the cgminer shutdown code (which may get rid of the windows crash) Then add more API stuff to send more commands to cgminer (e.g. GPU settings etc)
|
|
|
|
DeathAndTaxes (OP)
Donator
Legendary
Offline
Activity: 1218
Merit: 1079
Gerald Davis
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 17, 2011, 06:39:47 PM Last edit: December 17, 2011, 07:46:24 PM by DeathAndTaxes |
|
30 BTC sent to 1LPbuDSPT4DdYbwiqAVWDJm2sHHuh6PnqB
It is coming from one of my exchange account so I have no idea what address it will be sent from. Thanks for all the good work so far.
|
|
|
|
kano
Legendary
Offline
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 17, 2011, 09:24:51 PM |
|
Thanks DeathAndTaxes and gnar1ta$ got both of yours. OK so I better update the docs first today ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif) (yeah I forgot that needs to be done next before anything else)
|
|
|
|
Red Emerald
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 17, 2011, 11:22:29 PM |
|
Just got the miner compiled. As soon as I get an RPC command sent, I'll send you the bounty.
Then I'll probably start working on a fork that uses JSON so that devs won't have to write their own parsers.
|
|
|
|
kano
Legendary
Offline
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 18, 2011, 12:41:57 AM |
|
Just got the miner compiled. As soon as I get an RPC command sent, I'll send you the bounty.
Then I'll probably start working on a fork that uses JSON so that devs won't have to write their own parsers.
LOL - you didn't read my posts? Since you're a bounty payer and you seem to want JSON also, I'll just do that next. (I've already said that as an option before but no one bothered to reply ... ... ...) Of course it will be done the simplest way: If the string sent over the socket starts with '{' then I'll assume it's JSON and reply with a JSON string. If the string sent doesn't start with '{' then it's the same as it is now with the same simpler reply. As for doing your own fork ... you do realise what you are in for if you do that? Do you use windows or was your fork just going to ignore that? Edit: P.S. the basic parser is already written in 3 languages, so "devs" shouldn't have any issues ... ...
|
|
|
|
Red Emerald
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
December 18, 2011, 12:56:33 AM |
|
Just got the miner compiled. As soon as I get an RPC command sent, I'll send you the bounty.
Then I'll probably start working on a fork that uses JSON so that devs won't have to write their own parsers.
LOL - you didn't read my posts? Since you're a bounty payer and you seem to want JSON also, I'll just do that next. (I've already said that as an option before but no one bothered to reply ... ... ...) Of course it will be done the simplest way: If the string sent over the socket starts with '{' then I'll assume it's JSON and reply with a JSON string. If the string sent doesn't start with '{' then it's the same as it is now with the same simpler reply. As for doing your own fork ... you do realise what you are in for if you do that? Do you use windows or was your fork just going to ignore that? Edit: P.S. the basic parser is already written in 3 languages, so "devs" shouldn't have any issues ... ... Github makes forking really easy. I don't think that the JSON code would have anything platform specific, so don't know how being on windows would make a difference. Although if you want to do it, that would be even better since you already know this part of the code. The string that gets returned isn't consistent. "STATUS=S" starts the first section, but "SUMMARY" starts the second. EDIT: I just sent 10BTC to the address in your sig.
|
|
|
|
|