spesmilo / electrumx

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

Can't connect electrum client to electrumx #228

Closed taspenwall closed 11 months ago

taspenwall commented 12 months ago

I can't connect to my electrumx server from electrum clients. I'm pretty sure its' on the server side. I've opened my ports in ufw and on my router. When I start electrumx it only lists rpc as services so I'm not sure if it's starting TCP and SSL. The server starts up just fine and will connect to peers when it's caught up. I can connect to the electrumx server using RPC but that's it. Here is the start up of electrumx

INFO:electrumx:ElectrumX server starting
Jul 14 11:15:39 raspi electrumx_server[892]: INFO:electrumx:logging level: INFO
Jul 14 11:15:39 raspi electrumx_server[892]: INFO:Controller:Python version: 3.11.4 (main, Jun  7 2023, 10:13:09) [GCC 12.2.0]
Jul 14 11:15:39 raspi electrumx_server[892]: INFO:Controller:software version: ElectrumX 1.16.0
Jul 14 11:15:39 raspi electrumx_server[892]: INFO:Controller:aiorpcX version: 0.22.1
Jul 14 11:15:39 raspi electrumx_server[892]: INFO:Controller:supported protocol versions: 1.4-1.4.3
Jul 14 11:15:39 raspi electrumx_server[892]: INFO:Controller:event loop policy: None
Jul 14 11:15:39 raspi electrumx_server[892]: INFO:Controller:reorg limit is 200 blocks
Jul 14 11:15:39 raspi electrumx_server[892]: INFO:Daemon:daemon #1 at localhost:8332/ (current)
Jul 14 11:15:39 raspi electrumx_server[892]: INFO:DB:switching current directory to /bitcoin/db
Jul 14 11:15:39 raspi electrumx_server[892]: INFO:DB:using leveldb for DB backend
Jul 14 11:15:40 raspi electrumx_server[892]: INFO:DB:opened UTXO DB (for sync: True)
Jul 14 11:15:40 raspi electrumx_server[892]: INFO:DB:UTXO DB version: 8
Jul 14 11:15:40 raspi electrumx_server[892]: INFO:DB:coin: BitcoinSegwit
Jul 14 11:15:40 raspi electrumx_server[892]: INFO:DB:network: mainnet
Jul 14 11:15:40 raspi electrumx_server[892]: INFO:DB:height: 798,678
Jul 14 11:15:40 raspi electrumx_server[892]: INFO:DB:tip: 00000000000000000001e6561ef35c9268bfdd400fdb1c385694bf29ee7b4f31
Jul 14 11:15:40 raspi electrumx_server[892]: INFO:DB:tx count: 864,635,840
Jul 14 11:15:40 raspi electrumx_server[892]: INFO:DB:flushing DB cache at 1,200 MB
Jul 14 11:15:41 raspi electrumx_server[892]: INFO:History:history DB version: 1
Jul 14 11:15:41 raspi electrumx_server[892]: INFO:History:flush count: 590
Jul 14 11:15:42 raspi electrumx_server[892]: INFO:SessionManager:RPC server listening on localhost:8000
Jul 14 11:15:43 raspi electrumx_server[892]: INFO:Prefetcher:catching up to daemon height 798,681 (3 blocks behind)

Here is my electrumx.conf

COIN=BitcoinSegwit
DB_DIRECTORY=/bitcoin/db
DAEMON_URL=http://xxxx:xxxxx@localhost:8332
NET=mainnet
SSL_CERTFILE=/etc/letsencrypt/live/linuxmonkeybox.com/cert.pem
SSL_KEYFILE=//etc/letsencrypt/live/linuxmonkeybox.com/privkey.pem
SERVICES = tcp://linuxmonkeybox.com:50001,rpc://localhost:8000,wss://linuxmonkeybox.com:50003,ssl://linuxmonkeybox.com:50002
PEER_DISCOVERY=on
MAX_SESSIONS=5
PEER_ANNOUNCE=

Here is my ufw status

To                         Action      From
--                         ------      ----
2221                       ALLOW       Anywhere                  
9091                       ALLOW       Anywhere                  
1194                       ALLOW       Anywhere                  
8332                       ALLOW       Anywhere                  
50001                      ALLOW       Anywhere                  
50002                      ALLOW       Anywhere                  
8000                       ALLOW       Anywhere                  
50003                      ALLOW       Anywhere                  
2221 (v6)                  ALLOW       Anywhere (v6)             
9091 (v6)                  ALLOW       Anywhere (v6)             
1194 (v6)                  ALLOW       Anywhere (v6)             
8332 (v6)                  ALLOW       Anywhere (v6)             
50001 (v6)                 ALLOW       Anywhere (v6)             
50002 (v6)                 ALLOW       Anywhere (v6)             
8000 (v6)                  ALLOW       Anywhere (v6)             
50003 (v6)                 ALLOW       Anywhere (v6)             

Nmap is showing the ports 50001, 50002, 50003 as closed. I've tried using my local IP (ie 192.168.0.x) as well as localhost in the electrumx.conf in the service var. I've tried connecting to the electrumx server both thru my local network and thru DNS. I don't get any errors starting up the electrumx server so I'm at a loss of what to try next.

taspenwall commented 12 months ago

Just an update I know the networking and ports are good as I put another service on port 50002 and I was able to connect to that service. So all my firewall and port forwarding is correct. I also built electrumx in a venv so could that be the problem? Debian won't let me install a Python app without a virtual environment.

SomberNight commented 11 months ago

Try listening on all interfaces (except for admin rpc). Something like this:

SERVICES=ssl://:50002,rpc://localhost:8000
REPORT_SERVICES=ssl://linuxmonkeybox.com:50002
taspenwall commented 11 months ago

Thank you so much, it's working now.