Firstly ... and just in case it isn't obvious ...
I'm not asking anyone to pay me the bounty now.
I just want feedback to ensure it is what's required or what needs changing.
Of course once it is what's required ... then yes I'll be chasing bounties
abracadabra, I'll respond to each of your points since I guess others may not
fully understand what it does and how it works.
However, some of your questions are due to not reading all my posts.
I have posted quite a bit so yes unfortunately you should read them all
Anyway ...
Kano, sorry haven't checked this thread recently, with Thanksgiving last week. Didn't realize someone was going to take this on so quickly (and cheaply
j/k)
Anyways.. see my comments inline below.. please forgive the newbishness of some of my questions..
The .php would be run locally?
The point of an RPC interface is something you can access to get information from cgminer
Currently, you look at the screen and respond with keystrokes to what you see
I've added a socket interface that anyone can access with software and also given 2 sample
programs that do that - api-example.php and API.class (API.java)
How the interface works is you simply either just run cgminer as you always do,
or use one or two of the new options.
the new cgminer always has the RPC interface available but by default only listens
to commands sent from the same computer it is running on.
the --api-listen option changes that to allow any computer that has network access
to the miner computer to send it commands.
The point of the RPC interface is so that you can control cgminer via software instead
of only via the keyboard - thus as an example you could write a web page using php
that shows you the status of the miner and also has options to send it commands
e.g. the simple api-example.php shows the basic rules of how to do that and then you just
add your own web page design on top of that.
6 files added/changed from current ckolivas master:
main.c, miner.h, AUTHORS, api.c, api-example.php, Makefile.am
(also has the updated linux-usb-cgminer)
OK so this obviously isn't final (though it does work fine for me)
Anyone who can build their own cgminer and is interested could you have a look?
Not sure if this should have been mentioned earlier, but I need a windows version and unfortuantely I can't build from scratch.
Yes as quoted by conman, there is a windows version to test it out
It currently has 3 API commands:
apiversion - returns a version string "0.1"
dev - returns a status string of all the devices (CPU and or GPU)
pool - returns a status string of all the pools
Do the status strings differentiate the data returned as to which "rig" and which GPU on said "rig"? ie. Is the name of the "rig" returned with the status string? Or we have to remember which one were were just talking to when we got the status return?
The return data is from the rig you are talking to.
If you would like, I could add another option to cgminer --api-description that would be returned in the status section of the return data.
But of course, that would require you to specify that when you run cgminer.
Another option is I could return the hostname or some windows equivalent, however that is not always useful unless you gave the computer a useful name when you set it up.
The --api-description idea is a very simple change so if that solves your problem, just say you want that.
The included PHP file (api-example.php) simply converts the returned string into a data structure
Very simple and very easy in PHP the way I've done it.
No I'm not expecting people to give me bitcoins yet ...
The 3 main questions I have are:
1) what other API commands do people want
2) what parameters should I add to cgminer: --api-port = 4028, --api-address = 127.0.0.1, --api-access = 192.168.5.* and anything else?
I'm assuming --api-port & --api-address is the port and address of the actual "rig" we are talking to? --api-access is the ip of the computer allowed to communicate with the rig?
the numbers shown are of course examples
(I haven't added any parameters yet)
3) what socket I/O do people want: by this I mean: default port and access restriction.
It currently runs on port 4028 and only listens on 127.0.0.1 - for security reasons of course.
I guess I don't get this. I understand listening port, but what other ip would the "rig" running cgminer listen to other than it's own?
I updated that info later. Read past that post for the details of the 2 new cgminer options, however to explain the numbers:
It either listens on 127.0.0.1 or on 0.0.0.0
What 127.0.0.1 means is that it will only respond to a message sent from the mining computer to the address 127.0.0.1 - i.e. it is pretty secure.
What 0.0.0.0 means it will listen (and reply) to a message from any computer that has network access to it - i.e. this could be a security issue for some.
So the default is 127.0.0.1 (but --api-listen makes it the other)
Edit: it does no mutex locking access to the cpu/gpu/pool info since it would appear that is OK
(the current code doesn't appear to do that either)
ckolivas - does that sound correct to you?
No idea what this means.
ckolivas responded to that part of the post later.
I was simply verifying that what I thought was true was correct
Edit2: minor change - it wasn't closing the connection if an invalid command was sent
Edit3: added 'quit' and 'summary'
Do you have any screenshots of what frontend you have running for you right now?
Thanks!
I simply just run api-example.php at a termina/command prompt (or API.class)
So the last post where I posted all the output is what I see in my terminal excluding the reformatted data
(since it's the same data but just formatted neatly)
https://bitcointalk.org/index.php?topic=52466.msg634588#msg634588Also, only 4 of the commands show anything on the cgminer screen:
cguenable|N, gpudisable|N, gpurestart|N, quit
The first 3 show as I said above in that link, and of course quit makes cgminer exit.