SN-3634 已核对来源,附原文与上下文。
我把 m0mchil 的 getwork 重新设计后上传到了 SVN r189(版本号 31601)
I uploaded a redesign of m0mchil's getwork to SVN rev 189 (version 31601)
m0mchil 的外部比特币矿工构想解决了很多问题。GPU 编程不成熟、编译困难,我不想给构建加更多依赖。getwork 让这些问题得以分开解决——不同的硬件和操作系统用不同的程序。服务器农场能只跑一个 Bitcoin 节点、其余全跑 getwork 客户端,这也很方便。
m0mchil's external bitcoin miner idea has solved a lot of problems. GPU programming is immature and hard to compile, and I didn't want to add additional dependencies to the build. getwork allows these problems to be solved separately, with different programs for different hardware and OSes. It's also convenient that server farms can run a single Bitcoin node and the rest only run getwork clients.
接口有几处变化:
The interface has a few changes:
getwork [data]
getwork [data]
如果未指定 [data],返回格式化的待运算哈希数据:
If [data] is not specified, returns formatted hash data to work on:
"midstate":哈希完数据前一半之后的预计算哈希状态
"midstate" : precomputed hash state after hashing the first half of the data
"data":区块数据
"data" : block data
"hash1":用于第二次哈希的格式化哈希缓冲区
"hash1" : formatted hash buffer for second hash
"target":小端序哈希目标
"target" : little endian hash target
如果指定了 [data],则尝试解出该区块,成功时返回 true。[data] 就是 "data" 字段返回的那 128 字节区块数据,只是改了 nonce。
If [data] is specified, tries to solve the block and returns true if it was successful. [data] is the same 128 byte block data that was returned in the "data" field, but with the nonce changed.
注意事项:
Notes: