How to see bitcoin ...
 
Notifications
Clear all

How to see bitcoin transaction info  

  RSS

Abhijith
(@abhijith)
Noble Member
Joined: 4 months ago
Posts: 1161
31/03/2021 10:15 am  

I want to see foreign bitcoin transaction info and I am using this following code:

bitcoind gettransaction \

  9962d5c704ec27243364cbe9d384808feeac1c15c35ac790dffd1e929829b271

But when I run this, I get the following result:

error: {"code":-5,"message":"Invalid or non-wallet transaction id"}

Quote
Ganesh A
(@ganesh)
Noble Member
Joined: 4 months ago
Posts: 1170
31/03/2021 10:18 am  

You can view foreign transactions using bitcoind.

  1. Set txindex=1 in your bitcoin.conf file.
  2. restart bitcoind with -reindex (you need to re-build your entire index)

Next, run the following code:

$ bitcoind getblockcount

122735


$ bitcoind getblockhash 67543

0000000004e213266ccd388df12896412c1a70e647b48004f7d6894b9d6f63b9


$ bitcoind getblock 0000000004e213266ccd388df12896412c1a70e647b48004f7d6894b9d6f63b9

// JSON containing tx "a93a668d9332e21d51380c7251bbf5ad47295ca9795e0ad6f2fe8d63b76af9aa"


$ bitcoind getrawtransaction a93a668d9332e21d51380c7251bbf5ad47295ca9795e0ad6f2fe8d63b76af9aa 1

// json of transaction - note that "1" at the end tells bitcoind to decode into json

For more information, visit:  https://bitcoin.stackexchange.com/questions/11759/get-non-wallet-transactions-using-bitcoin-rpc-gettransaction

 


ReplyQuote
Share: