Situation:
I am using web3.js
with geth
for my application to know which clients are depositing money into 1 specific account (instead of making a new wallet for each new client). The way I am attempting to do this is via the data value in the transactionObject:
transcationObject = {
from: sender,
to: receiver,
value: amount,
data: 2134235141 //uniquely generated value for this user
}
Problem:
The problem is I need a way for my application to store all the transactionObjects of the accounts that are sending Ether to my account. From there it's pretty easy to know who sent how much by looking at the data value.
Potential Solution:
After searching online, I found the function eth.setFilter
. To my understanding, what this does is filters all the transactions that are being added to the blockchain of the local node, and only saves the ones that pass through the filter.
source of learning about eth.setFilter: How to trace state of transactions in ethereum
Question:
Is the previous explanation how eth.setFilter
actually works? Is it integrated with the process of saving new transaction information into the blockchain?
AND could someone provide an example of how it is used? I saw some examples with curl
online (the link above), but I had no idea what that code actually does. Does it modify how the blockchain operates indefinitely? Or does it need to be re-run? Is there a better way to do it?
Note: If some of the questions above are irrelevant to the answer you are providing, it's completely fine. I am mostly trying to find a solution of how to use eth.newFilter
and understand what it is doing with that code.