Closed sawyerru closed 2 years ago
Hello, I'm having an issue collecting the network hash rate. I've used this repo to collect transaction and network information before, but I'm having issues with the getnetworkhashps() function.
getnetworkhashps()
It's throwing this error:
decimal.InvalidOperation: [<class 'decimal.InvalidOperation'>]
SCRIPT:
# needed to connect to btc node btc_rpc_connection = AuthServiceProxy("http://%s:%s@%s"%(RPC_BTC_USER, RPC_BTC_PASS, BTC_NODE)) x = btc_rpc_connection.getnetworkhashps() print(x)
Any help would be great. Thanks
Closing.
Updated with:
async def main(): async with BitcoinRPC(f"http://{BTC_NODE}", RPC_BTC_USER, RPC_BTC_PASS) as rpc: y = await rpc.getnetworkhashps(height=100) print(y)
Hello, I'm having an issue collecting the network hash rate. I've used this repo to collect transaction and network information before, but I'm having issues with the
getnetworkhashps()
function.It's throwing this error:
SCRIPT:
Any help would be great. Thanks