6

I'm looking for example getwork input and output of a successful block hash to verify a getwork client I've implemented.

I'd also accept suggestions on better ways to verify this. I've looked at TestNet but this seems to be a slow process.

  • The best thing I've come up with at the moment is looking at the block explorer and trying to manually recreate the block header in the format of getwork data and compare it to the resulting hash. – Glen T Dec 16 '12 at 20:23
  • You can try running some miner and wireshark the traffic between your machine and a pool / testnet server client. – ThePiachu Dec 17 '12 at 12:41
  • Thanks for the suggestion but my problem is I'm unable to capture a successful block hash. – Glen T Dec 18 '12 at 5:37
  • You can always try setting up mining on testnet and try to capture a block there. – ThePiachu Dec 18 '12 at 5:58
  • Have tried but wasn't able to generate a block yet sadly. – Glen T Dec 19 '12 at 15:38
3

On testnet I get the following dump:

Miner -> bitcoind

POST / HTTP/1.1
Authorization: Basic Y2RlY2tlcjphYmMxMjM=
Host: localhost:18332
Accept: */*
Accept-Encoding: deflate, gzip
Content-type: application/json
X-Mining-Extensions: longpoll midstate rollntime submitold
X-Mining-Hashrate: 583000000
Content-Length: 45
User-Agent: cgminer 2.8.1

{"method": "getwork", "params": [], "id":0}

Response

HTTP/1.1 200 OK
Date: Fri, 01 Feb 2013 20:40:06 +0000
Connection: keep-alive
Content-Length: 592
Content-Type: application/json
Server: bitcoin-json-rpc/v0.7.2.0-g32a928e-beta

{"result":{"midstate":"d330cdcb6296c8befe66dc38ca10589aa54cb364bf2f174aea7c9329263841f9","data":"00000002b15704f4ecae05d077e54f6ec36da7f20189ef73b77603225ae56d2b00000000bcf59695a4e35a2f7535e1a86b306a3b08c212bf0b833764018fe39f01919381510c28111c0e8a3700000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000","hash1":"00000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000010000","target":"00000000000000000000000000000000000000000000000000378a0e00000000"},"error":null,"id":0}

Reporting successful blockwith diff 18:

POST / HTTP/1.1
Authorization: Basic Y2RlY2tlcjphYmMxMjM=
Host: localhost:18332
Accept: */*
Accept-Encoding: deflate, gzip
Content-type: application/json
X-Mining-Extensions: longpoll midstate rollntime submitold
X-Mining-Hashrate: 661000000
Content-Length: 305
User-Agent: cgminer 2.8.1

{"method": "getwork", "params": [ "00000002b15704f4ecae05d077e54f6ec36da7f20189ef73b77603225ae56d2b00000000b052cbbdeed2489ccb13a526b77fadceef4caf7d3bb82a9eb0b69ebb90f9f5a7510c27fd1c0e8a37fa531338000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000" ], "id":1}

I hope I didn't mix the requests.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.