0

I put this one together that claims "no JSON object could be decoded".

from bitcoinrpc.authproxy import AuthServiceProxy

access = AuthServiceProxy("http://user:password@127.0.0.1:8332")

printme=access.getrawtransaction("6359f0868171b1d194cbee1af2f16ea598ae8fad666d9b012c8ed2b79a236ec4")

print printme

My bitcoin core wallet is set to "server=1" and "listen=1", but it is currently downloading the blockchain (idk if that would have an impact).

1

If you are still downloading the blockchain and you haven't downloaded and verified that transaction yet, then of course you will get an error when you try to look it up, Bitcoin Core doesn't know about it yet!

Furthermore, if that transaction is not part of your wallet or in the UTXO set (i.e. one of the outputs is unspent), then getrawtransaction won't work. Bitcoin Core can only retrieve arbitrary transactions if you have enabled the transaction index with txindex=1.

0

need to download blocks from the server Maybe you can try on this (python 3) You need to install bitcoinrpc

#!/usr/bin/python
import json
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException



rpc_connection = AuthServiceProxy("http://%s:%s@127.0.0.1:8332"%("rpc_username", "rpc_password"))
result = rpc_connection.getrawtransaction  ("52309405287e737cf412fc42883d65a392ab950869fae80b2a5f1e33326aca46")
print(result)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.