Re: Bitcoin API

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.

Source: Published by Martti Malmi on GitHub in February 2024 as part of his testimony in the COPA v. Wright trial. The full correspondence archive is available at mmalmi.github.io/satoshi/.