spesmilo / electrumx

Alternative implementation of spesmilo/electrum-server
MIT License
429 stars 343 forks source link

electrumx_rpc returns unknown method for every command #263

Closed JohnTravolski closed 2 weeks ago

JohnTravolski commented 2 weeks ago

I'm trying to run any of the RPC commands using the provided electrumx_rpc Python script, but no matter what, I get an unknown method error:

$ electrumx_rpc -p 50001 getinfo
error making request: (-32601, 'unknown method "getinfo"')

This is electrumx 1.16.0 on Python 3.12.3 on Xubuntu 24.04.

The electrumx.conf file looks like this:

DB_DIRECTORY = /home/myname/Downloads/electrumx_db
DAEMON_URL = myname:mypass@localhost
SERVICES = tcp://0.0.0.0:50001
COIN = Bitcoin
PEER_DISCOVERY = off
COST_SOFT_LIMIT = 0
COST_HARD_LIMIT = 0

The electrumx.service file looks like this:

[Unit]
Description=Electrumx
After=network.target

[Service]
EnvironmentFile=/etc/electrumx.conf
ExecStart=/home/myname/Downloads/electrumx/electrumx_server
ExecStop=/usr/local/bin/electrumx_rpc -p 8000 stop
User=myname
LimitNOFILE=8192
TimeoutStopSec=30min

[Install]
WantedBy=multi-user.target

I'm able to get a wallet like Sparrow to connect to electrumx just fine. I just can't figure out how to do the RPC commands.

I'm sure I'm just missing something obvious but I can't figure it out. Would somebody please point me on the right track?

cipig commented 2 weeks ago

you need to connect to the RPC port, not the TCP port you should define a rpc port in the config, like SERVICES = tcp://:10070,rpc://:8070 and then connect to that

JohnTravolski commented 2 weeks ago

you need to connect to the RPC port, not the TCP port you should define a rpc port in the config, like SERVICES = tcp://:10070,rpc://:8070 and then connect to that

This solved it, I knew it was something easy. Thanks.