Title: Can't connect to my Electrum Server Post by: Picaflor on July 27, 2023, 05:58:23 PM Hello,
I can't connect to my electrs, not even from the machine it's running on. My HW/SW: Intel NUC, 1TB SDD, 8GB RAM Ubuntu 22.04 LTS Bitcoin Core 25.0.0 Electrs 0.10.0 I've tried connecting with both Electrum wallet and Sparrow, both directly and via SSL, and none of it worked. I set up SSL by following this video (https://www.youtube.com/watch?v=IbOxgdHsyRI). Electrum says nothing, the bullet just stays red. Sparrow says "Connecting to tcp://127.0.0.1:50001..." and won't connect. In electrs I have logging set to DEBUG and get these lines, respectively: Code: electrs::server] 6: recv {"jsonrpc":"2.0","method":"server.version","id":0,"params":["electrum/4.4.5","1.4"]} Code: electrs::server] 5: recv {"jsonrpc":"2.0","method":"server.version","params":["Sparrow","1.4"],"id":1} Logs from Electrum client: Code: 2.54 | I | n/network | connecting to 127.0.0.1:50002:s as new interface In Sparrow logs there is nothing. Any idea what's going on? Title: Re: Can't connect to my Electrum Server Post by: DireWolfM14 on July 27, 2023, 07:40:06 PM It won't accept connections unlit it's fully synchronized. With an SSD that shouldn't take more than a few hours, maybe 12 at the most. Have you tried connecting using the unsecured connection, i.e. port 50001?
Are you running it using systemd? If so, try this to see what it's doing, and if it's currently synchronized: Code: journalctl -u electrs.service This assumes the systemd file is named electrs.service. Modify the command if that's not the case. Title: Re: Can't connect to my Electrum Server Post by: Picaflor on July 27, 2023, 08:18:39 PM I believe it is fully synchronized, have been running it for a few days. I've tried connecting via port 50001 with no luck.
I'm not running it using systemd; I start it manually. It writes logs to the console, which presumably is the same I'd get with journalctl. After starting it the last few lines look like this: Code: [2023-07-27T20:09:22.850Z DEBUG electrs::p2p] got 4 new headers Title: Re: Can't connect to my Electrum Server Post by: DireWolfM14 on July 27, 2023, 09:26:53 PM The console logs look okay. Not sure about the compaction lines, it's been a while since I've looked at my logs but I'll check when I get home.
It's usually the simplest things... Do you have a firewall running, and if so, have you allowed incoming connections to ports 50001 and 50002? Title: Re: Can't connect to my Electrum Server Post by: Picaflor on July 28, 2023, 12:10:19 AM I do have a firewall running, it allows connections to port 50002, which I had set up for SSL access within the LAN.
Disabling the firewall doesn't help. But in any case I can't even connect to 127.0.0.1:50001 on the same PC, where the firewall is irrelevant. `sudo netstat -tunlp` returns the line: Code: tcp 0 0 127.0.0.1:50001 0.0.0.0:* LISTEN 45274/electrs Title: Re: Can't connect to my Electrum Server Post by: WillyAp on July 28, 2023, 12:28:22 AM I do have a firewall running, it allows connections to port 50002, which I had set up for SSL access within the LAN. Disabling the firewall doesn't help. But in any case I can't even connect to 127.0.0.1:50001 on the same PC, where the firewall is irrelevant. `sudo netstat -tunlp` returns the line: Code: tcp 0 0 127.0.0.1:50001 0.0.0.0:* LISTEN 45274/electrs Looks as if your wallet is listening on a different port. I don't know electrum though What falvor you are on, In case you don't know if the port is open. have you scanned it with nmap? sudo nmap -sT -p- 10.10.8.8 How to open a port: https://www.howtouselinux.com/post/linux-command-open-a-port-on-linux Title: Re: Can't connect to my Electrum Server Post by: BitMaxz on July 28, 2023, 02:03:09 AM How are you sure that your Bitcoin core is fully sync? What command did you use to start Bitcoind?
Take note electrs won't work if your Bitcoin core is set to pruned mode you need to run Bitcoind this command below to disable prune while syncing. Code: $ bitcoind -server=1 -txindex=0 -prune=0 Can you share your electrs config.toml, let us check if you are using the default config. Would you mind to try this first to force Electrum to connect on TPC using this command below. Code: electrum --oneserver --server 127.0.0.1:50001:t Update here after. Title: Re: Can't connect to my Electrum Server Post by: Picaflor on July 28, 2023, 10:23:15 AM Thanks guys, finally it connected! And I didn't change anything.
I've also successfully connected from another PC on the same LAN to my electrs via SSL. It wasn't about the ports, and Bitcoin Core was indeed fully synced. I think the issue was electrs still compacting the DB. When electrs indexed, the DB took 60 GB of space, then it started compacting and the DB kept shrinking. Last night it was 44 GB and I still couldn't connect. Now it's 42 GB and I can connect. The `starting txid compaction` message in electrs logs was the telltale sign, but it could have been clearer as there was no indication of progress and it took longer than expected to complete. My Bitcoin Core synced in under 72 hours, I was expecting electrs to be done within hours, and that most of it would be the indexing and not the compacting. Title: Re: Can't connect to my Electrum Server Post by: WillyAp on July 28, 2023, 03:17:38 PM Thanks guys, finally it connected! And I didn't change anything. I've also successfully connected from another PC on the same LAN to my electrs via SSL. That's great news. Information or the lack of it is, unfortunately so, often the case in newer tech. |