Bitcoin Forum
May 05, 2024, 12:55:00 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Documentation needed for a pool (wire level protocol)?  (Read 1858 times)
NetTecture (OP)
Full Member
***
Offline Offline

Activity: 140
Merit: 100


View Profile
June 23, 2011, 05:44:01 PM
 #1

Can anyone pont me to some relevant documentation for the protocols needed for a pool / miner proxy?

I.e. whom to talk to (i assume a bitcoin server), what protocols / ports etc. to use.

Just trying to get a decent start here. Any lightweight sample code pointer also welcome... just I dont really talk PHP Wink

Regards

Wink NetTecture
1714913700
Hero Member
*
Offline Offline

Posts: 1714913700

View Profile Personal Message (Offline)

Ignore
1714913700
Reply with quote  #2

1714913700
Report to moderator
You get merit points when someone likes your post enough to give you some. And for every 2 merit points you receive, you can send 1 merit point to someone else!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
d3m0n1q_733rz
Sr. Member
****
Offline Offline

Activity: 378
Merit: 250



View Profile WWW
June 23, 2011, 06:05:47 PM
 #2

As long as you don't talk SQL, you'll survive.

Funroll_Loops, the theoretically quicker breakfast cereal!
Check out http://www.facebook.com/JupiterICT for all of your computing needs.  If you need it, we can get it.  We have solutions for your computing conundrums.  BTC accepted!  12HWUSguWXRCQKfkPeJygVR1ex5wbg3hAq
fpgaminer
Hero Member
*****
Offline Offline

Activity: 560
Merit: 517



View Profile WWW
June 23, 2011, 06:26:09 PM
 #3

Mining software must communicate with a pool/proxy/bitcoind for two reasons; to get work and to submit work.

The most common protocol (supported by every mining software I've seen) for that is JSON-RPC: http://en.wikipedia.org/wiki/JSON-RPC.

This is the request a miner makes to the server to get new work:
Code:
{"params": [], "method": "getwork", "id": "json"}

An example response by the server:
Code:
{"id":"json","error":null,"result":{"midstate":"b07ab2ccf48b89a0217384c1299d8b7e7cc9bb7ac16dd1366d9955669cb253aa","target":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000","data":"0000000146f6a6158418099f9c3a68ffec435166cfdb9eef51479153000001ee000000004d3a3c9c00dc8b69df7c0e9b4f3fa4ea587cddd2392d186e9dca1b5ea1669ea74e03844d1a13218500000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000","hash1":"00000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000010000"}}

An example of the request made by a miner to submit results:
Code:
{"params": ["000000019a086f0290f4b6d34a6e1b8a4b9974d585819abcd8e8f3d400000b5d00000000aaf9271bb6c2892dd5f96a71da1ed4be9b234f74a8de246acd91851a6639e1904e0384731a132185d1684680000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000"], "method": "getwork", "id": "json"}

And the server's response (if the result was correct):
Code:
{"id":"json","error":null,"result":true}

NetTecture (OP)
Full Member
***
Offline Offline

Activity: 140
Merit: 100


View Profile
June 23, 2011, 07:25:17 PM
 #4

Mining software must communicate with a pool/proxy/bitcoind for two reasons; to get work and to submit work.

The most common protocol (supported by every mining software I've seen) for that is JSON-RPC: http://en.wikipedia.org/wiki/JSON-RPC.

This is the request a miner makes to the server to get new work:
Code:
{"params": [], "method": "getwork", "id": "json"}

An example response by the server:
Code:
{"id":"json","error":null,"result":{"midstate":"b07ab2ccf48b89a0217384c1299d8b7e7cc9bb7ac16dd1366d9955669cb253aa","target":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000","data":"0000000146f6a6158418099f9c3a68ffec435166cfdb9eef51479153000001ee000000004d3a3c9c00dc8b69df7c0e9b4f3fa4ea587cddd2392d186e9dca1b5ea1669ea74e03844d1a13218500000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000","hash1":"00000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000010000"}}

An example of the request made by a miner to submit results:
Code:
{"params": ["000000019a086f0290f4b6d34a6e1b8a4b9974d585819abcd8e8f3d400000b5d00000000aaf9271bb6c2892dd5f96a71da1ed4be9b234f74a8de246acd91851a6639e1904e0384731a132185d1684680000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000"], "method": "getwork", "id": "json"}

is there a full documentation for this communication? I am especially inerested actually in:
* All commands and return codes
* How to handle authentication etc.

Or do I ahve t oget some code from a miner and try to reverse engineer this part?

And the server's response (if the result was correct):
Code:
{"id":"json","error":null,"result":true}
wyze
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile WWW
June 23, 2011, 07:29:53 PM
 #5

Maybe these will help you?

https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list
NetTecture (OP)
Full Member
***
Offline Offline

Activity: 140
Merit: 100


View Profile
June 23, 2011, 08:09:31 PM
 #6


Yes, that is a decent start Wink Thanks. Will give it a try.
Pages: [1]
  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!