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

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

CC BY-SA 3.0
2018-04-23T04:04:09.260Z
2018-04-23T04:04:09.260Z
Ava Chow
<p>Is there any way to get the raw tx hex when I know the txid using <code>bitcoind</code> not third party. Currently I'm using a thirdparty (blockcypher) but now I want to switch to <code>bitcoind</code>.</p>

<bitcoind><json-rpc><raw-transaction>
How can I get the raw tx hex from bitcoind with the txid?
Hoang Long
# How can I get the raw tx hex from bitcoind with the txid?

(Asked by: username_0 on 2018-04-23)

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`.

**Tags:** bitcoind, json-rpc, raw-transaction


---

## 1 answers

### Answer by username_1 on 2018-04-23. Score: 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.


---

