Bitcoin Forum
June 23, 2024, 01:55:08 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is JSONRPC still supported?  (Read 416 times)
ThatRandom8543 (OP)
Sr. Member
****
Offline Offline

Activity: 1344
Merit: 307


View Profile
April 30, 2017, 06: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.

kolloh
Legendary
*
Offline Offline

Activity: 1736
Merit: 1023


View Profile
April 30, 2017, 11:31:18 PM
Last edit: May 01, 2017, 04:45:19 AM by kolloh
 #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.
ThatRandom8543 (OP)
Sr. Member
****
Offline Offline

Activity: 1344
Merit: 307


View Profile
May 01, 2017, 03:27:45 AM
 #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?
ThatRandom8543 (OP)
Sr. Member
****
Offline Offline

Activity: 1344
Merit: 307


View Profile
May 08, 2017, 04: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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!