2

I am trying getting the raw of transaction. But I am getting the following error with following command and RPC call as well.

bitcoin-cli getrawtransaction ad844933ceb9cf990fd75ebd2f6731527885e31d1a4c9ea292db235bcd64bdbe

Error No such mempool transaction. Use -txindex to enable blockchain transaction queries. Use gettransaction for wallet transactions.

1 Answer 1

2

use

txindex = 1

in you bitcoin.conf file and restart daemon with -reindex flag if you are building it for the first time, it might take a while but after txindex is defined you can get data for any transaction in blockchain no matter if its related to your wallet or not.

Alternetivly you can start your daemon with

 bitcoind -daemon -txindex=1 -reindex=1

Either way it functions the same

6
  • Always I have to add the -txindex flag to restart the daemon. Currently i am using bitcoind -deprecatedrpc=accounts to start a daemon Feb 21, 2019 at 6:53
  • "Use -txindex to enable blockchain transaction queries." line has been removed from the error But I am still getting the following error "No such mempool or blockchain transaction. Use gettransaction for wallet transactions." Feb 21, 2019 at 6:58
  • add txindex=1 and reindex=1 in your bitcoin.conf file, and make sure you start your daemon with -reindex=1 for the first time, it will take a while for your blockchain to reindex ,the progress can be seen in debug.log , after the reindexing is done you should not encounter same error again
    – cryptoKTM
    Feb 21, 2019 at 7:01
  • 1
    I have added the txindex=1 and reindex=1 in your bitcoin.conf file and restarted the daemon with command "sudo bitcoind -daemon -txindex=1 -reindex=1" and still i am getting the following error "No such mempool or blockchain transaction. Use gettransaction for wallet transactions." Feb 21, 2019 at 7:06
  • FYI " Use -txindex to enable blockchain transaction queries. " line has been removed from the error. this is a another error with error code -5 Feb 21, 2019 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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