Bitcointalk · Development of alert system

中本聪,2010 年 8 月 25 日

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

阅读语言
中文译文

那么管理员用 bitcoind 会收到什么形式的警告?debug.log 里有什么可以 grep 的东西吗?还是 rpc 调用会抛出某种特定错误?有没有办法在本地强制触发它,好对服务做单元测试?

getinfo 有一个新字段,显示任何警报消息或其他本会显示在状态栏上的错误。

rpc 方法返回一个 json-rpc 错误,错误描述为 "Safe mode: " 加上警报指定的附加文本。

我为你加了 "-testsafemode" 开关。SVN rev 145。

这些东西很新,仍可能变动。

我刚发现 http://www.bitcoin.org/wiki/doku.php?id=man_page,上面没有 -disablesafemode 的条目。兴许该加上!另外其他几个譬如 -4way 也应该加上。

很多开关是故意不写文档的,譬如功能还在建设中、名字还没定,或者只是不打算随发布出去的测试代码。

-4way 最终应该被自动检测取代。

ORIGINAL · 英文原文
So what kind of warning do admins get from bitcoind? Is there something we can grep from debug.log? Or will rpc calls raise some specific error? Is there a way to locally force this to happen, for unittesting services?
getinfo has a new field that shows any alert messages or other errors that would be displayed on the status bar.

The rpc methods return a json-rpc error with the error description "Safe mode: " followed by additional text specified by the alert.

I added the switch "-testsafemode" for you.  SVN rev 145.

This stuff is very new and may still be subject to change.

I just discovered http://www.bitcoin.org/wiki/doku.php?id=man_page and don't see any reference to -disablesafemode.  Perhaps it should be added!  Also others liek -4way should be added as well.
Many switches are intentionally undocumented, like if their functionality is still under construction or I haven't settled on their name yet, or just test code not intended for release.

-4way should eventually be replaced by an auto-detect.
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-2597