There are two different data sources that need to be kept in sync:
Waku
Blockchain events
The caching / fetching strategy needs to be compatible with both technologies.
Currently all marketplace items are refetched when the marketplace is open. Of course, this will quickly become unscalable, as with thousands of items it would take a lot of time to load. We could cache those items, but with multiple marketplaces having many items each, that would quickly take up a lot of space.
Alternatively, we could fetch the last x items and implement infinite scrolling
Technically we can't just say "give me the last 100 events"
It could kind of be simulated by calling getLogs on lastBlock - x - i * x to lastBlock - i * x in a loop where x is some arbitrary number and i increases by 1 in each iteration
There are two different data sources that need to be kept in sync:
The caching / fetching strategy needs to be compatible with both technologies.
Currently all marketplace items are refetched when the marketplace is open. Of course, this will quickly become unscalable, as with thousands of items it would take a lot of time to load. We could cache those items, but with multiple marketplaces having many items each, that would quickly take up a lot of space.
Alternatively, we could fetch the last x items and implement infinite scrolling
getLogs
onlastBlock - x - i * x
tolastBlock - i * x
in a loop wherex
is some arbitrary number andi
increases by1
in each iteration