Closed jwst9 closed 2 weeks ago
How about querying onchain events directly from the frontend instead of backend & db? and cache the result in local storage
You can't query events from nodes for longer than 1024 blocks, which is less than 1 hour
Sorry, I was able to query events 18 days ago using viem's createContractEventFilter. I think it's technically feasible to query events as much long as we want because events are stored on blocks
Each query can't span more than 1024 blocks, it is hard coded in RPC node code. Frontend would have to do over a thousand queries to get latest data without a backend index
You are right. I can't know how long ago we have to query the block following my approach.
Can you invite me to your google datastore?
show offer details when clicking it?
Clickable link (new window) to the domain
What should each event (created and accepted) show before clicking?
Source and destination asset, source amount, accept amount, exchange rate (based on current price), domain name, creation time, age
Should accepted offer show exchange rate based on the rate at the time of accepted? (instead of current price)
Yes. Show both if possible
It's hard to achieve pagination using gcp datastore / firestore as it doesn't fully support limit and "or where" How about switching to supabase (postgres)?
Postgres is fine.
Datastore limit query is https://cloud.google.com/datastore/docs/samples/datastore-limit#datastore_limit-nodejs . It also supports cursor and scan
where
is by using filter, see https://github.com/polymorpher/sms-wallet/blob/e2c089e88b90cad226bc4389b8db5186e16e4bb2/server/src/data/generic.ts#L37 and related code for example.
From @polymorpher on July 3, 2024 via Telegram: