How can I get the raw tx hex from bitcoind with the txid?

2

Is there any way to get the raw tx hex when I know the txid using bitcoind not third party. Currently I'm using a thirdparty (blockcypher) but now I want to switch to bitcoind.

Hoang Long

Posted 2018-04-23T03:17:33.647

Reputation: 21

Answers

4

You can enable the transaction index by using setting txindex=1 in your bitcoin.conf file or starting bitcoind with the -txindex option. This option will allow you to use the getrawtransaction command on any transaction in the Bitcoin blockchain or in the node's mempool.

Note that setting this option will require you to reindex bitcoind if it was not already enabled.

Andrew Chow

Posted 2018-04-23T03:17:33.647

Reputation: 40 910