Bitcointalk · New getwork

中本聪,2010 年 11 月 23 日

SN-3634 已核对来源,附原文与上下文。

阅读语言
中文译文

我把 m0mchil 的 getwork 重新设计后上传到了 SVN r189(版本号 31601)

m0mchil 的外部比特币矿工构想解决了很多问题。GPU 编程不成熟、编译困难,我不想给构建加更多依赖。getwork 让这些问题得以分开解决——不同的硬件和操作系统用不同的程序。服务器农场能够仅仅跑一个 Bitcoin 节点、其余全跑 getwork 客户端,这亦很方便。

接口有几处变化:

getwork [data] 倘若未指定 [data],返回格式化的待运算哈希数据: "midstate":哈希完数据前一半之后的预计算哈希状态 "data":区块数据 "hash1":用于第二次哈希的格式化哈希缓冲区 "target":小端序哈希目标 倘若指定了 [data],则尝试解出该区块,成功时返回 true。[data] 就是 "data" 字段返回的那 128 字节区块数据,不过是改了 nonce。

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

ORIGINAL · 英文原文
I uploaded a redesign of m0mchil's getwork to SVN rev 189 (version 31601)

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]
If [data] is not specified, returns formatted hash data to work on:
  "midstate" : precomputed hash state after hashing the first half of the data
  "data" : block data
  "hash1" : formatted hash buffer for second hash
  "target" : little endian hash target
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:
- 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.
上下文
← 上一条 SN-3634 · 当前 下一条 → 在档案中查看完整主题串 →
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-3634