Electrs can't connect to bitcoind at startup

4 replies 254 views
gigahodlerFull Member
Posts: 35 · Reputation: 306
#1Jan 2, 2020, 08:21 PM
I'm running BTC Core v0.27 on Mac OS X and I'm hitting a wall with Electrs not being able to connect to the bitcoin node on the same machine. The firewall is disabled, and I've messed around with rpcbind and rpcallowip for localhost but still getting the same error. Here's the error I'm getting: electrs failed. The cause seems to be: 0: bitcoin p2p failed to connect: 127.0.0.1:8333 1: Connection refused (os error 61) This is what's in my btc.conf: [main] server=1 prune=0 txindex=1 timeout=6000 walletbroadcast=0 blockfilterindex=1 datadir=/Users/xxx/Library/ApplicationSupport/Bitcoin rpccookiefile=/Users/xxx/Library/ApplicationSupport/Bitcoin/.cookie And here's the command I used to run Electrs: ./target/release/electrs log-filters=DEBUG db-dir /Volumes/USB_3TB/db daemon-dir ~/Library/ApplicationSupport/Bitcoin network=bitcoin Starting electrs 0.10.5 on x86_64 macos with Config { network: Bitcoin, db_path: "/Volumes/USB_3TB/db/bitcoin", db_log_dir: None, daemon_dir: "/Users/xxx/Library/ApplicationSupport/Bitcoin", daemon_auth: CookieFile("/Users/xxx/Library/ApplicationSupport/Bitcoin/.cookie"), daemon_rpc_addr: 127.0.0.1:8332, daemon_p2p_addr: 127.0.0.1:8333, electrum_rpc_addr: 127.0.0.1:50001, monitoring_addr: 127.0.0.1:4224, wait_duration: 10s, jsonrpc_timeout: 15s, index_batch_size: 10, index_lookup_limit: None, reindex_last_blocks: 0, auto_reindex: true, ignore_mempool: false, sync_once: false, skip_block_download_wait: false, disable_electrum_rpc: false, server_banner: "Welcome to electrs 0.10.5 (Electrum Rust Server)!", signet_magic: f9beb4d9, args: [] } [2024-07-04T19:48:57.591Z DEBUG tiny_http] Server listening on 127.0.0.1:4224 [2024-07-04T19:48:57.591Z INFO electrs::metrics::metrics_impl
4 Reply Quote Share
colddiamondHero Member
Posts: 623 · Reputation: 2467
#2Jan 3, 2020, 02:03 AM
Post the logs with the code tags makes it easier to read. What does your bitcoin.conf file have in it? IIRC you will need to have RPCUSER and RPCPASSWORD and RPCallow = 0.0.0.0 -Dave
1 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#3Jan 3, 2020, 02:35 AM
Your "settings.json" has set listen=false setting which disables p2p inbound connections. That's set by the GUI in "Allow incoming connections" settings which should be ticked by default. If unchecked, your node will only be able to establish "outbound" connections (it can establish connections to others, but others wont be able to initiate connections to it) Electrs requires p2p connection so it's required to establish connection to your Bitcoin Core. Settings related to RPC isn't related since the ".cookie" file is correctly set and the error didn't indicate any RPC-related issue. It's in his logs, the lines with "Config file arg:" are options set in his 'bitcoin.conf' file.
0 Reply Quote Share
colddiamondHero Member
Posts: 623 · Reputation: 2467
#4Jan 3, 2020, 07:17 AM
I thought, and I could be 100% wrong here, that the config file arg are what is in the default file location NOT what is in the file that may or may not be loaded by the command line arguments when starting the daemon. It's been a while but for some reason I remember someone having a similar issue years and years ago. -Dave
0 Reply Quote Share
gigahodlerFull Member
Posts: 35 · Reputation: 306
#5Jan 3, 2020, 08:08 AM
Many thanks! incoming connections was in fact disabled.
3 Reply Quote Share
?Reply
Sign in to reply to this topic

Related topics