Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local electrs while proxying bitcoind traffic through tor #100

Open
Oberfeldwedler opened this issue Sep 14, 2022 · 0 comments
Open

local electrs while proxying bitcoind traffic through tor #100

Oberfeldwedler opened this issue Sep 14, 2022 · 0 comments

Comments

@Oberfeldwedler
Copy link

Oberfeldwedler commented Sep 14, 2022

Great work! I especially appreciate the ability to change the UID/GID via build-arg.

I have setup a Bitcoin-Full-Node and an Electrum Rust Server, wich is working fine on clearnet.

When I setup a tor-proxy-container and specify proxy=torproxy:9050 in bitcoin.conf, electrs can no longer access ELECTRS_DAEMON_P2P_ADDR=bitcoind:8333 which makes sense, because this is supposed to be only accessible via the tor network.

Is there an obvious solution to my problem, where I can proxy bitcoind-traffic through tor and still access bitcoind:8333 locally?

Thanks!

docker-compose.yml:

services:
  bitcoind:
    volumes: *bitcoind
    build:
      context: ./build/kylemanna_docker-bitcoind
      args:
        USER_ID: ${UID}
        GROUP_ID: ${GID}
    depends_on:
      - torproxy
    restart: unless-stopped
    env_file:
      - .env
    ports:
      - ${BITCOIND_IP}:${BITCOIND_PORT2}:${BITCOIND_PORT2}
    expose:
      - ${BITCOIND_PORT1}
      # EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332

  torproxy:
    image: dperson/torproxy:latest
    environment:
      USERID: ${UID}
      GROUPID: ${GID}
      TZ: ${TZ}
      SERVICE: 9050;torproxy:9050
    restart: unless-stopped
    expose:
      - 9050

  electrs:
    build:
      context: ./build/electrs
      args:
        VERSION: ${ELECTRS_GIT_TAG}
        UID: ${UID}
        GID: ${GID}
    depends_on:
      - bitcoind
      - torproxy
    volumes: *electrs
    env_file:
      - .env
    restart: unless-stopped
    ports:
      - ${ELECTRS_IP}:${ELECTRS_PORT1}:${ELECTRS_PORT1}

bitcoin.conf:

# [rpc]
server=1
rpcbind=bitcoin-core
rpcbind=127.0.0.1
rpcallowip=172.0.0.0/8
rpcallowip=127.0.0.1
rpcport=8332
rpcauth=mempool:9b4130ca.....................9451e8f2192d0

# [core]
txindex=1

# [network]
proxy=torproxy:9050

# [wallet]
disablewallet=1

# [debug]
printtoconsole=1

EDIT:
electrs error message:

electrs_1   | Caused by:
electrs_1   |     0: bitcoin p2p failed to connect: 192.168.192.3:8333
electrs_1   |     1: Connection refused (os error 111)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant