SN-10136 附来源、原文与上下文。
引用 Martti Malmi 的文字Martti Malmi来源 ↗我至少还需要命令行工具,来检查是否收到币,以及发送币。这需要某种方式,与后台运行的比特币进程通信。我不知道应该怎么做,也许与 RPC 有关。
I'd also need at least the command line tools to check if coins have been received and to send coins. It would require some way to communicate with the Bitcoin process running in the background. I don't know how that should be done, maybe with something RPC related.
如果后台进程没有图形界面,也会很好—— 目前这个服务档位的 VPS 没有足够内存运行 X 窗口环境,除非我能想办法释放内存。
It would also be great if the background process was non-graphical - the VPS on the current service level doesn't have enough memory to run the X Windowing environment, unless I come up with some ways to free memory.
我之前一直纳闷,为什么大家总是强调无界面,明明已经可以让程序只在托盘里显示一个小图标运行,而这对 Windows 上的服务器服务很常见。我想原因就在这里。我原先还以为,如果他们连一个从来不会看的桌面上的小图标都受不了,那是 unix 用户的优越感在作怪。
I had been wondering why everyone keeps harping on no-UI, when already you can run it with only a small icon on the tray, which is common for server services on Windows. So I guess this is why. I had chalked it up to unix snobbery if they couldn't abide a tiny little icon on a desktop they never see.
不打开任何窗口很容易,不过可能因为没有 gtk 库而失败。wxWidgets 有 WXBASE,表示“仅 wxBase,不含图形界面功能”。你可以尝试用它代替 WXGTK 来编译,看看会怎样。如果有办法用同一个可执行文件的命令行开关实现,会更好,而不必再多发布一种构建变体。
Not opening any windows is easy, but it may fail because the gtk libraries aren't there. wxWidgets has WXBASE for "Only wxBase, no GUI features". You could try building for that instead of WXGTK and see what happens. It would be preferable if there's any way to do it as a command line switch on the same executable, rather than yet another build variation to release.
你可用的内存有多少?比特币必然要占用不少内存,在 Windows 上大约 75MB。这会有问题吗?
How much memory do you have to work with? Bitcoin necessarily takes a fair bit of memory; about 75MB on Windows. Is that a problem?
命令行控制是接下来要做的事情之一。我想仔细设计 API。
Command line control is one of the next things on the list. I want to design the API carefully.
接收付款这部分有很多设计选择要做。调用方需要识别自己关心的交易,这正是每笔交易使用一个比特币地址的模式能发挥作用的地方。另一种可能是从备注文本中搜索订单号。可以采用轮询,询问指定比特币地址收到了哪些付款,也可以采用事件驱动。我想,事件驱动方式就是告诉比特币:当某个比特币地址收到特定金额时,运行一条命令行。
Receiving payments is the part that has a lot of design choices to be made. The caller needs to identify the transactions of interest, that's where the one-bitcoin-address-per-transaction model helps. Searching the comments text for an order number is another possibility. There's polled, asking what has been received to the given bitcoin address, and event driven. I guess in event driven, bitcoin would be told to run a command line when a certain amount is received to a certain bitcoin address.