Author

Topic: Is JSONRPC still supported? (Read 416 times)

sr. member
Activity: 1330
Merit: 307
May 08, 2017, 12:07:34 AM
#4
It looks like electrum 2.8.2 isnt giving an error about the wallet being loaded, which is why I am getting the error above. I will lock this thread now but if I have any issues I will reopen it or just submit an issue to electrum github.
sr. member
Activity: 1330
Merit: 307
April 30, 2017, 11:27:45 PM
#3
I been messing around with electrum and decided to try its jsonrpc. After setting up the daemon and run the curl command, it gives an server error after running it.

Code:
curl --data-binary '{"id":"curltext","method":"getbalance","params":[]}' http://127.0.0.1:7777
{"error": {"message": "Server error:   File \"/usr/lib/python2.7/site-packages/electrum/commands.py\", line 301, in getbalance | AttributeError: 'NoneType' object has no attribute 'get_balance'", "code": -32603}, "jsonrpc": "2.0", "id": "curltext"}

Does electrum still support this? The version im using is 2.8.2. Maybe im doing something wrong or maybe something broke between the version the doc used and now.



The function is get_balance with an underscore. Check out http://docs.electrum.org/en/latest/protocol.html for more information on the JSONRPC.

I tried that before and got an error that the method isnt supported (it does it with about anything that is not a proper command).

Code:
curl --data-binary '{"id":"curltext","method":"get_balance","params":[]}' http://127.0.0.1:7777
{"error": {"message": "Method get_balance not supported.", "code": -32601}, "jsonrpc": "2.0", "id": "curltext"}

With random method
Code:
curl --data-binary '{"id":"curltext","method":"balanceget","params":[]}' http://127.0.0.1:7777
{"error": {"message": "Method balanceget not supported.", "code": -32601}, "jsonrpc": "2.0", "id": "curltext"}


EDIT: I did notice that there was a fix in https://github.com/spesmilo/electrum/commit/0e49274eae9f497164ecc694729acdcf1188a43a but did that ever make it out in 2.8.2 or should I install master?
legendary
Activity: 1736
Merit: 1023
April 30, 2017, 07:31:18 PM
#2
I been messing around with electrum and decided to try its jsonrpc. After setting up the daemon and run the curl command, it gives an server error after running it.

Code:
curl --data-binary '{"id":"curltext","method":"getbalance","params":[]}' http://127.0.0.1:7777
{"error": {"message": "Server error:   File \"/usr/lib/python2.7/site-packages/electrum/commands.py\", line 301, in getbalance | AttributeError: 'NoneType' object has no attribute 'get_balance'", "code": -32603}, "jsonrpc": "2.0", "id": "curltext"}

Does electrum still support this? The version im using is 2.8.2. Maybe im doing something wrong or maybe something broke between the version the doc used and now.



The function is get_balance with an underscore. Check out http://docs.electrum.org/en/latest/protocol.html for more information on the JSONRPC.

Edit: looks like that is actually for querying the balance of an individual address which is different than what you were attempting.
sr. member
Activity: 1330
Merit: 307
April 30, 2017, 02:43:13 AM
#1
I been messing around with electrum and decided to try its jsonrpc. After setting up the daemon and run the curl command, it gives an server error after running it.

Code:
curl --data-binary '{"id":"curltext","method":"getbalance","params":[]}' http://127.0.0.1:7777
{"error": {"message": "Server error:   File \"/usr/lib/python2.7/site-packages/electrum/commands.py\", line 301, in getbalance | AttributeError: 'NoneType' object has no attribute 'get_balance'", "code": -32603}, "jsonrpc": "2.0", "id": "curltext"}

Does electrum still support this? The version im using is 2.8.2. Maybe im doing something wrong or maybe something broke between the version the doc used and now.

Jump to: