What I thought I should do
I implemented this functionality with Bitcoin Core through zmq support.
- Keep "my transactions" through
zmq
'srawtx
topic. - When received
zmq
'srawblock
, decode the raw block, get transaction ids from it, compare them with 1's transaction id, and confirm them if matched.
So I thought I should be doing
- Find something like Bitcoin Core.
- Find some TCP interface.
- Do the above 1-2.
What I tried so far
So first of all I chose to use geth
, which is one of the most popular Ethereum-implementing node, and looked for RPC-PUB-SUB docs. I found that its newPendingTransactions
subscription corresponds to zmq
's rawtx
. But I couldn't seem to find what corresponds to zmq
's rawblock
. Of course there's a newHeads
subscription, but for what the API returns, I don't see any hint to decode which transactions are mined by that block.
Some library like ethereumjs-block does seem to create a block from raw Buffer though.
What I'm trying to do
Be independent as much as possible from what geth
's wallet system offers. The best thing is to only use that PUB-SUB functionality. (Get a raw block, decode it, get transactions, and so on.)
If I go one step back, I may do polling via, like, eth_blocknumber
and eth_getBlockByNumber
, but that's not what I want for now.
If there's other way around for this, please give me some rough idea. I don't mind using other Ethereum client.