Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: kangarooz on May 24, 2014, 05:38:19 PM



Title: python-bitcoinrpc (jgarzik) problem calling gettransaction()
Post by: kangarooz on May 24, 2014, 05:38:19 PM
Dear guys;

I use this code:

Code:
from bitcoinrpc.authproxy import *

access = AuthServiceProxy("PRIVATEDETAILS")

print access.getbalance()
txid = 'aedf77851ee49a85857126b9003f8058c355c7e30e51a8ef5c74042a73ab247f'
printa = access.gettransaction(txid)

It doens't work.
Python gaves me this error:
Quote
   raise JSONRPCException(response['error'])
bitcoinrpc.authproxy.JSONRPCException

The call of function access.getbalance() works fine.
Any idea how to fix this?

Kind regards;


Title: Re: python-bitcoinrpc (jgarzik) problem calling gettransaction()
Post by: RoxxR on May 24, 2014, 06:07:58 PM
Dear guys;

I use this code:

Code:
from bitcoinrpc.authproxy import *

access = AuthServiceProxy("PRIVATEDETAILS")

print access.getbalance()
txid = 'aedf77851ee49a85857126b9003f8058c355c7e30e51a8ef5c74042a73ab247f'
printa = access.gettransaction(txid)

It doens't work.
Python gaves me this error:
Quote
   raise JSONRPCException(response['error'])
bitcoinrpc.authproxy.JSONRPCException

The call of function access.getbalance() works fine.
Any idea how to fix this?

Kind regards;

I've had this issue a while ago and resolved it. I will need to look through my code samples and post the exact solution shortly. I'd appreciate a small tip to the following address if it resolves your problem:
1JEEELLkkn2Wu3oVNdXbbkbMAtpgFaTwfo


Title: Re: python-bitcoinrpc (jgarzik) problem calling gettransaction()
Post by: RoxxR on May 24, 2014, 06:11:40 PM
Here we go. This works for me:

Code:
     txid = 'aedf77851ee49a85857126b9003f8058c355c7e30e51a8ef5c74042a73ab247f'
     rawtx = access.getrawtransaction(txid)
     decodedtx = access.decoderawtransaction(rawtx)


Title: Re: python-bitcoinrpc (jgarzik) problem calling gettransaction()
Post by: kangarooz on May 24, 2014, 06:20:37 PM
Sorry hombre:

Quote
   rawtx = access.getrawtransaction(txid)
  File "/usr/local/lib/python2.7/dist-packages/bitcoinrpc/authproxy.py", line 116, in __call__
    raise JSONRPCException(response['error'])
bitcoinrpc.authproxy.JSONRPCException

Any other idea?
It's frustrating to work with documentations which aren't able to work ;O(.


Title: Re: python-bitcoinrpc (jgarzik) problem calling gettransaction()
Post by: RoxxR on May 24, 2014, 08:18:59 PM
Sorry hombre:

Quote
   rawtx = access.getrawtransaction(txid)
  File "/usr/local/lib/python2.7/dist-packages/bitcoinrpc/authproxy.py", line 116, in __call__
    raise JSONRPCException(response['error'])
bitcoinrpc.authproxy.JSONRPCException

Any other idea?
It's frustrating to work with documentations which aren't able to work ;O(.

What's the version of the bitcoind you're connecting to?