Bitcoin Forum
September 27, 2025, 07:28:29 PM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / Re: Bitcoin + Electrum server + Block explorer under Windows (with WSL and Debian) on: January 28, 2025, 05:33:20 PM
Code:
Error: electrs failed

Caused by:
    0: bitcoind RPC polling failed
    1: daemon not available
    2: JSON-RPC error: transport error: Couldn't connect to host: Connection refused (os error 111)
hcp@HCP-PC:~/electrs$

Really not sure what is causing the issue... any one else come across this? Huh

I can easily reproduce this when bitcoin core is running, but it's not synced.
So I'd start with getting full sync.

If that's not the cause, maybe take a look at rpcbind or rpcallowip in bitcoin.conf...


I had same problem. I am using Debian under WSL2 (but I'd guess Ubuntu would work as well).  
The issue is WSL2 is different from WSL1 because WSL2 uses a VM that is not perfectly bidirectional in its implementation of ip ports:
  https://learn.microsoft.com/en-us/windows/wsl/networking


To understand this better, on the Windows side use:  
Code:
 resmon 
  and  
Code:
 ss -l 
 on the Debian side to monitor port status.


To fix,
1) in Debian run:
Code:
ip route show | grep -i default | awk '{ print $3}'

this returns the ip to use w/in Debian to refer to the Windows host (which is NOT 127.0.0.1) eg.:
Code:
172.27.176.1

then, change electrs.toml to:
Code:
#cookie_file = "/mnt/x/BitcoinDataDir/.mycookie"
auth="rt1:rt1"
daemon_dir = "/mnt/x/BitcoinDataDir"

  # ip route show | grep -i default | awk '{ print $3}'
daemon_rpc_addr = "172.27.176.1:8332"
daemon_p2p_addr = "172.27.176.1:8333"


#daemon_p2p_addr = "127.0.0.1:18444"
db_dir = "/mnt/y/ElectrsData"
network = "bitcoin"
electrum_rpc_addr = "127.0.0.1:50001"
#verbose = 2 -> obsolete, was working with version 0.9.0, no longer works in 0.9.3
#use log-filters for version 0.9.3+


# OFF TRACE DEBUG INFO WARN ERROR
log_filters = "TRACE"
server_banner = "Electrs @ NeuroticFish, -jd"


and in bitcoin.conf:
Code:
rpcallowip=0.0.0.0/0
rpcbind=0.0.0.0


The above allows me to run my Bitcoin in Windows and my Electrs in WSL2 Debian. It accounts for the lopsided ip ports directionality between Win11 & WSL2.

Further troubleshooting tools:
On wsl2 side try both the windows .exe bitcoin
Code:
/mnt/c/BTCwin/daemon/bitcoin-cli.exe -rpcuser=rt1 -rpcpassword=rt1 -rpcport=8332 getblockchaininfo
...AND the Debian binary bitcoin:
Code:
/mnt/d/bitcoin-27.0/bin/bitcoin-cli -rpcuser=rt1 -rpcpassword=rt1 -rpcconnect=172.27.176.1  -rpcport=8332 getblockchaininfo
2  Bitcoin / Bitcoin Technical Support / Re: bitcoin regtest wallet for android device... on: January 22, 2025, 11:51:24 PM
Did you ever figure this out?
I too am looking for an Android wallet that will connect to my REGTEST node.
3  Bitcoin / Development & Technical Discussion / Regtest for Students? on: January 22, 2025, 04:27:51 PM
I seek a wallet that doesn't download the entire BTC blockchain (Blockstream Green for example?) & connect to my local Regtest server.
I teach an introductory hands-on class using Testnet3 BTC. Students bring their smart phones & we send each other testnet BTC (=tBTC). But I run out of tBTC because of transaction fees.

If I can teach it using Regtest I could simply generate my own Regtest BTC & never worry about supply again.
How to do this, esp. architecturally? Do I need to install some kind of Electrum or Electrum Personal Server? or?
(I considered modifying the Blockstream Green git code but I'm not sure that's the best way & have had a lot of trouble getting it to build/link.)
Also I'm having trouble finding an Android/Iphone wallet that works w/ Regtest...?

Has anyone ever done this? Any advice welcome please.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!