Bitcoin Forum
December 06, 2016, 08:17:04 PM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Python / twisted & bitcoin JSONRPC api  (Read 1728 times)
czaanja
Newbie
*
Offline Offline

Activity: 3


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

Hello,

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:

Code:
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.append(d)
dl = defer.DeferredList(dl)
dl.addCallback(shutDown)
reactor.run()

But from the daemon I got:

Code:
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]
  Print  
 
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!