When sending a getwork
request, one always includes an id
value. Does this value have any meaning? Will it cause problems to have multiple miners use the same id
? Furthermore, if I wanted to send some extra information to a mining pool server, would id
be an okay place to do it or should I add my own extra field?
Add a comment
|
1 Answer
If you are talking about the Bitcoin API, getwork only requires data
field, which is a place to put your solution.
However, I do believe that you are talking about the id
field of a JSON RPC command. It is used to identify a response to a given request. Generally, it might not be the best place to put extra information. There are already a few extensions to the getwork protocol that you might want to use instead.
-
I'm a little confused about the difference between the Bitcoin API and the JSON RPC API; I'm talking about the command a miner sends to the pool to get (or submit) work. Does this mean that if two miners both use the same
id
field and both find valid shares around the same time, only the share resulting from the more recentgetwork
request will be accepted by the pool? And is there a problem with adding an extra field to send extra information (not info supported by any current extension), or will that confuse pool servers? Commented Dec 7, 2012 at 16:46 -
@ConstableJoe The difference between Bitcoin API and JSON RPC, is the same as difference between HTML and HTTP - one builds on top of the other. JSON tells you how to send your data, it's like an envelope you address. Bitcoin API is like the stuff you put in that envelope - it can be a letter, but also confetti, strings or something else. Generally, you don't want to mess with the envelope when you can mess with its insides. Commented Dec 7, 2012 at 20:34
-
@ConstableJoe The
id
is used to identify the message, but from what I found most people just set it to 1 and it works fine. It might be useful when you are sending many packets. Then you yourself would know what you are receiving and so forth. I guess it's mainly useful for asynchronous communication or something. Adding extra information might confuse the pool. Generally, the pool received an array of data - if it sees a non-empty array, it assumes it's a solution and tries to read it. If it is not formatted like one, the result will most likely be an error. Commented Dec 7, 2012 at 20:36