AustEcon / bitsv

BitSV: Bitcoin made easy. Documentation:
https://AustEcon.github.io/bitsv
MIT License
96 stars 28 forks source link

Printing to stdout on network retries #38

Closed ghost closed 5 years ago

ghost commented 5 years ago

https://github.com/AustEcon/bitsv/blob/master/bitsv/network/services/network.py#L57

Never, ever should a library print to stdout unless asked to. We can change this to write to stderr. We can remove it. Or we can just do logging.warning and let the upstream logging setup handle it. We can also change the default logging level. All of these are fine.

Also, Bitindex is down, again.

ConnectionError: All APIs are unreachable, exception:504 Server Error: Gateway Time-out for url: https://api.bitindex.network/api/v3/main/addrs/utxo

Been down for a few hours now. Do you have external monitoring in place?

ghost commented 5 years ago

I'm sorry for the tone. I'm a systems guy so this stuff bothers me more than it does most. If you need help with it, just let me know. I rely on this code in production so it's important for me that it works. Happy to help here in this library, with Bitindex, add in other APIs, whatever.

ferndot commented 5 years ago

@teran-mckinney Nice catch. For simplicity, it seems best to allow upstream logging to handle this, unless we can think of a pertinent use case that would necessitate this function to accept a logger argument and follow this additional logic.

AustEcon commented 5 years ago

Ah sorry. Yeah that's not good. I concur with the preference for allowing upstream logging to handle it. Seems really weird to have it as a parameter. I think you merged this though @teran-mckinney in #26! 😝 So maybe there's a little blame for both of us? 😛. As far as BitIndex being down on mainnet... I have a Whatsonchain API already setup (and available from pypi - https://github.com/AustEcon/whatsonchain) but I am waiting on them to add "confirmations" to the utxo response... until then it is no use wiring it up... I did contact them and they said that it's now on their to-do list... (latest update: https://t.me/c/1222215300/934)

edit: As to your question about external monitoring - Nope. Maybe UpTimeSV could come in handy eh! And if you can chip in on this one that would be great. Otherwise, I can do it tomorrow I guess.

AustEcon commented 5 years ago

https://bchsvexplorer.com/api/addr/ is a possibility (just for mainnet)... I'm pretty sure I have the code for that lying around somewhere... if I find it, I'll drop it in and do a PR.

edit: found it! In-coming...

ghost commented 5 years ago

Yeah, completely my fault, I should have caught it. I think I'm being careful sometmes with reviews when really I might not be.

Thank you!

BitIndex is back, too.

AustEcon commented 5 years ago

No I actually saw it and thought "oh that's weird!... " and then stupidly continued on my merry way... 🙄

Yes BitIndex got DDOS attacked if you didn't know. See: https://twitter.com/MatterCloud/status/1152660923448025089?s=20

AustEcon commented 5 years ago

Closing this issue. Fixed in #42