Mining-Pools

範例接受的 getwork 函式輸入和輸出?

  • March 16, 2016

我正在尋找成功的塊雜湊的 getwork 輸入和輸出,以驗證我已實現的 getwork 客戶端。

我也接受有關更好方法驗證這一點的建議。我看過 TestNet 但這似乎是一個緩慢的過程。

在測試網上我得到以下轉儲:

礦工 -> 比特幣

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}

回复

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}

使用 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}

我希望我沒有混淆請求。

引用自:https://bitcoin.stackexchange.com/questions/5797