Bitcoin Forum
June 07, 2024, 07:53:45 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin all transaction live monitor  (Read 1321 times)
wpsd (OP)
Newbie
*
Offline Offline

Activity: 41
Merit: 0


View Profile
October 28, 2015, 08:56:11 AM
 #1

Hi while searching a good way to monitor all transaction live without third party I stumble this code
https://bitcointalk.org/index.php?topic=102740.0

but it doesn't seems to work on bitcoind 0.11, do anyone has similar code ?
unamis76
Legendary
*
Offline Offline

Activity: 1512
Merit: 1009


View Profile
October 28, 2015, 12:34:11 PM
 #2

Have you tried this?
wpsd (OP)
Newbie
*
Offline Offline

Activity: 41
Merit: 0


View Profile
November 03, 2015, 09:17:30 AM
 #3

Have you tried this?

Yeah I check the source code it has nice filtering  Cheesy, but the source still use blockchain.info
I need to be able to read from my own bitcoin node

currently I'm thinking too read rawmempool, but it will be slow to check which one is new which is one is not.

This approach seems better but it's not working, if i'm not wrong it read directly from tcp package
Quote

CrappyJavaScriptDev
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
November 03, 2015, 05:45:55 PM
 #4

Have you tried this?

Yeah I check the source code it has nice filtering  Cheesy, but the source still use blockchain.info
I need to be able to read from my own bitcoin node

currently I'm thinking too read rawmempool, but it will be slow to check which one is new which is one is not.

This approach seems better but it's not working, if i'm not wrong it read directly from tcp package
Quote



Just knocked something similar out in javascript for you. It will log the Tx Hash and output addresses + satoshis to the console. You can also set an option to change the color if an output is above a certain BTC threshold and you can do the same for addresses.

Defaults to localhost but you should be able to connect to any node.

Github link: https://github.com/CrappyJSDev/Simple-Bitcoin-Tx-Monitor

Not sure what you're after but it would be fairly easy to add socket support or a db of some kind.
wpsd (OP)
Newbie
*
Offline Offline

Activity: 41
Merit: 0


View Profile
November 04, 2015, 06:18:59 AM
 #5

Quote
Not sure what you're after but it would be fairly easy to add socket support or a db of some kind.
Basically I'm going to build a wallet service but for internal only, which will be use for payment system in our public product. So nothing fancy.

I'm not quite understand nodejs.
Could you be kind to tell me how this code works ?

From what I see you just connect to the bitcoin node using rpc, then waiting for transaction with "peer.on("tx", function(m) {...});" and "peer.on('block', function(m) {...}" when there is a new block found.

Shouldn't we send some rpc message before waiting new tx ? Cause I didn't see any rpc method that can notify new tx unless for our own wallet.

I need to monitor all transaction not just my wallet.

CrappyJavaScriptDev
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
November 04, 2015, 06:49:13 AM
 #6

Quote
Not sure what you're after but it would be fairly easy to add socket support or a db of some kind.
Basically I'm going to build a wallet service but for internal only, which will be use for payment system in our public product. So nothing fancy.

I'm not quite understand nodejs.
Could you be kind to tell me how this code works ?

From what I see you just connect to the bitcoin node using rpc, then waiting for transaction with "peer.on("tx", function(m) {...});" and "peer.on('block', function(m) {...}" when there is a new block found.

Shouldn't we send some rpc message before waiting new tx ? Cause I didn't see any rpc method that can notify new tx unless for our own wallet.

I need to monitor all transaction not just my wallet.



It doesn't connect to the node using rpc at all. What it actually does it uses bitpays bitcore (and bitcore-p2p) libraries to connect to the p2p network as you can see in the below screenshot.

https://i.imgur.com/ZI3PsU7.jpg

Once connected over the p2p network we can broadcast and receive messages from other nodes. For reference please check https://bitcoin.org/en/developer-guide#transaction-broadcasting and https://bitcore.io/api/p2p

I haven't looked over the code that you linked in your OP but they both should work on the same principal.
wpsd (OP)
Newbie
*
Offline Offline

Activity: 41
Merit: 0


View Profile
November 04, 2015, 11:50:39 AM
 #7

Quote
It doesn't connect to the node using rpc at all. What it actually does it uses bitpays bitcore (and bitcore-p2p) libraries to connect to the p2p network as you can see in the below screenshot.

Ok I need to study more.
So basically we create a tiny bitcoin node and connect to p2p so we can get the broadcasted transaction from other real bitcoind.  Huh
The different is we can tweak this to our need  Cheesy
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!