Open cromachina opened 3 months ago
It looks like the chaingraph testnet instance returns invalid data... I am getting various errors (mainly ConnectionResetError: [Errno 104] Connection reset by peer
) when running your code snippet.
Sadly this is the single main recurring issue that BitCash has been dealing with pretty much forever: none of the third party services used to interact with the blockchain are reliable.
However, the mainnet instance seems to be working fine:
import bitcash
k = bitcash.PrivateKey()
k.get_balance()
# Returns '0'
FYI @cromachina here is the response from ChainGraph when querrying the block height:
Request:
curl -X POST \
-H "Content-Type: application/json" \
-d '{"query": "query GetBlockheight($node: String!) { block(limit: 1, order_by: { height: desc }, where: { accepted_by: { node: { name: { _like: $node } } } }) { height } }", "variables": { "node": "%testnet" }}' \
https://demo.chaingraph.cash/v1/graphql
Response:
{
"errors": [
{
"extensions": {
"code": "unexpected",
"path": "$"
},
"message": "database query error"
}
]
}
and the worst thing is it's a 200 status code... Again, it looks like this is specific to testnet.
So that doesn't seem to be an issue with BitCash, though it is breaking BitCash as a result. I suggest raising an issue with Chaingraph directly so hopefully they can fix it: https://github.com/bitauth/chaingraph
Actually I'll leave this open even though it's an issue with Chaingraph, in case anyone is having the same problem.
Hopefully this is fixed soon 🤞🏻
An error is thrown when trying to extract data from a ChaingraphAPI response, seemingly. Minimal example: