Bitcoin Forum
June 24, 2017, 10:39:37 PM *
News: Latest stable version of Bitcoin Core: 0.14.2  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: [Wiki] Python JSON-RPC example  (Read 2403 times)
Luke-Jr
Legendary
*
expert
Offline Offline

Activity: 2198



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:

1498343977
Hero Member
*
Offline Offline

Posts: 1498343977

View Profile Personal Message (Offline)

Ignore
1498343977
Reply with quote  #2

1498343977
Report to moderator
1498343977
Hero Member
*
Offline Offline

Posts: 1498343977

View Profile Personal Message (Offline)

Ignore
1498343977
Reply with quote  #2

1498343977
Report to moderator
1498343977
Hero Member
*
Offline Offline

Posts: 1498343977

View Profile Personal Message (Offline)

Ignore
1498343977
Reply with quote  #2

1498343977
Report to moderator
Unlike traditional banking where clients have only a few account numbers, with Bitcoin people can create an unlimited number of accounts (addresses). This can be used to easily track payments, and it improves anonymity.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1498343977
Hero Member
*
Offline Offline

Posts: 1498343977

View Profile Personal Message (Offline)

Ignore
1498343977
Reply with quote  #2

1498343977
Report to moderator
1498343977
Hero Member
*
Offline Offline

Posts: 1498343977

View Profile Personal Message (Offline)

Ignore
1498343977
Reply with quote  #2

1498343977
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: 1232


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: 2198



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: 1232


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!