Author

Topic: [Q] [Dev] Bitcoin-Qt.exe, RPC and cURL/Python (win7 x64) (Read 734 times)

newbie
Activity: 3
Merit: 0
Update: I'm trying to get the Python solution working as well, but I'm encountering issues using this approach also.

I installed jsonrpc and bitcoinrpc according to jgarzik's https://bitcointalksearch.org/topic/python-bitcoin-friendly-json-rpc-library-5314 but I get the following error when running the query:

Code:
\Python\Lib\site-packages\bitcoinrpc>query2.py
Traceback (most recent call last):
  File "\Python\lib\json\decoder.py", line 368, in raw_decode
    obj, end = self.scan_once(s, idx)
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "\Python\Lib\site-packages\bitcoinrpc\query2.py", line 8, in ule>
    data = bitcoin.getwork()     # call bitcoin 'getwork' RPC
  File "\Python\Lib\site-packages\bitcoinrpc\authproxy.py", line 106, in
 __call__
    response = self._get_response()
  File "\Python\Lib\site-packages\bitcoinrpc\authproxy.py", line 132, in
 _get_response
    parse_float=decimal.Decimal)
  File "\Python\lib\json\__init__.py", line 332, in loads
    return cls(**kw).decode(s)
  File "\Python\lib\json\decoder.py", line 352, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "\Python\lib\json\decoder.py", line 370, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

I'd appreciate any feedback. Thank you.
newbie
Activity: 3
Merit: 0
Hello Everyone,

This is my first post on BTCtalk, although not my first visit. I was hoping to post in the technical discussion section, but the rules forbid me. In any case, I hope someone could point me in the right direction.

I would like some help on successfully communicating with the bitcoin-qt.exe using RPC. I've read that I need to add an rpcuser and rpcpassword in the conf file - already done. I've looked at the API reference online and I've tried sending a command using cURL, but it's not going through.

The command is curl --user myuser --data-binary "{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getinfo\", \"params\": [] }" -H "content-type: text/plain;" http://127.0.0.1:8332/, note the changes from the online documentation to run on Windows, mainly replacing " with \" and ' with ". The error I get is  Failed connect to 127.0.0.1:8332; No error.

Curl version is 7.30.0 with SSL. What am I missing?

Thanks in advance.


Regards,
Trafiq
Jump to: