MultiversX Tracker is Live!

What is the required input for python-bitcoinlib getrawtransaction command?

Bitcoin Stack Exchange

Bitcoin News / Bitcoin Stack Exchange 208 Views

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.


Get BONUS $200 for FREE!

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