Out of the box, you can only look up a transaction by its index when the transaction is associated with a wallet you own. This optimization makes sense from an efficiency perspective because should you waste disk space on transactions that aren’t your own? That is a good point, but you don’t save much space.
Adding an index to the already 388GB blockchain database means only adding an extra 35GB. You’ve probably got that and plenty more to spare. There is a hugely valuable bonus, though: you can study Bitcoin’s blockchain.
Bitcoin’s blockchain is its database of transactions from transaction #1 up to today. Instead of just hearing great things about it, you can study it for yourself. You don’t have to take anybody’s word for it: it is 100% Immutable, Public, and Open—three central tenets to defining an actual cryptocurrency. With that in mind, here is how to get that index.
There are two ways to set up the index: the first time you install Bitcoin or some point after that.
If you are setting up Bitcoin for the first time, you need to configure it before synchronizing with the chain. If you are running the server version (bitcoind), then you can configure it before running it. The configure is simple:
Create your bitcoin.conf
Add: ~txindex=1
That is it; you are done.
If you have either already run bitcoind or set up the GUI version (it creates the configuration just before running itself, you might be able to pre-create the config file for it: if you are knowledgable, then you probably can get away with it), then Bitcoin has already run, and in addition to configuring it, you also need to reindex all of the chain that has been downloaded.
To do that, add the tikindex
config but when you start Bitcoin next time, pass the command line parameter -reindex
to it. When it starts, you will see in reindexing. It can take a while, but it is worth it.
That is all it takes. Soon you will be looking up non-wallet transactions with total freedom: have fun!