Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optional api for callReadOnlyFunction #10

Open
pseudozach opened this issue Jul 13, 2022 · 2 comments
Open

optional api for callReadOnlyFunction #10

pseudozach opened this issue Jul 13, 2022 · 2 comments

Comments

@pseudozach
Copy link
Collaborator

during startup hiro api at https://stacks-node-api.stacks.co gives 429 possibly due to many simultaneous callReadOnlyFunction at https://github.com/LNSwap/lnstxbridge-client/blob/main/lib/wallet/providers/SIP10WalletProvider.ts#L76

so it's a good idea to add an optional network param where another api instance can be used - preferably lnswap api instance.

@whoabuddy
Copy link
Contributor

Another option here is throttled-queue, it's a simple TS package that allows you to specify the intervals for API requests, and you can see an example here in the CityCoins UI for all functions that fetch JSON.

Before that we were plagued by 429 errors!

@pseudozach
Copy link
Collaborator Author

pseudozach commented Aug 5, 2022

@whoabuddy that's a great idea thanks, will definitely look into it! I also want to identify why so many queries go out during internal wallet initialization but properly queueing it sounds like the best future-proof option!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants