Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Connecting to the RPC server  (Read 306 times)

0 Members and 1 Guest are viewing this topic.

Offline ThePiachu

  • Newbie
  • *
  • Posts: 5
    • View Profile
Connecting to the RPC server
« on: January 15, 2015, 11:17:38 PM »

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:[email protected]: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?

Offline jcalfee1


Offline ThePiachu

  • Newbie
  • *
  • Posts: 5
    • View Profile

Offline jcalfee1

Re: Connecting to the RPC server
« Reply #3 on: January 16, 2015, 01:09:19 AM »
Maybe golang requires a status header and the client does not send one.   I am not at the PC now...

Offline jcalfee1

Re: Connecting to the RPC server
« Reply #4 on: January 16, 2015, 01:19:35 AM »
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 jcalfee1

Re: Connecting to the RPC server
« Reply #5 on: January 16, 2015, 01:22:10 AM »
Vikram made a fix today that seems to stabilize the JSON port.

 

Google+