.onion address doesn't work when bitcoin is trying to call TOR from another host #19618

issue nolim1t opened this issue on July 29, 2020
  1. nolim1t commented at 11:15 AM on July 29, 2020: none

    When trying to use the tor control port from another host (and using password authentication), the .onion address thats returned in localaddresses does not work.

    Expected behavior

    Any addresses in localaddresses should be reachable

    Actual behavior

    Address not reachable.

    To reproduce

    Create the following docker-compose file (bare bones so we can reproduce the issue)

    version: '3.7'
    services:
            tor:
                    container_name: tor
                    image: getumbrel/tor:v0.4.1.9
                    restart: unless-stopped
                    logging: *default-logging
                    volumes:
                        - ${PWD}/tor/torrc:/etc/tor/torrc
                        - ${PWD}/tor/data:/var/lib/tor/
                        - ${PWD}/tor/run:/var/run/tor/
                    networks:
                        net:
                            ipv4_address: 10.11.5.1
            bitcoin:
                    container_name: bitcoin
                    image: lncm/bitcoind:v0.20.0
                    logging: *default-logging
                    depends_on: [ tor ]
                    command: "-zmqpubrawblock=tcp://0.0.0.0:28332 -zmqpubrawtx=tcp://0.0.0.0:28333"
                    volumes:
                            - ${PWD}/bitcoin:/root/.bitcoin
                            - ${PWD}/bitcoin:/data/.bitcoin
                            - ${PWD}/bitcoin:/data/bitcoin
                    restart: unless-stopped
                    stop_grace_period: 15m30s
                    ports:
                        - "127.0.0.1:8333:8333"
                    networks:
                        net:
                            ipv4_address: 10.11.1.1
    

    create a folder called tor with directory structure of data and run and the following torrc file

    SocksPort   10.11.5.1:29050
    ControlPort 10.11.5.1:29051
    

    run the following

    docker run --rm getumbrel/tor:v0.4.1.9 --quiet --hash-password this-is-a-test-password
    

    then add the password to HashedControlPassword in torrc

    create a directory called bitcoin from the docker-compose.yml root

    Add the following in bitcoin.conf (this is similar to mine)

    # Have TOR commented for initial sync
    onion=10.11.5.1:29050
    torcontrol=10.11.5.1:29051
    torpassword=this-is-a-test-password
    
    server=1
    rest=1
    
    port=8333
    rpcport=8332
    rpcbind=10.11.1.1
    rpcbind=127.0.0.1
    rpcallowip=10.11.0.0/16
    rpcallowip=127.0.0.1
    
    txindex=1
    blockfilterindex=1
    peerbloomfilters=0
    

    System information

    Docker built images by github on https://github.com/lncm/docker-bitcoind (Thanks @meeDamian 😍) and docker compose with networking set up to segregate different services

    Workarounds

    Don't use torcontrol and use externalip= which has a working address in localaddresses

    General Notes

  2. nolim1t added the label Bug on Jul 29, 2020
  3. fanquake added the label P2P on Jul 29, 2020
  4. kristapsk commented at 11:24 AM on July 29, 2020: contributor

    I think it's the same problem as #16693, fixed in #19043, which needs more reviews / testing.

  5. nolim1t commented at 11:35 AM on July 29, 2020: none

    That looks like the fix

  6. adamjonas commented at 10:50 PM on January 4, 2021: member

    I believe this is closed by #19991.

  7. fanquake closed this on Jan 5, 2021

  8. DrahtBot locked this on Aug 16, 2022
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-28 06:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me