Post
Topic
Board Bitcoin Technical Support
Merits 12 from 5 users
Topic OP
Need help setting up Bitcoin Core full node over Tor hidden service only.
by
bobd
on 04/12/2021, 11:59:08 UTC
⭐ Merited by LoyceV (4) ,o_e_l_e_o (4) ,ETFbitcoin (2) ,dkbit98 (1) ,RickDeckard (1)
Hello helpful souls,

Fetching getnetworkinfo should result in IPv4 and IPv6 flags set to false and Tor to `true`. This will ensure that I am operating my node privately.
But this is not the case for me.

Problem:
Need to fix IPv4 and IPv6 flags to set to false.

This is what I should get , but am not getting ( see below for more):

Code:
    "name": "ipv4",
    "limited": true,
    "reachable": false,

      "name": "ipv6",
    "limited": true,
    "reachable": false,

I am trying to run a full node with Bitcoin Core over Tor (solely) in Ubuntu (no bitcoin-qt) but the steps I am following are from many sources and I feel like I have been missing steps in between, not to mention that my technical skills are fairly basic.

Here's where I'm at (Ubuntu 20.04 LTS ; bitcoind ; no bitcoin-qt).

I use a static IP address from my ISP . Behind CGNAT?

I use an external SATA drive mounted at      /mnt/bitcoin      to store Bitcoin full node data.


..........
desktop:~$      bitcoin-cli getnetworkinfo
 --- > Output extracts:
Code:
    {
      "name": "ipv4",
      "limited": false,
      "reachable": true,
      "proxy": "127.0.0.1:9050",
      "proxy_randomize_credentials": true
    },
    {
      "name": "ipv6",
      "limited": false,
      "reachable": true,
      "proxy": "127.0.0.1:9050",
      "proxy_randomize_credentials": true
    },
    {
      "name": "onion",
      "limited": false,
      "reachable": true,
      "proxy": "127.0.0.1:9050",
      "proxy_randomize_credentials": true
    },

..........This is what is in my      ~/.bitcoin/bitcoin.conf

Code:
assumevalid=0


zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333


debug=tor
onion=127.0.0.1:9050
listenonion=1
onlynet=onion
proxy=127.0.0.1:9050
bind=127.0.0.1
proxyrandomize=1


alertnotify=echo %s | mail -s "Bitcoin Alert" XXX@xxx.com

server=1
daemon=1
listen=1
rpcport=8332
rpcauth=.................XXXXXXXXXXX
datadir=/mnt/bitcoin
txindex=1
maxconnections=15
maxmempool=50
maxreceivebuffer=2500
maxsendbuffer=500
minrelaytxfee=0.0001

discover=0
torcontrol=127.0.0.1:9051

dbcache=100
maxorphantx=10
maxuploadtarget=5000



..........Running ubuntu and this is my      "/etc/tor/torrc"

Code:
SOCKSPort 9050
Log notice stdout
ControlPort 9051
CookieAuthentication 1
CookieAuthFileGroupReadable 1
HiddenServiceDir /var/lib/tor/lnd/
HiddenServicePort 8080 127.0.0.1:8080

..........This is my      "/usr/share/tor/tor-service-defaults-torrc"

Code:
DataDirectory /var/lib/tor
PidFile /run/tor/tor.pid
RunAsDaemon 1
User debian-tor

ControlSocket /run/tor/control GroupWritable RelaxDirModeCheck
ControlSocketsGroupWritable 1
SocksPort unix:/run/tor/socks WorldWritable
SocksPort 9050

CookieAuthentication 1
CookieAuthFileGroupReadable 1
CookieAuthFile /run/tor/control.authcookie

Log notice syslog



..........These seem OK to me.

desktop:~$      cat /mnt/bitcoin/debug.log
 --- > Output extracts:

Code:
2021-12-02T15:01:11Z Bitcoin Core version v22.0.0 (release build)

2021-12-02T15:01:11Z InitParameterInteraction: parameter interaction: -proxy set -> setting -upnp=0
2021-12-02T15:01:11Z InitParameterInteraction: parameter interaction: -proxy set -> setting -natpmp=0
2021-12-02T15:01:11Z InitParameterInteraction: parameter interaction: -proxy set -> setting -discover=0


2021-12-02T15:03:41Z loadblk thread start
2021-12-02T15:03:41Z torcontrol thread start
2021-12-02T15:03:41Z Bound to 127.0.0.1:8333
2021-12-02T15:03:41Z Bound to 127.0.0.1:8334
2021-12-02T15:03:41Z init message: Loading P2P addresses…
2021-12-02T15:03:41Z Leaving InitialBlockDownload (latching to false)
2021-12-02T15:03:41Z tor: Got service ID XXXXXXXXXXX, advertising service XXXXXXXXXXX.onion:8333
2021-12-02T15:03:41Z AddLocal(XXXXXXXXXXX.onion:8333,4)


..........
..........When I ran this , I get this. May be because my   debug.log   is at   /mnt/bitcoin/debug.log      (see above):
desktop:~$      tail -f ~/.bitcoin/debug.log
Code:
2021-11-14T21:35:25Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
2021-11-14T21:35:25Z Script verification uses 3 additional threads
2021-11-14T21:35:25Z scheduler thread start
2021-11-14T21:35:25Z Binding RPC on address ::1 port 8332 failed.
2021-11-14T21:35:25Z Binding RPC on address 127.0.0.1 port 8332 failed.
2021-11-14T21:35:25Z Unable to bind any endpoint for RPC server
2021-11-14T21:35:25Z Error: Unable to start HTTP server. See debug log for details.
2021-11-14T21:35:25Z Shutdown: In progress...
2021-11-14T21:35:25Z scheduler thread exit
2021-11-14T21:35:25Z Shutdown: done

..........The node seems fully synced

desktop:~$      bitcoin-cli getblockchaininfo
Code:
{
  "chain": "main",
  "blocks": 712330,
  "headers": 712330,
  "bestblockhash": "XXXXXXXXXXX",
  "difficulty": 22335659268936.39,
  "mediantime": 1638500142,
  "verificationprogress": 0.9999986191151918,
  "initialblockdownload": false,

Thank you very much.




..........References consulted include , but not limited to:
https://www.youtube.com/watch?v=n2IUYL7hCOI
https://jlopp.github.io/bitcoin-core-config-generator/
https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service
https://stopanddecrypt.medium.com/running-bitcoin-lightning-nodes-over-the-tor-network-2021-edition-489180297d5
https://www.linuxuprising.com/2018/10/how-to-install-and-use-tor-as-proxy-in.html
https://ubuntuhandbook.org/index.php/2021/01/install-tor-tor-browser-ubuntu-20-10-20-04/
https://8bitcoin.medium.com/how-to-run-a-bitcoin-full-node-over-tor-on-an-ubuntu-linux-virtual-machine-bdd7e9415a70
https://bitsquabi.medium.com/setting-up-a-tor-hidden-service-knowledge-base-322dca4ce4c0
https://ishaana-misra.medium.com/using-raspberry-pi-to-run-a-full-bitcoin-node-a30c6339b06e
https://gist.github.com/nvk/c9f4fdcaa40cf639d157ef2ac45e28a4
https://bitcoin.org/en/full-node#network-configuration
https://old.reddit.com/r/Bitcoin/comments/cndynu/help_setting_up_bitcoin_core_node_with_tor_hidden/
https://blog.lopp.net/tor-only-bitcoin-lightning-guide/