btcpayserver-docker
btcpayserver-docker copied to clipboard
Exposing the bitcoind p2p and rpc ports to the host machine
Hi,
I've been running a btcpayserver using docker for a while now. I want to run an electrs server along side it, the electrs server needs to connect to the p2p and rpc ports of the bitcoin node running as part of the btcpayserver, how can I expose these ports to the host machine so the electrs server can connect to them?
Thanks,
The process should be similar to running EPS with BTCPay Server. RPC port is already exposed, see this for P2P. If you need anything beyond that, you can edit the setup with customized fragments.
Does this help?
Thanks @dennisreimann. EPS is running as another docker compose service, correct? But is the RPC port exposed to the host? I want to run electrs directly on the host machine, The default rpc port is 43782 correct? when I try to connect to it from the host using: telnet localhost 43782
I get a connection refused error.
Do you know why this maybe?
It isn't exposed to the host, only internally to other BTCPay Server Docker containers. You can enable that via custom fragment though:
services:
bitcoind:
ports:
- "43782:43782"
Great! Thanks @dennisreimann. Just wanted to confirm that it is ok to run . ./btcpay-setup.sh -i
in an already running installation?
Yes it is required to update the running installation.
Great! Thanks @dennisreimann!
Thanks @dennisreimann that worked! Now I'm having another issue, electrs has to read the /.bitcoin/blocks data, but currently only the lxd user has read permissions, is there a way to configure btcpayserver so that the block data includes read permissions for all users?
I couldn't find a way to do so via docker-compose and further customizing the fragment. Maybe the better option would be to integrate electrs as a proper BTCPay fragment itself and connect the containers — not sure if that's an option for you though.