Hi,
I have a question about navigating transaction histories…
Lets say I have a smart contract that performs certain transactions for a user. These transactions might involve certain actions do do x,y,z.
Now lets say that user signs into my dapp and identifies themself with their eth address using metamask.
Lets say that I want my Dapp to display in a webpage all the transaction history of the user. Lets assume there are hundreds of transactions… maybe thousands.
So should I use web3 to somehow ‘trawl’ the eth blockchain (which might include paging many chunks) to find all the transactions for the user ? (and if so what functions do this?)
or
Should my smart contract really keep an internal mapping of of each users list of transactions e.g. mapping(address => SomeStructRepresentingTransaction[]) userTrans;
and just have web3 access this (via a helper function in the smart contract)?
appreciate any advice
thanks