Bitcoin Forum
November 11, 2024, 03:38:51 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why is the RPC explorer failing to connect to the Bitcoin Core in myNode ?  (Read 90 times)
FredCailloux (OP)
Jr. Member
*
Offline Offline

Activity: 49
Merit: 20


View Profile
February 29, 2024, 03:12:53 PM
 #1

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:rpcpassword@127.0.0.1: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.
FredCailloux (OP)
Jr. Member
*
Offline Offline

Activity: 49
Merit: 20


View Profile
February 29, 2024, 03:36:56 PM
Last edit: March 01, 2024, 12:13:06 AM by FredCailloux
 #2

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
whitelist=download@100.100.100.100/8
whitelist=download@192.168.0.0/16
# Enable Bloom filters (local network)
whitelist=bloomfilter@100.100.100.100/8
whitelist=bloomfilter@192.168.0.0/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
BitMaxz
Legendary
*
Offline Offline

Activity: 3430
Merit: 3168


Playbet.io - Crypto Casino and Sportsbook


View Profile WWW
February 29, 2024, 04:30:58 PM
 #3

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://bitcointalk.org/index.php?topic=5367296.msg61517989#msg61517989

███████████████
█████████████████████
██████▄▄███████████████
██████▐████▄▄████████████
██████▐██▀▀▀██▄▄█████████
████████▌█████▀██▄▄██████
██████████████████▌█████
█████████████▀▄██▀▀██████
██████▐██▄▄█▌███████████
██████▐████▀█████████████
██████▀▀███████████████
█████████████████████
███████████████

.... ..Playbet.io..Casino & Sportsbook.....Grab up to  BTC + 800 Free Spins........
████████████████████████████████████████
██████████████████████████████████████████████
██████▄▄████████████████████████████████████████
██████▐████▄▄█████████████████████████████████████
██████▐██▀▀▀██▄▄██████████████████████████████████
████████▌█████▀██▄▄█████▄███▄███▄███▄█████████████
██████████████████▌████▀░░██▌██▄▄▄██████████████
█████████████▀▄██▀▀█████▄░░██▌██▄░░▄▄████▄███████
██████▐██▄▄█▌██████████▀███▀███▀███▀███▀█████████
██████▐████▀██████████████████████████████████████
██████▀▀████████████████████████████████████████
██████████████████████████████████████████████
████████████████████████████████████████
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1694
Merit: 8329


Fiatheist


View Profile WWW
February 29, 2024, 06:50:03 PM
 #4

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)

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
FredCailloux (OP)
Jr. Member
*
Offline Offline

Activity: 49
Merit: 20


View Profile
March 01, 2024, 12:26:40 AM
 #5

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://bitcointalk.org/index.php?topic=5367296.msg61517989#msg61517989

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.

FredCailloux (OP)
Jr. Member
*
Offline Offline

Activity: 49
Merit: 20


View Profile
March 01, 2024, 12:29:33 AM
 #6

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
ABCbits
Legendary
*
Offline Offline

Activity: 3052
Merit: 8074


Crypto Swap Exchange


View Profile
March 01, 2024, 10:15:01 AM
 #7

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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
FredCailloux (OP)
Jr. Member
*
Offline Offline

Activity: 49
Merit: 20


View Profile
March 01, 2024, 02:25:20 PM
 #8

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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!