Closed SvenDowideit closed 2 years ago
so we can over-ride the fetch()
used by the new sol.Connection
, but its defined in terms of node-fetch
- so causes all sorts of build pain to do with node vs browser-side.
ideally, we'd have a fetch that knows how many requests we've made in the current ratelimit, and queues them up to avoid the thundering herd of complex multi-account display.
OMFG. so, now that i'm sharing the connection, i'm more likely to DOS theworkbench UI than get ratelimited.
I just picked an account on mainnet who'd response to getParsedTokenAccountsByOwner()
retuens 19MB of data
see https://explorer.solana.com/address/6ZRCB7AAqGre6c72PRz3MHLC73VMYvJ8bi9KHf1HFpNk/tokens
TODO: see if we can get paging added to the solana API
the UI freezes, presumably because its busy parsing that data.
access-control-allow-methods: OPTIONS, POST
access-control-allow-origin: http://localhost:1212
access-control-max-age: 86400
content-encoding: gzip
content-type: application/json; charset=utf-8
date: Wed, 20 Jul 2022 03:31:56 GMT
vary: origin
vary: Accept-Encoding
x-ratelimit-conn-limit: 40
x-ratelimit-conn-remaining: 37
x-ratelimit-connrate-limit: 40
x-ratelimit-connrate-remaining: 37
x-ratelimit-method-limit: 10
x-ratelimit-method-remaining: 9
x-ratelimit-rps-limit: 100
x-ratelimit-rps-remaining: 91
is also cool, shame its going to be complex to make use of it.
talking to mainnet
related to testing #261