Python async interface to bitcoin's JSON-RPC API for tornado
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 13 commits ahead, 33 commits behind jgarzik:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Async python BitcoinRPC for tornado

AsyncAuthServiceProxy is async version of AuthServiceProxy.

It can be used with tornado ioloop.

Usage example

from bitcoinrpc_async.authproxy import AsyncAuthServiceProxy
from tornado import ioloop, gen

BITCOIN_RPC_URL = "http://user:password@"

def show_block_count():
    service = AsyncAuthServiceProxy(BITCOIN_RPC_URL)
    result = yield service.getblockcount()
    print result

io_loop = ioloop.IOLoop.instance()


# clone this repo, and run
python install

Or using pip:

pip install -e git://

AuthServiceProxy is an improved version of python-jsonrpc.

It includes the following generic improvements:

  • HTTP connections persist for the life of the AuthServiceProxy object
  • sends protocol 'version', per JSON-RPC 1.1
  • sends proper, incrementing 'id'
  • uses standard Python json lib

It also includes the following bitcoin-specific details:

  • sends Basic HTTP authentication headers
  • parses all JSON numbers that look like floats as Decimal


  • change the first line of to point to the directory of your installation of python 2.*
  • run

Note: This will only install bitcoinrpc. If you also want to install jsonrpc to preserve backwards compatibility, you have to replace 'bitcoinrpc' with 'jsonrpc' in and run it again.