Author

Topic: Why is the RPC explorer failing to connect to the Bitcoin Core in myNode ? (Read 90 times)

jr. member
Activity: 49
Merit: 20
Have you checked whether you can edit BTC RPC Explorer setting from myNode GUI app?
There doesn't seem to be any way for editing the .env file from any of myNode GUI pages.
At least, I couldn't find anything.
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
OK. Some weird things happened. First, if I edit .env with nano, the file will be edited properly. Then when restarting BTC_RPC_Explorer from myNode "Manage" page, the .env file will revert back to original. All changes will disappear.

--snip--

That's weird. I only tried myNode for a bit, but it's possible it's overridden by myNode. Have you checked whether you can edit BTC RPC Explorer setting from myNode GUI app?

Try adding the followings two in configuration file:
Code:
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
Which config file ?  Bitcoin or .env ?
Thanks

He refer to Bitcoin Core's config file.
jr. member
Activity: 49
Merit: 20
Try adding the followings two in configuration file:
Code:
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
Which config file ?  Bitcoin or .env ?
Thanks
jr. member
Activity: 49
Merit: 20
What's your current config in your Bitcoin.conf file? Did you set up RPC and enable it?
Based on the logs it seems it's a connection refused. Would you mind to replace this BTCEXP_HOST=0.0.0.0 with BTCEXP_HOST=127.0.0.1 and then replace localhost with the local IP of your node like 192.168.1.1 then use this command to restart the explorer.
Code:
sudo systemctl restart btc-rpc-explorer
If the error still persists try the other configuration posted below.
- https://bitcointalksearch.org/topic/m.61517989

OK. Some weird things happened. First, if I edit .env with nano, the file will be edited properly. Then when restarting BTC_RPC_Explorer from myNode "Manage" page, the .env file will revert back to original. All changes will disappear.
Second, your proposed line "sudo systemctl restart btc-rpc-explorer" will generate an error in Terminal:
Code:
Failed to restart btc-rpc-explorer.service: Unit btc-rpc-explorer.service not found.

Third, I've added the Bitcoin config file on my second post ( see #2 )

Fourth, I did enabled RPC but I didnt do anything about setting it up cause I do not have any knowledge about how to do so.

Thanks for your help. Very appreciated.

legendary
Activity: 1512
Merit: 7340
Farewell, Leo
The error says that BTC RPC explorer attempts to connect to localhost on IPv6. Is that surely supported? Try adding the followings two in configuration file:
Code:
rpcbind=127.0.0.1
rpcallowip=127.0.0.1

And replace "localhost" with "127.0.0.1" in the .env configuration as rightly said by BitMaxz. (That'll switch to IPv4)
legendary
Activity: 3374
Merit: 3095
Playbet.io - Crypto Casino and Sportsbook
What's your current config in your Bitcoin.conf file? Did you set up RPC and enable it?

Based on the logs it seems it's a connection refused. Would you mind to replace this BTCEXP_HOST=0.0.0.0 with BTCEXP_HOST=127.0.0.1 and then replace localhost with the local IP of your node like 192.168.1.1 then use this command to restart the explorer.

Code:
sudo systemctl restart btc-rpc-explorer

If the error still persists try the other configuration posted below.
- https://bitcointalksearch.org/topic/m.61517989
jr. member
Activity: 49
Merit: 20
Here is a partial log file from the BTC RPC EXPLORER STATUS file.
Not the whole file for these lines repeat about 50 times over, which IMO would be useless to completely post here.

Code:
Feb 29 09:18:36 mynode btcrpcexplorer[8611]: 2024-02-29T15:18:36.124Z btcexp:errorVerbose Stack: Error: connect ECONNREFUSED ::1:8332
Feb 29 09:18:36 mynode btcrpcexplorer[8611]: 2024-02-29T15:18:36.124Z btcexp:error Error 32ugegdfsde: Error: connect ECONNREFUSED ::1:8332, json: {"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"::1","port":8332,"userData":{"request":"getnetworkinfo"}}, userData: [object Object] (json: {})
Feb 29 09:18:36 mynode btcrpcexplorer[8611]:     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16)
Feb 29 09:18:36 mynode btcrpcexplorer[8611]: 2024-02-29T15:18:36.124Z btcexp:errorVerbose Stack: Error: connect ECONNREFUSED ::1:8332
Feb 29 09:18:36 mynode btcrpcexplorer[8611]: 2024-02-29T15:18:36.124Z btcexp:error Error RpcError-001: Error: connect ECONNREFUSED ::1:8332, json: {"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"::1","port":8332,"userData":{"request":"getnetworkinfo"}}, userData: [object Object] (json: {"request":"getnetworkinfo"})
Feb 29 09:18:36 mynode btcrpcexplorer[8611]: 2024-02-29T15:18:36.123Z btcexp:app Verifying RPC connection...
Feb 29 09:18:06 mynode btcrpcexplorer[8611]:     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16)
Feb 29 09:18:06 mynode btcrpcexplorer[8611]: 2024-02-29T15:18:06.122Z btcexp:errorVerbose Stack: Error: connect ECONNREFUSED ::1:8332
Feb 29 09:18:06 mynode btcrpcexplorer[8611]: 2024-02-29T15:18:06.122Z btcexp:error Error RpcError-001: Error: connect ECONNREFUSED ::1:8332, json: {"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"::1","port":8332,"userData":{"request":"getblockchaininfo"}}, userData: [object Object] (json: {"request":"getblockchaininfo"})
Feb 29 09:18:06 mynode btcrpcexplorer[8611]:     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16)
Feb 29 09:18:06 mynode btcrpcexplorer[8611]: 2024-02-29T15:18:06.122Z btcexp:errorVerbose Stack: Error: connect ECONNREFUSED ::1:8332
Feb 29 09:18:06 mynode btcrpcexplorer[8611]: 2024-02-29T15:18:06.122Z btcexp:error Error 32ugegdfsde: Error: connect ECONNREFUSED ::1:8332, json: {"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"::1","port":8332,"userData":{"request":"getnetworkinfo"}}, userData: [object Object] (json: {})
Feb 29 09:18:06 mynode btcrpcexplorer[8611]:     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16)
Feb 29 09:18:06 mynode btcrpcexplorer[8611]: 2024-02-29T15:18:06.122Z btcexp:errorVerbose Stack: Error: connect ECONNREFUSED ::1:8332
Feb 29 09:18:06 mynode btcrpcexplorer[8611]: 2024-02-29T15:18:06.121Z btcexp:error Error RpcError-001: Error: connect ECONNREFUSED ::1:8332, json: {"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"::1","port":8332,"userData":{"request":"getnetworkinfo"}}, userData: [object Object] (json: {"request":"getnetworkinfo"})
Feb 29 09:18:06 mynode btcrpcexplorer[8611]: 2024-02-29T15:18:06.120Z btcexp:app Verifying RPC connection...

Code:
# bitcoin configuration
# /home/bitcoin/.bitcoin/bitcoin.conf
# Bitcoin options
server=1
daemon=1
# Needed for BTC-RPC-Explorer
txindex=1
# CPU count
par=-1
# Debug log settings
shrinkdebugfile=1
# Connection settings
rpcauth=mynode:Some big and long string here
rpcport=8332
rpcbind=0.0.0.0
rpcallowip=127.0.0.1
rpcallowip=100.100.100.100/8
rpcallowip=172.166.60.60/12
rpcallowip=192.168.0.0/16
# Set default wallet so some wallet APIs work
main.wallet=wallet.dat
main.wallet=joinmarket_wallet.dat
test.wallet=wallet.dat
test.wallet=joinmarket_wallet.dat
# Enable Deprecated RPCs (if any)
deprecatedrpc=create_bdb
# Whitelist local connections (and docker)
whitelist=127.0.0.1
whitelist=172.16.0.0/12
# Dont limit data to electrum server or local network
[email protected]/8
[email protected]/16
# Enable Bloom filters (local network)
[email protected]/8
[email protected]/16
zmqpubrawblock=tcp://0.0.0.0:28332
zmqpubrawtx=tcp://0.0.0.0:28333
zmqpubhashblock=tcp://0.0.0.0:28334
# MyNode Optimizations
dbcache=3000
maxorphantx=10
maxmempool=500
maxconnections=40
maxuploadtarget=5000
rpcworkqueue=32
mempoolfullrbf=1
# IPv4 only
onlynet=ipv4
#listenonion=0 #???
bind=0.0.0.0# Tor config
proxy=127.0.0.1:9050
listen=1
onlynet=onion
jr. member
Activity: 49
Merit: 20
Newly installed myNode OS is running on a mini PC with 8GB RAM and 2T SSD.
The whole blockchain is now completely loaded in the SSD
Electrum Server and Bitcoin are running OK. The NTC RPC Explorer has the little green light.
From the myNode Home page, when clicking on the “Explorer” button, a new web page open and show this error:

Code:
No RPC Connection
This explorer currently is failing to connect to your Bitcoin Core node.
Check your connection details (host & port for Bitcoin Core), as well as your authentication details (username, password, etc).
All of these parameters need to be specified in a ".env" file or via commandline parameters.

Here is a copy of the NTC RPC Explorer .env file:
Location:  /opt/mynode/btc-rpc-explorer/.env
Code:
=======  START OF .env FILE ( stripped of all comments )===========

BTCEXP_COIN=BTC
BTCEXP_HOST=0.0.0.0
BTCEXP_PORT=3002

# BTCEXP_BITCOIND_URI=bitcoin://rpcusername:[email protected]:8332?timeout=10000

BTCEXP_BITCOIND_HOST=localhost
BTCEXP_BITCOIND_PORT=8332
BTCEXP_BITCOIND_USER=mynode
BTCEXP_BITCOIND_PASS=/// here some unique key hidden /////

# BTCEXP_BITCOIND_COOKIE=/path/to/bitcoind/.cookie

BTCEXP_BITCOIND_RPC_TIMEOUT=10000
BTCEXP_ADDRESS_API=electrumx
BTCEXP_ELECTRUMX_SERVERS=tcp://127.0.0.1:50001
BTCEXP_RPC_CONCURRENCY=4
BTCEXP_PRIVACY_MODE=true
BTCEXP_SSO_TOKEN_FILE=/opt/mynode/btc-rpc-explorer/token
BTCEXP_UI_THEME=light
BTCEXP_UI_SHOW_TOOLS_SUBHEADER=true

=======  END OF .env FILE ===========

I’m a newbie in the world of all things node and linux, so my knowledge is pretty limited.
Where do I start to get the NTC RPC Explorer functional ?
Thank you for any assistance.
Jump to: