Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Pocketchange on January 16, 2023, 12:55:31 AM



Title: Bitcoin Explorer No RPC Connection
Post by: Pocketchange on January 16, 2023, 12:55:31 AM
Hi everyone. Got myself into the weeds. I've been working on this for about 2 days  :-\

Was trying to get mempool running with a node and instead messed up the bitcoin explorer.

Im getting: 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. See the project homepage to review how to configure this explorer.

Thanks!


Title: Re: Bitcoin Explorer No RPC Connection
Post by: Edwardard on January 16, 2023, 01:16:45 AM
Check your connection details (host & port for Bitcoin Core) as well as your authentication details (username, password, etc).
Could you post your bitcoin.conf file configuration sample? Did you confirm that your localhost is not blocking the port?
Ensure that Bitcoin Core's RPC server is enabled (server=1).
All of these parameters need to be specified in a ".env" file or via commandline parameters.
Check for .env file sample here: https://github.com/janoside/btc-rpc-explorer/blob/master/.env-sample (https://github.com/janoside/btc-rpc-explorer/blob/master/.env-sample)


Title: Re: Bitcoin Explorer No RPC Connection
Post by: Pocketchange on January 16, 2023, 01:23:56 AM
Hi Ed

All I have is:

server=1
txindex=1

I don't know how to use the env. file except mine looks the same as the one linked.

I just tried reinstalling everything.


EDIT: SOMEHOW ITS WORKING
 ???


Title: Re: Bitcoin Explorer No RPC Connection
Post by: Edwardard on January 16, 2023, 01:36:17 AM
Hi Ed

All I have is:

server=1
txindex=1
Yeah, its okay.

EDIT: SOMEHOW ITS WORKING
 ???
Could be that you were not synchronized with the blockchain before? But anyway, glad to see that your issue is resolved.


Title: Re: Bitcoin Explorer No RPC Connection
Post by: Pocketchange on January 16, 2023, 01:41:29 AM
Hi Ed

All I have is:

server=1
txindex=1
Yeah, its okay.

EDIT: SOMEHOW ITS WORKING
 ???
Could be that you were not synchronized with the blockchain before? But anyway, glad to see that your issue is resolved.

THANKS ED!! I appreciate it!


Title: Re: Bitcoin Explorer No RPC Connection
Post by: 9juan1 on February 22, 2024, 07:11:38 PM
I'm having the same issue. I run myNode on a VM.

This is what the RPC Explorer logs show.

Feb 22 13:07:22 mynode btcrpcexplorer[12118]:     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16)
Feb 22 13:07:22 mynode btcrpcexplorer[12118]: 2024-02-22T19:07:22.866Z btcexp:errorVerbose Stack: Error: connect ECONNREFUSED ::1:8332
Feb 22 13:07:22 mynode btcrpcexplorer[12118]: 2024-02-22T19:07:22.866Z 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 22 13:07:22 mynode btcrpcexplorer[12118]:     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16)


This is the bitcoin config sample.


# 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


How do I fix this?


Title: Re: Bitcoin Explorer No RPC Connection
Post by: nc50lc on February 23, 2024, 06:17:42 AM
How do I fix this?
What about the rpc credentials on your "btc-rpc-explorer.env" or ".env" file?
Or have you set the configs via command line interface?

Since you didn't set the rpcuser and rpcpassword in bitcoin.conf, you must point the ".cookie" file to the correct directory.
It's auto-created in Bitcoin Core's bitcoin data directory, in the custom datadir if you're not using the default.


Title: Re: Bitcoin Explorer No RPC Connection
Post by: 9juan1 on February 26, 2024, 06:00:10 PM
Thanks for replying,

I tried setting the rpcuser and rpcpassword in bitcoin.conf but then the electrum server fails to start.

Since I'm running this node on a VM, I am not sure where to access the .env file.


Title: Re: Bitcoin Explorer No RPC Connection
Post by: nc50lc on February 27, 2024, 05:00:45 AM
I tried setting the rpcuser and rpcpassword in bitcoin.conf but then the electrum server fails to start.

Since I'm running this node on a VM, I am not sure where to access the .env file.
Since you're also running an Electrum server together with Bitcoin Explorer,
You should consider opening your own topic with information about any other programs that you're running or one setting that fixes another may break the other.

Using the .cookie file should also work but Bitcoin Explorer must know where to find it if it's not in the default directory.
If you can't find env file (you must have run the program "as-is"), you can also use a command line option to set it.
Refer to their configuration instructions in their GitHub Repo, here: github.com/janoside/btc-rpc-explorer?tab=readme-ov-file#configuration (http://github.com/janoside/btc-rpc-explorer?tab=readme-ov-file#configuration)


Title: Re: Bitcoin Explorer No RPC Connection
Post by: Cricktor on March 03, 2024, 11:03:31 AM
I tried setting the rpcuser and rpcpassword in bitcoin.conf but then the electrum server fails to start.

Since you run myNode you will very likely break things when you try to mess with rpcuser and rpcpassword in bitcoin.conf without other modules like the Electrum server knowing about it.

I'm not familiar with myNode, but it should have some central config files that define certain global settings for the modules that you can activate in myNode.

I wonder why the Bitcoin RPC Explorer module needs any manual tinkering in myNode. Shouldn't it run out of the box when enabled?


Since I'm running this node on a VM, I am not sure where to access the .env file.

You will have to try to find such details in the documentation of myNode. As I'm not familiar with myNode, I can't tell, sorry.

I run nodes with RaspiBlitz where it's fairly easy to tinker with config files for optional modules. With nodes that are setup based on RaspiBolt (doesn't need to run on a Raspi 4B or 5) you configure everything yourself (some Linux experience is of great help).

My other Umbrel node has every optional module in docker containers. I didn't tinker much with my Umbrel but as far as I see, most of the config files are exposed to the docker host file system where you can apply changes. Persistant changes are another beast, i.e. changes that should survive a module update or similar. The Umbrel UI doesn't provide many options for this and I guess this is their policy (eye candy is more important than configurability options).

Persistant changes in myNode could also be challenging if you don't understand how myNode is setup internally.