I'm running a testnet node. I can use bitcoin-cli just fine:
>bitcoin-cli.exe getinfo
{
"version" : 100000,
"protocolversion" : 70002,
"walletversion" : 60000,
[... snipped]
But when I run this python code:
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
import logging
rpc_user = "rpcuser"
rpc_password = "xxxxx"
logging.basicConfig()
logging.getLogger("BitcoinRPC").setLevel(logging.DEBUG)
rpc_connection = AuthServiceProxy("http://%s:%[email protected]:8332/" % (rpc_user, rpc_password))
print(rpc_connection.getinfo())
I get this error:
DEBUG:BitcoinRPC:-1-> getinfo []
Traceback (most recent call last):
File "<path>\rawtransactiondemo\raw.py", line 11, in <module>
print(rpc_connection.getinfo())
[... snipped]
File "C:\Python27\lib\json\decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
This is my bitcoin.conf:
testnet=1
rpcuser=bitcoinrpc
rpcpassword=xxxxx
daemon=1
rpcport=8332
rpcallowip=192.168.1.39
bind=192.168.1.39
I'm using the python-bitcoinrpc library.