BlockSci
BlockSci copied to clipboard
CurrencyConverter tool failing (502 Server Error)
I'm guessing that it's hitting some limit on the maximum number of entries that can be returned.
Works
- https://api.coindesk.com/v1/bpi/historical/close.json?index=USD¤cy=USD&start=2010-07-21&end=2018-02-20
- https://api.coindesk.com/v1/bpi/historical/close.json?index=USD¤cy=USD&start=2010-07-19&end=2018-02-19
Fails (in screenshot above)
- https://api.coindesk.com/v1/bpi/historical/close.json?index=USD¤cy=USD&start=2010-07-19&end=2018-02-20
I solved this by persisting previous responses in a local DB and only querying for new data. But I'm not sure how the BlockSci team wants to do this for your official distribution.
Currently there's no internal rate limiting in the CurrencyConverter and thus it starts getting blocked if it gets used to frequently. Persisting to a local DB definitely seems like a good approach to handle this. We should definitely add functionality into the library to handle this class of errors nicely rather than just throwing the Gateway error at the user with no context.