I'm trying to make connection to my JSON RPC via python script. I've tried several different libraries, the one I got most success gives me that message:
Traceback (most recent call last):
File "test_conn_btc.py", line 6, in <module>
x = server.request('getinfo')
File "/usr/local/lib/python3.4/dist-packages/jsonrpcclient/server.py", line 98, in request
return self.handle_response(self.send_message(request), True)
File "/usr/local/lib/python3.4/dist-packages/jsonrpcclient/server.py", line 133, in handle_response
json_validator.validate(response_dict)
File "/usr/local/lib/python3.4/dist-packages/jsonschema/validators.py", line 123, in validate
raise error
jsonschema.exceptions.ValidationError: 'jsonrpc' is a required property
Failed validating 'required' in schema['allOf'][0]:
{'properties': {'id': {'oneOf': [{'type': 'string'},
{'type': 'integer'},
{'type': 'null'}]},
'jsonrpc': {'enum': ['2.0'], 'type': 'string'}},
'required': ['jsonrpc', 'id'],
'type': 'object'}
On instance:
{'error': None,
'id': 1,
'result': {'balance': 1.89,
'blocks': 598181,
'connections': 8,
'difficulty': 7150.92333102,
'errors': 'WARNING: abnormally high number of blocks '
'generated, 11409 blocks received in the last '
'4 hours (24 expected)',
'keypoololdest': 1447081146,
'keypoolsize': 104,
'paytxfee': 0.0,
'protocolversion': 70002,
'proxy': '',
'relayfee': 5e-05,
'testnet': True,
'timeoffset': -1,
'version': 110100,
'walletversion': 60000}}
Here is the code of script:
from jsonrpcclient.http_server import HTTPServer
import json
# docs at https://jsonrpcclient.readthedocs.org/http.html
server = HTTPServer('http://127.0.0.1:18332', auth=('user', 'password'))
x = server.request('getinfo')
print(x)
What may be the problem?