Bitcoin Forum
February 24, 2017, 08:50:29 AM *
News: Latest stable version of Bitcoin Core: 0.13.2  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: [Wiki] Python JSON-RPC example  (Read 2372 times)
Luke-Jr
Legendary
*
expert
Offline Offline

Activity: 2114



View Profile
April 09, 2011, 02:14:26 PM
 #1

Does this wording satisfy everyone?

Quote
For Python, python-jsonrpc is the official JSON-RPC implementation. It automatically generates Python methods for RPC calls. However, due to its design for supporting old versions of Python, it is also rather inefficient. jgarzik has forked it as Python-BitcoinRPC and optimized it for current versions (at least Python 2.6+, though not 3.x). Generally, this version is recommended.

While BitcoinRPC lacks a few obscure features from jsonrpc, software using only the ServiceProxy class can be written the same to work with either version the user might choose to install:

1487926229
Hero Member
*
Offline Offline

Posts: 1487926229

View Profile Personal Message (Offline)

Ignore
1487926229
Reply with quote  #2

1487926229
Report to moderator
1487926229
Hero Member
*
Offline Offline

Posts: 1487926229

View Profile Personal Message (Offline)

Ignore
1487926229
Reply with quote  #2

1487926229
Report to moderator
1487926229
Hero Member
*
Offline Offline

Posts: 1487926229

View Profile Personal Message (Offline)

Ignore
1487926229
Reply with quote  #2

1487926229
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1487926229
Hero Member
*
Offline Offline

Posts: 1487926229

View Profile Personal Message (Offline)

Ignore
1487926229
Reply with quote  #2

1487926229
Report to moderator
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
April 09, 2011, 03:53:28 PM
 #2

What is meant by "rather inefficient"?  Speed of serializing/deserializing?

I can't imagine that is a significant factor for communicating with bitcoin; if you're running into JSON-RPC bottlenecks (is anybody running into performance bottlenecks due to JSON-RPC yet?  If you are, what are you doing?) then the lack of persistent connections, lack of JSON-RPC-2.0-multicall support, or bitcoin single-threaded RPC are likely much, much bigger issues.


How often do you get the chance to work on a potentially world-changing project?
genjix
Legendary
*
expert
Offline Offline

Activity: 1246


View Profile
April 09, 2011, 05:00:18 PM
 #3

Why do we even recommend JSON-RPC at all?

It's not even an official library for Python and it isn't very good (uses floats and has no persistent connections). We should only be recommending jgarzik's version.
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1470


View Profile
April 09, 2011, 05:10:25 PM
 #4

For the record, after my wiki edits were reverted, I wash my hands of the matter.  I do not participate in edit wars.

Jeff Garzik, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
Luke-Jr
Legendary
*
expert
Offline Offline

Activity: 2114



View Profile
April 09, 2011, 05:33:49 PM
 #5

What is meant by "rather inefficient"?  Speed of serializing/deserializing?
That also, but my understanding is that python-jsonrpc only supports single-request-per-connection HTTP/1.0, whereas jgarzik's bitcoinrpc supports HTTP/1.1 persistent connections.
Why do we even recommend JSON-RPC at all?

It's not even an official library for Python and it isn't very good (uses floats and has no persistent connections). We should only be recommending jgarzik's version.
Who recommends it? The proposed summary clearly recommend jgarzik's fork. It is an official library for JSON-RPC.

genjix
Legendary
*
expert
Offline Offline

Activity: 1246


View Profile
April 09, 2011, 05:49:03 PM
 #6

I modified JSON-RPC -> jgarzik incorporated code from that -> you've added backwards compatibility.

Stop recommending Dinosaurs when we're at Mammals. It's evolution.

It's even backwards compatible with JSON-RPC if you're a strange person.
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!