I am running a bitcoin node on my machine, fully synced with RPC commands enabled, rpc server live and txindex=1.
In the command-line I can run the following RPC call and obtain the information about the transaction I require. I am using the cli as I need to process 2.5 million transactions.
./bitcoin-cli decoderawtransaction $(./bitcoin-cli getrawtransaction b601fc820d66b6516f89557fba9b40943df962de96b914547dec72b0f047c2f3)
Which returns a JSON output of the transaction.
However, when run with the python-bitcoinlib library it seems to give the following error message
import bitcoin, bitcoin.rpc
bitcoin.SelectParams("mainnet")
rpc = bitcoin.rpc.Proxy()
rpc.getrawtransaction("b601fc820d66b6516f89557fba9b40943df962de96b914547dec72b0f047c2f3")
InvalidParameterError: {u'message': u'parameter 1 must be of length 64 (not 128)', u'code': -8}
What am I doing wrong, isn't b601.. the transaction id?
Edit: As per comment
I fixed it by replacing rpc=bitcoin.rpc.Proxy()
with rpc=bitcoin.rpc.RawProxy()
. But I would still like to know why the previous fails.
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments