Bitcointalk

New getwork

中本聪 · 2010 年 11 月 23 日

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.

注意事项:

  • 提交疑似命中时不返回新工作,只不带参数调用时才返回。
  • 区块字段已拆分为 data 和 hash1。
  • data 为 128 字节,包含已被 midstate 哈希过的前一半。
  • hash1 恒定不变,但为方便仍一并给出。
  • "ThreadRPCServer method=getwork" 的日志已禁用,否则日志里垃圾太多。

Notes:

  • It does not return work when you submit a possible hit, only when called without parameter.
  • The block field has been separated into data and hash1.
  • data is 128 bytes, which includes the first half that's already hashed by midstate.
  • hash1 is always the same, but included for convenience.
  • Logging of "ThreadRPCServer method=getwork" is disabled, it would be too much junk in the log.
上下文
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-3634

阅读字号

选择适合你的字号,之后阅读会继续使用。