Author Topic: Connecting to the RPC server  (Read 1644 times)

0 Members and 1 Guest are viewing this topic.

Offline jamesc

Vikram made a fix today that seems to stabilize the JSON port.

Offline jamesc

Also you should weigh pros and cons of http and Json port.   Http needs encoding and is a single command per connection unless you use the batch cmd, still single remote proc call type per connection.   Json need no headers but needs the login RPC call for many commands.  You use the id to track async commands in the same connection.   I saw a 20 fold improvement in a performance when getting balances for 101 local delegates.
« Last Edit: January 16, 2015, 01:30:59 am by jcalfee1 »

Offline jamesc

Maybe golang requires a status header and the client does not send one.   I am not at the PC now...



Offline ThePiachu

  • Newbie
  • *
  • Posts: 5
    • View Profile
I am trying to connect to the BitShares RPC server using this python code: https://github.com/ThePiachu/BitJSONPy

I run BitShares, issue the command of

rpc_start_server 19988
rpc_set_username user
rpc_set_password pass

and in my python code, I call:

bitshares = jsonrpc.ServiceProxy("http://user:pass@127.0.0.1:19988/rpc")
print bitshares.info()

In response, I get an error of

IOError: ('http protocol error', 0, 'got a bad status line', None)

I tried connecting to the same URL using some Golang code, and it fails as well.

Does anyone have an idea what could be causing this error?