<p>Fetching getnetworkinfo should result in IPv4 and IPv6 flags set to false and Tor to <code>true</code>. This will ensure that I am operating my node privately. But this is not the case for me.</p>
<p>This is what I should get , but am not getting ( see below for more):</p>
<pre><code>&quot;name&quot;: &quot;ipv4&quot;,
&quot;limited&quot;: true,
&quot;reachable&quot;: false,

  &quot;name&quot;: &quot;ipv6&quot;,
&quot;limited&quot;: true,
&quot;reachable&quot;: false,
</code></pre>
<p>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.</p>
<p>Here's where I'm at (Ubuntu 20.04 LTS ; bitcoind ; no bitcoin-qt).</p>
<p>I use a static IP address from my ISP .</p>
<p>I use an external SATA drive mounted at   /mnt/bitcoin    to store Bitcoin full node data.</p>
<p>..........
desktop:~$    bitcoin-cli getnetworkinfo
--- &gt; Output extracts:</p>
<pre><code>    {
      &quot;name&quot;: &quot;ipv4&quot;,
      &quot;limited&quot;: false,
      &quot;reachable&quot;: true,
      &quot;proxy&quot;: &quot;127.0.0.1:9050&quot;,
      &quot;proxy_randomize_credentials&quot;: true
    },
    {
      &quot;name&quot;: &quot;ipv6&quot;,
      &quot;limited&quot;: false,
      &quot;reachable&quot;: true,
      &quot;proxy&quot;: &quot;127.0.0.1:9050&quot;,
      &quot;proxy_randomize_credentials&quot;: true
    },
    {
      &quot;name&quot;: &quot;onion&quot;,
      &quot;limited&quot;: false,
      &quot;reachable&quot;: true,
      &quot;proxy&quot;: &quot;127.0.0.1:9050&quot;,
      &quot;proxy_randomize_credentials&quot;: true
    },
</code></pre>
<p>..........This is what is in my   ~/.bitcoin/bitcoin.conf</p>
<pre><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 &quot;Bitcoin Alert&quot; 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
</code></pre>
<p>..........Running ubuntu and this is my   &quot;/etc/tor/torrc&quot;</p>
<pre><code>SOCKSPort 9050
Log notice stdout
ControlPort 9051
CookieAuthentication 1
CookieAuthFileGroupReadable 1
HiddenServiceDir /var/lib/tor/lnd/
HiddenServicePort 8080 127.0.0.1:8080
</code></pre>
<p>..........This is my    &quot;/usr/share/tor/tor-service-defaults-torrc&quot;</p>
<pre><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
</code></pre>
<p>..........These seem to look good to me.</p>
<p>desktop:~$    cat /mnt/bitcoin/debug.log
--- &gt; Output extracts:</p>
<pre><code>2021-12-02T15:01:11Z Bitcoin Core version v22.0.0 (release build)

2021-12-02T15:01:11Z InitParameterInteraction: parameter interaction: -proxy set -&gt; setting -upnp=0
2021-12-02T15:01:11Z InitParameterInteraction: parameter interaction: -proxy set -&gt; setting -natpmp=0
2021-12-02T15:01:11Z InitParameterInteraction: parameter interaction: -proxy set -&gt; 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)
</code></pre>
<p>..........
..........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</p>
<pre><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
</code></pre>
<p>..........The node seems fully synced</p>
<p>desktop:~$    bitcoin-cli getblockchaininfo</p>
<pre><code>{
  &quot;chain&quot;: &quot;main&quot;,
  &quot;blocks&quot;: 712330,
  &quot;headers&quot;: 712330,
  &quot;bestblockhash&quot;: &quot;XXXXXXXXXXX&quot;,
  &quot;difficulty&quot;: 22335659268936.39,
  &quot;mediantime&quot;: 1638500142,
  &quot;verificationprogress&quot;: 0.9999986191151918,
  &quot;initialblockdownload&quot;: false,
</code></pre>
<p>Thank you very much.</p>
<p>..........References consulted include , but not limited to:</p>
<p><a href="https://www.youtube.com/watch?v=n2IUYL7hCOI" rel="nofollow noreferrer">https://www.youtube.com/watch?v=n2IUYL7hCOI</a>
<a href="https://jlopp.github.io/bitcoin-core-config-generator/" rel="nofollow noreferrer">https://jlopp.github.io/bitcoin-core-config-generator/</a>
<a href="https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service</a>
<a href="https://stopanddecrypt.medium.com/running-bitcoin-lightning-nodes-over-the-tor-network-2021-edition-489180297d5" rel="nofollow noreferrer">https://stopanddecrypt.medium.com/running-bitcoin-lightning-nodes-over-the-tor-network-2021-edition-489180297d5</a></p>
<p>.......Solution:</p>
<p>I copied the contents in
~/.bitcoin/bitcoin.conf
to
/mnt/bitcoin/bitcoin.conf</p>
<p>Delete everything inside
~/.bitcoin/bitcoin.conf
except this line:</p>
<pre><code>datadir=/mnt/bitcoin
</code></pre>
<p>Then I ran this command and it is a success in getting IPv4 and IPv6 flags set to false:</p>
<pre><code>bitcoind -daemon -conf=/mnt/bitcoin/bitcoin.conf
</code></pre>

CC BY-SA 4.0
2021-12-03T16:21:39.180Z
Note that Tor is a centralised network, so not a good idea (your security is compromised) to be your *only* source of peers...
Luke Dashjr
<bitcoin-core>
Solved: Need help setting up Bitcoin Core full node over Tor (solely) and Tor hidden service. Tried a bunch
bobd
# Solved: Need help setting up Bitcoin Core full node over Tor (solely) and Tor hidden service. Tried a bunch

(Asked by: username_0 on 2021-12-03)

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.
This is what I should get , but am not getting ( see below for more):
"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 .
I use an external SATA drive mounted at   /mnt/bitcoin    to store Bitcoin full node data.
..........
desktop:~$    bitcoin-cli getnetworkinfo
--- > Output extracts:
    {
      "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
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"
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"
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 to look good to me.
desktop:~$    cat /mnt/bitcoin/debug.log
--- > Output extracts:
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
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
{
  "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
.......Solution:
I copied the contents in
~/.bitcoin/bitcoin.conf
to
/mnt/bitcoin/bitcoin.conf
Delete everything inside
~/.bitcoin/bitcoin.conf
except this line:
datadir=/mnt/bitcoin

Then I ran this command and it is a success in getting IPv4 and IPv6 flags set to false:
bitcoind -daemon -conf=/mnt/bitcoin/bitcoin.conf

**Tags:** bitcoin-core

> **Comments:**
> **username_1**: Note that Tor is a centralised network, so not a good idea (your security is compromised) to be your *only* source of peers...  

---

## 0 answers

