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

Can we run this behind TOR? #77

Open
samsong opened this issue Apr 11, 2021 · 5 comments
Open

Can we run this behind TOR? #77

samsong opened this issue Apr 11, 2021 · 5 comments

Comments

@samsong
Copy link

samsong commented Apr 11, 2021

I have setup using docker & everything working.
How can I run this behind a TOR?

I have also setup EZNODE docker container which runs a TOR, BTC RPC Explorer
It would be nice to connect to the TOR created by that.

Any advice on this?

@laverdet
Copy link

You can edit bitcoin.conf in the /bitcoin/.bitcoin volume. You would add proxy=... and maybe listenonion=0 if you don't want to publish a hidden service.

@realSConway
Copy link

realSConway commented Aug 24, 2021

I want to route bitcoin only through tor, using peterdavehello/tor-socks-proxy container as tor proxy.

I first run tor container

podman run --detach \
--name tor-socks-proxy \
--publish 127.0.0.1:9150:9150/tcp \
peterdavehello/tor-socks-proxy:latest

Then run bitcoin with:

podman run --rm --detach --tty --interactive \
--name bitcoin \
--network container:tor-socks-proxy \
--env http_proxy=socks5://127.0.0.1:9150 \
--env HTTPS_PROXY=socks5h://127.0.0.1:9150 \
kylemanna/bitcoind:latest

In my bitcoin.conf, I use tor settings.

proxy=10.88.2.2:9150 #ip address of tor-socks-proxy
listen=1
bind=127.0.0.1
onlynet=onion

Should bind also be ip from tor-socks-proxy?

@realSConway
Copy link

realSConway commented Sep 18, 2021

I have it working!

tor container is running like:

podman run --detach \
--name tor-socks-proxy \
--publish 8333:8333 \
--publish 127.0.0.1:9150:9150/tcp \
 peterdavehello/tor-socks-proxy:latest

Then connect bitcoin-node with tor-socks-proxy network container

podman run --rm --interactive --tty  \
--name bitcoind-node \
--volume bitcoin-data:/home/bitcoin/.bitcoin \
--network container:tor-socks-proxy \
ruimarinho/bitcoin-core  

In bitcoin.conf set proxy to ipaddress:port of tor-socks-proxy

proxy=10.88.0.2:9150

@MarcelRobitaille
Copy link

Thanks @realSConway

For those who prefer docker-compose:

version: "3"

services:
  bitcoind:
    image: kylemanna/bitcoind:latest
    container_name: bitcoind
    restart: always
    volumes:
      - /media/bitcoin:/bitcoin/.bitcoin
    network_mode: service:tor
  tor:
    image: peterdavehello/tor-socks-proxy:latest
    container_name: tor-socks-proxy
    ports:
      - "8118:8118"
      - "127.0.0.1:8332:8332"
      - "127.0.0.1:9150:9150/tcp"

@dev7ba
Copy link

dev7ba commented Dec 14, 2022

Thanks @MarcelRobitaille and @realSConway but you can't publish a hidden service this way. I'll try to make a pullrequest by running tor within the same container.

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

5 participants