Retrieving Old Transaction in Bitcoin Core's console -getrawtransactions returns "no such mempool transaction" error I'm new to running a full bitcoin node. After almost a week I could download the entire blockchain. My computer is running 24/7 to support the cause.
When I tried to verify some old transactions that I have in the Bitcoin Core's console (version 0.20.1) I receive some error that I don't understand and my searches didn't help me resolve this issue.
I run this code in the console:
getrawtransaction transaction ID true
I paste the IDs for my past transactions
This code returns an error message saying:
No such mempool transaction. Use -txindex or provide a block hash to enable blockchain transaction queries. Use gettransaction for wallet transactions. (code -5)
It is worth mentioning that I don't use Bitcoin Core's wallet.I use a third-party wallet.
I created the bitcoin.conf file as follows (placed in ~/.bitcoin/bitcoin.conf) :
txindex=1
When I ran the bitcoin-qt I got the error message:
Error: Prune mode is incompatible with -txindex.
I was wondering if someone could help me resolve this issue?
Thanks
You're trying to use an optional feature of Bitcoin Core: the ability to query for old transactions.
This functionality needs:

(a) the full blockchain (where else would it get the transaction from)
(b) an index by txid so it doesn't need to read through 270 GB to find what you're looking for.

The error message you get is telling you that this (b) index is not enabled. When you try to enable it, it fails because you don't actually have the blockchain (a) in the first place (it's pruned), so it can't be indexed.
If you really need this functionality, you'll need to disable pruning, start syncing from scratch (as it'll need to download the blockchain again), and enable indexing.
However, you saying &quot;tried to verify&quot; perhaps highlights a misconception you have: getrawtransaction doesn't verify anything, it just retrieves the transaction in your local copy of the blockchain. Everything is already verified, even when it's not kept on disk. Generally when you care about a particular transaction, it's because it directly or indirectly affects your own funds, and the recommended solution for that is simply using good wallet software - it will only show you transactions that are verified and whose entire history is verified.