이메일 #146 - #150
원본 출처: Satoshi - Sirius emails 2009-2011
이메일 #146
Date: Thu, 04 Feb 2010 19:33:26 +0000
From: Satoshi Nakamoto <[email protected]>
Subject: UTF-8 to ANSI hack in CAboutDialog
To: Martti Malmi <[email protected]>
한글 번역
이 변경을 한 이유가 무엇이었나요?
#if !wxUSE_UNICODE ... if (str.Find('Â') != wxNOT_FOUND) str.Remove(str.Find('Â'), 1); 이 부분이: if (str.Find('�') != wxNOT_FOUND) str.Remove(str.Find('�'), 1); 이렇게 바뀌었네요.
wxFormBuilder는 (c) 기호를 자동으로 UTF-8로 바꿉니다. wxWidgets-2.8.9 ansi에서는 저작권 기호에 불필요한 문자가 하나 더 붙어서 표시되는데, 이 임시 처리는 유니코드가 아닌 (ansi) 경우에 그 문제를 고쳐 주기 위한 것입니다.
영어 원문
What was the reason for this change?
#if !wxUSE_UNICODE
...
if (str.Find('Â') != wxNOT_FOUND)
str.Remove(str.Find('Â'), 1);
to:
if (str.Find('�') != wxNOT_FOUND)
str.Remove(str.Find('�'), 1);
wxFormBuilder turns the (c) symbol into UTF-8 automatically. On
wxWidgets-2.8.9 ansi, it shows as a copyright symbol with an extra trash
character, which this hack fixes up for the non-unicode (ansi) case.
이메일 #147
Date: Thu, 04 Feb 2010 19:59:48 +0000
From: Satoshi Nakamoto <[email protected]>
Subject: Re: Bitcoin API
To: [email protected]
한글 번역
좋습니다, 그렇다면 d-bus는 고려할 필요가 없겠네요. Windows에도 IPC 소켓 같은 것이 있나요? wx가 어떻게 하는지 살펴볼 수 있을 것 같고, 아니면 XML-RPC 라이브러리가 이미 어떻게 해야 하는지 알고 있을지도 모르겠네요. Windows에는 명명된 파이프(named pipes)가 있으니, 아마 그게 가장 비슷한 것 같습니다.
저는 저만의 RPC 프로토콜을 새로 만들고 싶지 않고, 기존 표준을 쓰고 싶습니다. PHP, Java, Python 등 무엇이든 명령줄 명령과 같은 방식으로 서버와 직접 대화할 수 있게 될 겁니다.
XML-RPC에 대해 읽어 보기 시작하려 합니다. 검색해 보면 가장 널리 쓰이는 프로토콜로 나오고 지원도 널리 되고 있습니다. PHP는 표준 라이브러리에 포함하고 있습니다.
로컬에서만 접근할 수 있는 소켓을 열 수 있나요?
네, 로컬 전용인 IPC 소켓("Unix domain sockets")을 사용할 수 있습니다. wx-api에서는 포트 번호 대신 파일 이름을 사용해서 그렇게 했습니다. wxServer-Client 통신이 어떻게 사용되는지 예제를 커밋해 두었으니, 원하시면 되돌리셔도 됩니다. 이제 실행 중인 인스턴스에 블록 체인 길이를 묻는 -blockamount 명령줄 옵션이 있습니다.
이 명령줄 방식도 이미 PHP에서 쓸 수 있을 것 같지만, php 자체가 소켓 서버를 직접 호출할 수 있으면 더 가벼울지도 모르겠습니다. wx의 IPC 개요에는 wxSocketEvent, wxSocketBase, wxSocketClient와 wxSocketServer가 "Classes for the low-level TCP/IP API"라고 나와 있는데, 지금 제가 쓴 것(wxServer, wxClient, wxConnection)보다 php에서 쓰기 더 쉬울지도 모르겠습니다. 더 살펴보겠습니다.
영어 원문
Good, then no need to consider d-bus. Is there something like IPC
sockets on Windows? I guess we could look how wx does it, or maybe the
XML-RPC library will already know what to do. Windows has named pipes,
maybe that's the best analogue.
I don't think I want to invent my own RPC protocol, I want to use an
existing standard. PHP, Java, Python or anything will be able to talk
to the server directly the same way the command line commands do.
I'm going to start reading on XML-RPC. It's coming up in searches as
the most widely used protocol and widely supported. PHP includes it in
its standard libraries.
>> Is it possible to open a socket that can only be accessed locally?
>
> Yes, you can use IPC sockets ("Unix domain sockets") which are local
> only. That's done in the wx-api by using a filename in place of a port
> number. I committed an example of how the wxServer-Client communication
> is used, you can revert if you want to. Now there's the -blockamount
> command line option which asks the running instance for the block chain
> length.
>
> I think this command line method could already be used from PHP, but it
> might be lighter if php itself could call the socket server directly.
> The wx's IPC overview mentions wxSocketEvent, wxSocketBase,
> wxSocketClient and wxSocketServer as being "Classes for the low-level
> TCP/IP API", which might be easier to use from php than what I used now
> (wxServer, wxClient, wxConnection). I'll look more into it.
>
>
>
이메일 #148
Date: Fri, 05 Feb 2010 04:08:54 +0000
From: Satoshi Nakamoto <[email protected]>
Subject: Re: Bitcoin API research status
To: Martti Malmi <[email protected]>
한글 번역
wxSocketServer::Accept(bool wait = true)에 대한 문서에서 이런 내용을 봤습니다: "If wait is true and there are no pending connections to be accepted, it will wait for the next incoming connection to arrive. **Warning: This will block the GUI."
wxWidgets는 병적으로 단일 스레드입니다. 단일 스레드일 뿐만 아니라 반드시 GUI 스레드여야 합니다. wxStandardPaths처럼 UI와는 전혀 관계없는 것에서도 걸렸습니다. 이건 어차피 Windows가 두는 똑같은 제약이라 UI 코드에는 전혀 문제가 없지만, UI 없는 서버 데몬 코드에서는 wx 호출이 불확실합니다.
현재 제 조사 상황은 이렇습니다:
PHP, Python 등이 서버에 접근하려면 일반 소켓을 써야 합니다. localhost에만 바인드해서 로컬 전용으로 만들 수 있을 것 같고, 그러면 루프백을 통해서만 접근할 수 있습니다. 받은 연결의 IP를 확인해서 127.0.0.1이 아닌 것은 끊는 것만으로도 빈틈이 없다고들 하니, 둘 다 하는 게 좋겠습니다.
XML-RPC는 좀 무겁습니다. C++용 라이브러리가 4개 있는데 모두 크고 빌드하기 어렵고, 의존성과 라이선스 문제가 있습니다. C++와 PHP용 XML-RPC 라이브러리는 모두 버그가 많다는 불만도 있습니다.
JSON-RPC는 더 단순하고 우아한 표준입니다. 충분히 단순해서 일반적인 JSON 파서를 쓸 수 있을 것 같습니다.
PHP, Python, Java에는 모두 좋은 JSON-RPC 구현이 있습니다.
현재로서는 JSON-RPC 쪽으로 기울고 있습니다.
영어 원문
I noticed this in the docs for wxSocketServer::Accept(bool wait = true):
"If wait is true and there are no pending connections to be accepted, it
will wait for the next incoming connection to arrive. **Warning: This
will block the GUI."
wxWidgets is pathologically single-threaded. Not only single-threaded,
but must-be-the-GUI-thread-ed. Even for something as non-UI as
wxStandardPaths I got nailed. All this is fine for UI code, since this
is the same constraint placed by Windows anyway, but for UI-less server
daemon code, wx calls are uncertain.
Status of my research currently:
For PHP, Python, etc to access the server, we need to use regular
sockets. I think we can make it local-only by binding to localhost
only, so it can only be accessed through the loopback. They say it's
also watertight to simply check the IP of connections received and
disconnect anything not 127.0.0.1. May as well do both.
XML-RPC is a bit fat. There are 4 libraries for C++ but they're all big
and hard to build, dependencies, license issues. Some posters complain
all the C++ and PHP XML-RPC libraries are buggy.
JSON-RPC is a simpler more elegant standard. It's simple enough I could
use a generic JSON parser.
PHP, Python and Java all have good implementations of JSON-RPC.
I'm currently leaning towards JSON-RPC.
이메일 #149
Date: Fri, 05 Feb 2010 09:16:23 +0200
From: [email protected]
To: Satoshi Nakamoto <[email protected]>
Subject: Re: UTF-8 to ANSI hack in CAboutDialog
한글 번역
의도적으로 바꾼 게 아니라, 인코딩 문제였을 겁니다.
이 변경을 한 이유가 무엇이었나요?
#if !wxUSE_UNICODE ... if (str.Find('Â') != wxNOT_FOUND) str.Remove(str.Find('Â'), 1); 이 부분이: if (str.Find('�') != wxNOT_FOUND) str.Remove(str.Find('�'), 1); 이렇게 바뀌었네요.
wxFormBuilder는 (c) 기호를 자동으로 UTF-8로 바꿉니다. wxWidgets-2.8.9 ansi에서는 저작권 기호에 불필요한 문자가 하나 더 붙어서 표시되는데, 이 임시 처리는 유니코드가 아닌 (ansi) 경우에 그 문제를 고쳐 주기 위한 것입니다.
영어 원문
I didn't change it knowingly, must have been some encoding problem.
> What was the reason for this change?
>
> #if !wxUSE_UNICODE
> ...
> if (str.Find('Â') != wxNOT_FOUND)
> str.Remove(str.Find('Â'), 1);
> to:
> if (str.Find('�') != wxNOT_FOUND)
> str.Remove(str.Find('�'), 1);
>
> wxFormBuilder turns the (c) symbol into UTF-8 automatically. On
> wxWidgets-2.8.9 ansi, it shows as a copyright symbol with an extra
> trash character, which this hack fixes up for the non-unicode (ansi)
> case.
이메일 #150
Date: Fri, 05 Feb 2010 09:56:16 +0200
From: [email protected]
To: Satoshi Nakamoto <[email protected]>
Subject: Re: Exchange options
한글 번역
Liberty Reserve가 좋아 보이네요. 먼저 LR만 받는 서비스를 만들고, 나중에 옵션을 더 추가할 수 있겠네요. 약점은 손님이 그냥 비트코인을 얻고 싶어 하는데 LR을 사는 게 불편한 절차 하나를 더한다는 점입니다. 하지만 여기서는 선택의 여지가 별로 없는 것 같네요.
당신 나라에는 전자 송금이나 종이 수표가 있나요? (유럽 안에서만 되더라도요)
네, 전자 은행 송금이 가능합니다. 2010년 중에는 대부분의 유럽 국가가 SEPA(Single Euro Payments Area)에 들어가게 되는데, 이는 유럽 안의 모든 결제는 국내 결제로 간주한다는 뜻입니다. 은행들은 모든 국내 송금에 같은 수수료와 기준을 적용해야 하니, 아마 모두 무료가 되고 하루 만에 끝날 겁니다. 국제 송금에는 보통 추가 비용이 드는 SWIFT/IBAN 시스템이 있습니다.
제 교환 서비스의 좀 더 장기적인 과제는 은행들이 어떤 종류의 연동 방식을 제공하는지 살펴보는 일이 될 겁니다. 은행 송금이면 신용카드에 거의 맞먹을 만큼 많은 손님에게 닿을 겁니다.
영어 원문
Liberty Reserve sounds good. I could first make a service that only
accepts LR, and add more options later. The weakness is that buying LR
is an extra step of inconvenience when the customer just wants to get
Bitcoins. But maybe I don't have too much choice here.
> Do you have electronic transfer or paper cheque in your country? (even
> if only within Europe)
Yes, electronic bank transfer is available. During 2010 most European
countries will become a part of SEPA (Single Euro Payments Area),
which means that all payments within Europe are to be considered
domestic. Banks will have to apply the same fees and standards to all
domestic transfers, so they'll probably all be free of charge and
complete in one bank day. For international transfers there's the
SWIFT/IBAN system, which usually costs some extra.
A longer term project for my exchange service would be to see what
kinds of integration options the banks have to offer. Bank transfers
would reach nearly as many customers as credit cards do.