The JSON-RPC implementation is going well. I'm using boost::asio for
sockets. JSON-RPC can be plain socket or HTTP, but it seems most other
implementations are HTTP, so I made my own simple HTTP headers. For
JSON parsing I'm using JSON Spirit, which makes full use of STL and has
been really nice to use. It's header-only so it's no added build work,
and small enough to just add it to our source tree. MIT license. This
should all be working in a few more days.
The forum sure is taking off. I didn't expect to have so much activity
so fast.
JSON-RPC status
Private email with Martti Malmi (sirius-m) · 8 messages · from 7 February 2010 · with Satoshi Nakamoto, mmalmi@cc.hut.fi
Read in Satoshi Mail Archive source
That's great! I'll start familiarizing myself with Liberty Reserve and
its api.
The JSON-RPC implementation is going well. I'm using boost::asio for sockets. JSON-RPC can be plain socket or HTTP, but it seems most other implementations are HTTP, so I made my own simple HTTP headers. For JSON parsing I'm using JSON Spirit, which makes full use of STL and has been really nice to use. It's header-only so it's no added build work, and small enough to just add it to our source tree. MIT license. This should all be working in a few more days. The forum sure is taking off. I didn't expect to have so much activity so fast.
I uploaded my JSON-RPC and command line implementation to SVN. I'm
waiting to post on the forum when I've had more time to think about the
commands. At least some method names are going to change.
To enable the RPC server, add the switch -server. It's not on by default.
Client commands are without any switches, as such:
bitcoin getblockcount
bitcoin getdifficulty
bitcoin getnewaddress somelabel
bitcoin sendtoaddress 1DvqsbZ... 1.00
bitcoin getallpayments 0
bitcoin stop
Applications would normally use JSON-RPC directly, not command line.
I haven't tested my JSON-RPC server with anything else yet. If you do,
please tell me how it goes. You're using Python, right?
Getting the Linux version to run without the GTK installed will be a
separate task.
mmalmi@cc.hut.fi wrote:That's great! I'll start familiarizing myself with Liberty Reserve and its api. > The JSON-RPC implementation is going well. I'm using boost::asio for > sockets. JSON-RPC can be plain socket or HTTP, but it seems most other > implementations are HTTP, so I made my own simple HTTP headers. For > JSON parsing I'm using JSON Spirit, which makes full use of STL and has > been really nice to use. It's header-only so it's no added build work, > and small enough to just add it to our source tree. MIT license. This > should all be working in a few more days. > > The forum sure is taking off. I didn't expect to have so much activity > so fast.
I haven't tested my JSON-RPC server with anything else yet. If you do, please tell me how it goes. You're using Python, right? Getting the Linux version to run without the GTK installed will be a separate task.
Yes, using Python. I didn't test the JSON-RPC yet as I don't have
Bitcoin running on the vps yet. It doesn't work without a window
manager even if GTK libraries are installed. I asked about it at
wxWidgets forum (http://wxforum.shadonet.com/viewtopic.php?t=26954)
but they didn't have much clue. Maybe we'll just need to make two
different binaries.
mmalmi@cc.hut.fi wrote:> I haven't tested my JSON-RPC server with anything else yet. If you do, > please tell me how it goes. You're using Python, right? > > Getting the Linux version to run without the GTK installed will be a > separate task. Yes, using Python. I didn't test the JSON-RPC yet as I don't have Bitcoin running on the vps yet. It doesn't work without a window manager even if GTK libraries are installed. I asked about it at wxWidgets forum (http://wxforum.shadonet.com/viewtopic.php?t=26954) but they didn't have much clue. Maybe we'll just need to make two different binaries.
I will probably relent and do that. I can move init and shutdown into
init.cpp or start.cpp or something, link only wxbase and not link ui.o
and uibase.o.
wxWidgets is mostly Windows people, they wouldn't know much about GTK.
Don't you have an Ubuntu laptop you can test and compile on so you don't
have to toy with the vps?
Don't you have an Ubuntu laptop you can test and compile on so you don't have to toy with the vps?
Yes. Tested with Python's JSON-RPC, and seems to work fine! Really
easy to use.
mmalmi@cc.hut.fi wrote:> Don't you have an Ubuntu laptop you can test and compile on so you > don't have to toy with the vps? Yes. Tested with Python's JSON-RPC, and seems to work fine! Really easy to use.
Hurray, I got it on the first go.
Could you send me the Python code you used? So if I do some testing
later I don't have to figure it out myself.
mmalmi@cc.hut.fi wrote: >> Don't you have an Ubuntu laptop you can test and compile on so you >> don't have to toy with the vps? > > Yes. Tested with Python's JSON-RPC, and seems to work fine! Really > easy to use. Hurray, I got it on the first go. Could you send me the Python code you used? So if I do some testing later I don't have to figure it out myself.
Just downloaded the python-json-rpc
(http://json-rpc.org/wiki/python-json-rpc) from their svn and tested
by talking to the Python interpreter directly. Like this:
pythons = ServiceProxy("http://localhost:8332")
s.getblockcount()