I am trying to build a dapp which will monitor a particular address balance, and update in case someone send fund (ether) to it.
Instead of polling using call getBalance, I want to take advantage of the relatively new subscription API through WebSocket (https://github.com/ethereum/go-ethereum/wiki/RPC-PUB-SUB). While I can successfully connect geth using WebSocket, I am struggling to apply the correct filter to the subscription.
Which subscription type should I use? If I use newHeads
or newPendingTransactions
, what is the correct filter for this kind of case? BTW, I try "logs" before, it seems that the address parameter is only for contract address but not "regular" address (if you understand what I mean).
Thank you.