Bitcoin Forum
July 22, 2018, 09:25:49 PM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
   Home   Help Search Donate Login Register  
Pages: [1]
Author Topic: Python / twisted & bitcoin JSONRPC api  (Read 1932 times)
Offline Offline

Activity: 3
Merit: 0

View Profile
June 09, 2011, 05:41:59 PM


I am trying to comunnicate with the bitcoin daemon using python and twisted. But when I try to use the txjsonrpc it did not work. Here is the example:

from twisted.internet import reactor, defer
from txjsonrpc.web import jsonrpc
from txjsonrpc.jsonrpclib import Fault, VERSION_PRE1, VERSION_1, VERSION_2

proxyAuth = jsonrpc.Proxy(('user:pass@ip:port'))

dl = []
d = proxyAuth.callRemote('getinfo', version=VERSION_1)
d.addCallbacks(cbOk, cbErr)
dl = defer.DeferredList(dl)

But from the daemon I got:

500 Internal Server Error

I also tried the jsonrpc libs mentioned in the bitcoin api documentation, which did work. But I can not use them, since i need to use the twisted deferred logic.

I was tracking the communication using wireshar and I am afraid the problem is, that twisted is using HTTP/1.0 protocol and jsonrpc is using HTTP/1.1, so the communication behaves differently. I was trying to find some solution, but I getting stuck.

Is here anyone using twisted and bitcoin API? Please can you point me to the good direction?

Thank you in advance.
Pages: [1]
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!