Martti Malmi 通信

回复:Linux 构建、代理

中本聪 · 2009 年 11 月 3 日

SN-10083 附来源、原文与上下文。

阅读语言

太好了,我一直期待着开发 Linux 版本。

Great, I've been looking forward to working on the Linux build.

如果连接 Freenode 的隐藏服务,他们会告诉你,由于滥用,那边也已经禁止 TOR,然后把你踢下线。你可以按一个分为几步的流程,在 unix 上运行一个密码工具,再发邮件申请可以登录的账号,但这就变得相当复杂了。不知道我们能不能只申请一个账号,然后大家共用?我猜 IRC 服务器大概会限制每个账号只能登录一次,或者某位管理员可能不愿意看到同一个账号有十几个登录。

If you connect to Freenode's hidden service, then they tell you they've also banned TOR from that due to abuse and it kicks you off. There's a several step procedure you can do to run a password utility on unix and e-mail request an account that you could login with, but that's getting pretty complicated. I wonder if we could get away with applying for one account and then everyone use the same account? I suppose the IRC server probably limits accounts to one login, or some admin might not like to see a dozen logins on the same account.

除了 IRC 那部分,代理测试得怎么样?因为你以前连接过,addr.dat 里有已知节点地址,但没有 IRC 告诉你哪些在线,找到它们就要很久。除了你以外,通常还有 1 到 3 个节点能接收传入连接,已经知道你的现有节点最终也会连接你。你得到了多少连接,花了多久?我想,要知道是否成功通过 TOR 建立了传出连接,需要在 debug.log 中搜索“connected”。

Besides the IRC part, how did your test of proxy go? Since you've been connected before, your addr.dat contains known node addresses, but without IRC to know which ones are online, it takes a long time to find them. There are normally 1 to 3 other nodes besides you that can accept incoming connections, and existing nodes that already know you would eventually connect to you. How many connections did you get, and how long did it take? I guess to know whether it successfully connected outbound through TOR you'd need to search debug.log for "connected".

如果一开始就要通过 TOR 连接,而不先正常连接一次来获得种子节点,就必须知道一个能够接收传入连接的现有节点地址,并像这样指定种子节点: bitcoin -proxy=127.0.0.1:9050 -addnode=<ip of a node>

To originally connect with TOR without connecting normally once to get seeded, you'd have to know the address of an existing node that can accept incoming connections and seed it like this: bitcoin -proxy=127.0.0.1:9050 -addnode=<ip of a node>

如果某些能接收传入连接的节点愿意把自己的 IP 写进程序,就可以自动获得种子节点。或者可以在 Wiki 页面上公布一些 IP 种子地址并附上说明。

If some nodes that accept incoming connects were willing to have their IP coded into the program, it could seed automatically. Or some IP seed addresses posted on a Wiki page with the instructions.

另一种办法是重新到处寻找不封禁 TOR 节点的 IRC 服务器。或者找个人架设一个。IRC 服务器封禁 TOR,是因为上面有真正的文字聊天……如果有一个服务器只放机器人和杂项内容,就不会在乎了。大概应该在论坛或邮件列表上问问,看有没有人知道这样的服务器。

Another option is to search the world again for an IRC server that doesn't ban TOR nodes. Or if we could get someone to set one up. IRC servers ban TOR because they have actual text chat on them... if there was one with just bots and junk then it wouldn't care. Probably should post a question on the forum or the mailing list and see if anyone knows one.

另一个问题是 TOR 用户无法接收传入连接,而我们能接收的节点本来就很少。如果所有人都转用 TOR,就没有节点可以连接了。

Another problem is that TOR users can't accept incoming connections, and we have so few that can. If everyone goes to TOR, there won't be any nodes to connect to.

我们缺少能够接收传入连接的节点。最近一般只有 2 到 4 个。需要向大家强调在路由器上设置端口转发的重要性。每个点对点文件共享程序都有相关说明。我们应该在 bitcoin.sourceforge.net 首页放一段文字,敦促大家设置端口转发来接收传入连接,并链接到一个介绍各种路由器设置方法的网站。

We have a shortage of nodes that can accept incoming connections. It generally ranges from 2 to 4 lately. We need to emphasize the importance to people of setting up port forwarding on their router. Every P2P file sharing program has instructions how to do it. We should have a paragraph on the bitcoin.sourceforge.net homepage urging people to set up port forwarding to accept incoming connections, and a link to a site that describes how to do it for each router.

引用 Martti Malmi 的文字Martti Malmi来源 ↗

我已经把目前移植好的内容上传到 svn/branches。Util、script、db 和头文件现在都能完整编译,net.cpp 能部分编译,所以还有工作要做。

I uploaded what I've ported so far to the svn/branches. Util, script, db and the headers compile fully now and net.cpp partially, so there's still work to do.

Linux 没有与 _beginthread 直接对应的函数,所以我改用了 Boost 线程。

_beginthread doesn't have a direct Linux equivalent, so I used Boost threads instead.

我没能通过 Tor SOCKS 代理连上。这可能是因为 Freenode 的 Tor 政策要求连接他们的隐藏服务:http://freenode.net/irc_servers.shtml#tor

I couldn't get connected using the Tor SOCKS proxy. That might be because of the Freenode Tor policy which requires connecting to their hidden service: http://freenode.net/irc_servers.shtml#tor

引用中本聪此前的文字中本聪来源 ↗

heapchk() 只是一个没在用的 MSVCRT 调试功能。在 Linux 上可以让它什么也不做。OpenSSL 在 Linux 上会自动使用 /dev/urandom 提供随机种子,所以 RandAddSeedPerfmon 也可以什么都不做。

heapchk() is just a MSVCRT debugging thing that's not being used. It can be a no-op on Linux. OpenSSL automatically uses /dev/urandom to seed on Linux, so RandAddSeedPerfmon can also be a no-op.

在我们充分完成离线测试之前,别让它连接网络。如果你有两台电脑,先断开互联网,用“bitcoin -connect=<ip>”让它们互连,一台 windows,一台 linux。-connect 允许连接 192.168.x.x 这样的不可路由地址。如果它发出某种我们还没想到要检查的畸形垃圾数据,或者发现其他会干扰网络的事情可以做,我们可不想因此损害网络的可靠性声誉。

Don't let it connect to the network before we've tested it thoroughly off-net. If you have two computers, unplug the internet and use "bitcoin -connect=<ip>" to connect to each other, one windows and one linux. -connect will allow you to connect to non-routable addresses like 192.168.x.x. We don't want to reflect badly on the reliability of the network if it throws off some malformed crud we hadn't thought to check for yet, or discovers something else anti-social to do on the network.

等你有能编译、可供测试的版本时,我有时间做些测试。我可以把它加入目前正在针对已有改动运行的压力测试。

I have time that I can do some testing when you've got something buildable to test. I can include it in the stress test I'm currently running on the changes so far.

引用 Martti Malmi 的文字Martti Malmi来源 ↗

我在 util.h 中加了一个 #ifdef,用 Linux 的 gettimeofday 替换 QueryPerformanceCounter。更新到 wxWidgets 2.9 后,一些 Unicode/ANSI 错误没有改代码就解决了。目前我在 Linux 上遇到的唯一编译错误,来自 util.h 中的 heapchk()。

I made an #ifdef to replace QueryPerformanceCounter with Linux's gettimeofday in util.h. Some Unicode/ANSI errors were resolved without code changes when I updated to wxWidgets 2.9. The only compile error I'm getting in Linux at the moment is from heapchk() in util.h.

引用中本聪此前的文字中本聪来源 ↗

我修复了遇到的一些不可移植的内容: QueryPerformanceCounter printf 格式字符串中的 %I64d Sleep CheckDiskSpace

I fixed some non-portable stuff I came across: QueryPerformanceCounter %I64d in printf format strings Sleep CheckDiskSpace

如果你知道还有其他应该由我修复的不可移植内容,请告诉我。

If there's any other unportable stuff you know of I should fix, let me know.

我想把 debug.log 和 db.log 移到数据文件所在的目录(%appdata%\Bitcoin),而不再放到碰巧作为当前目录的位置。

I think I'll move debug.log and db.log into the same directory as the data files (%appdata%\Bitcoin), rather than whatever the current directory happens to be.

来源

阅读字号

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