<p>Is your core compiled with the wallet? Because <code>gettransaction</code> RPC get wallet transactions, and hence need wallet capabilities. For general transactions, you should use <code>getrawtransaction</code> instead.<br />
I ran it here (with wallet enabled) and works just fine.</p>

CC BY-SA 4.0
2022-01-08T15:37:19.160Z
2022-01-08T15:37:19.160Z
Davidson Souza
<p>You're passing invalid <code>transaction</code> to the <code>gettransaction</code> method.</p>

CC BY-SA 4.0
2018-12-26T09:11:18.847Z
no that's not the case. I am passing a valid txId.
Divya Singh
CC BY-SA 4.0
2018-12-25T09:44:53.870Z
2018-12-25T09:44:53.870Z
Roman Kiselenko
<p>I am trying this command to get transaction from bitcoin testnet:</p>

<pre><code>curl  --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettransaction", "params": ["txId"] }' -H 'content-type: text/plain;' http://username:password@IP:PORT/
</code></pre>

<p>And i am getting following error</p>

<pre><code>{ "result":null, "error":{"code" :-32601, "message" : "Method not found"}, id:curltext}
</code></pre>

<transactions><blockchain><bitcoind><json-rpc><bitcoin-core-development>
json-rpc of bitcoin not working for testnet(curl command)
Divya Singh
# json-rpc of bitcoin not working for testnet(curl command)

(Asked by: username_0 on 2018-12-25)

I am trying this command to get transaction from bitcoin testnet:
curl  --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettransaction", "params": ["txId"] }' -H 'content-type: text/plain;' http://username:password@IP:PORT/

And i am getting following error
{ "result":null, "error":{"code" :-32601, "message" : "Method not found"}, id:curltext}

**Tags:** transactions, blockchain, bitcoind, json-rpc, bitcoin-core-development


---

## 2 answers

### Answer by username_1 on 2022-01-08. Score: 1

Is your core compiled with the wallet? Because `gettransaction` RPC get wallet transactions, and hence need wallet capabilities. For general transactions, you should use `getrawtransaction` instead.  
I ran it here (with wallet enabled) and works just fine.


---

### Answer by username_2 on 2018-12-25. Score: 0

You're passing invalid `transaction` to the `gettransaction` method.

> **Comments:**
> **username_0**: no that's not the case. I am passing a valid txId.  

---

