Why does bitcoind (0.7.2) give an error when trying to issue getrawtransaction over RPC?

2

I am writing an web application using Python/Flask. I am using

http://laanwj.github.com/bitcoin-python/doc/

to connect to my bitcoind 0.7.2 server as follows:

conn = bitcoinrpc.connect_to_local()
accounts = conn.listaccounts(0)

This is all working well. However, when I attempt to use some of the newer raw transaction calls, I get an error. For example,

raw_transaction = conn.getrawtransaction(txid)

results in the following error:

AttributeError: 'BitcoinConnection' object has no attribute 'getrawtransaction'

It seems (though I am not sure) that the methods that don't work for me are those that are listed here:

https://en.bitcoin.it/wiki/Raw_Transactions

Thanks to anyone who can help on this.

Sanjay

Posted 2013-01-16T18:39:25.400

Reputation: 195

While cdecker technically answers the question posed, I found that the best solution around the problem is to use the following package to connect with bitcoind:

https://github.com/jgarzik/python-bitcoinrpc

Sanjay 2013-01-16T20:52:00.660

Answers

2

That particular API client library does not yet implement all calls that are exposed by bitcoind. See the API documentation for a list of calls that are implemented.

The problem is that your Bitcoin client knows about getrawtransaction but the python library you're using to connect to it does not know what to do with it yet.

cdecker

Posted 2013-01-16T18:39:25.400

Reputation: 7 878

1

While cdecker technically answers the question posed, I found that the best solution around the problem is to use the following package to connect with bitcoind:

https://github.com/jgarzik/python-bitcoinrpc

Sanjay

Posted 2013-01-16T18:39:25.400

Reputation: 195

If you're just looking for a JSON-RPC client lib in python then https://github.com/joshmarshall/jsonrpclib might be your thing.

cdecker 2013-01-17T08:45:30.503