1

Currently, I have a node.js application which interacts with geth through web sockets. I have a listener,

web3.eth.subscribe( 'pendingTransactions', function(err, result) { 

    if(!err) { 
        console.log(result) 
    } 

}) 
.on('data', function(transaction) {  

    console.log( transaction ) 

}

This listener is working perfectly fine, but it gives me data whenever any unmined transaction is detected by my geth node.

I know, i can use to and from properties from the transaction details and check if this transaction belongs to my address.

However, I would like to know if there is some way by which i can automatically get pending transactions related to my wallet addresses only like in bitcoin (wallet-notify).

If not, am I thinking the right way that I will need to filter these transactions out myself?

Also, what is the best approach to monitor transactions? What if I somewhow, miss a websocket notification. Now, how can i sync my transactions native database with blockchain database?

It would be great if anybody can share his inputs/experience here

Thanks in advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.