I'm trying to run Bitcoin Core entirely over Tor. Everything with the outgoing connections is ok, but I don't get any incoming connections, even though I see
2019-11-01T10:26:18Z tor: ADD_ONION successful
2019-11-01T10:26:18Z tor: Got service ID 6yewk7gn3ifmvudz, advertising service 6yewk7gn3ifmvudz.onion:8333
in the logs. I also tried to check if the node is available with https://bitnodes.earn.com/. It doesn't work with the .onion address. Any ideas?
I also noticed a weird thing: I got one inbound connection from localhost... how is this possible? I don't run any other nodes. https://imgur.com/a/49gGNwE
Tor logs:
Nov 01 12:21:32.986 [notice] Opening Socks listener on 127.0.0.1:9050
Nov 01 12:21:32.986 [notice] Opened Socks listener on 127.0.0.1:9050
Nov 01 12:21:32.986 [notice] Opening Control listener on 127.0.0.1:9051
Nov 01 12:21:32.986 [notice] Opened Control listener on 127.0.0.1:9051
Nov 01 12:21:33.000 [notice] Bootstrapped 0% (starting): Starting
Nov 01 12:21:34.000 [notice] Starting with guard context "default"
Nov 01 12:21:35.000 [notice] Bootstrapped 5% (conn): Connecting to a relay
Nov 01 12:21:35.000 [notice] Bootstrapped 10% (conn_done): Connected to a relay
Nov 01 12:21:35.000 [notice] Bootstrapped 14% (handshake): Handshaking with a relay
Nov 01 12:21:35.000 [notice] Bootstrapped 15% (handshake_done): Handshake with a relay done
Nov 01 12:21:35.000 [notice] Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to build circuits
Nov 01 12:21:35.000 [notice] Bootstrapped 90% (ap_handshake_done): Handshake finished with a relay to build circuits
Nov 01 12:21:35.000 [notice] Bootstrapped 95% (circuit_create): Establishing a Tor circuit
Nov 01 12:21:35.000 [notice] Bootstrapped 100% (done): Done
Nov 01 12:21:44.000 [notice] Have tried resolving or connecting to address '[scrubbed]' at 3 different places. Giving up.
Nov 01 12:22:08.000 [notice] New control connection opened from 127.0.0.1.
Nov 01 12:23:02.000 [notice] Have tried resolving or connecting to address '[scrubbed]' at 3 different places. Giving up.
Nov 01 12:23:13.000 [notice] Have tried resolving or connecting to address '[scrubbed]' at 3 different places. Giving up.
Nov 01 12:23:59.000 [notice] New control connection opened from 127.0.0.1.
Nov 01 12:24:08.000 [notice] Have tried resolving or connecting to address '[scrubbed]' at 3 different places. Giving up.
Nov 01 12:24:28.000 [notice] Have tried resolving or connecting to address '[scrubbed]' at 3 different places. Giving up.
Nov 01 12:26:18.000 [notice] New control connection opened from 127.0.0.1.
Nov 01 12:26:32.000 [notice] Have tried resolving or connecting to address '[scrubbed]' at 3 different places. Giving up.
Nov 01 12:26:43.000 [notice] Have tried resolving or connecting to address '[scrubbed]' at 3 different places. Giving up.
Nov 01 12:29:15.000 [notice] Have tried resolving or connecting to address '[scrubbed]' at 3 different places. Giving up.
Nov 01 12:32:08.000 [notice] Have tried resolving or connecting to address '[scrubbed]' at 3 different places. Giving up.
Nov 01 12:32:11.000 [notice] Have tried resolving or connecting to address '[scrubbed]' at 3 different places. Giving up.
Nov 01 12:34:43.000 [notice] Have tried resolving or connecting to address '[scrubbed]' at 3 different places. Giving up.
Nov 01 12:34:54.000 [notice] Have tried resolving or connecting to address '[scrubbed]' at 3 different places. Giving up.
Nov 01 12:37:33.000 [notice] Have tried resolving or connecting to address '[scrubbed]' at 3 different places. Giving up.
Nov 01 12:37:43.000 [notice] Have tried resolving or connecting to address '[scrubbed]' at 3 different places. Giving up
update: Actually I think incoming connections will always say 127.0.0.1 since I specified bind=127.0.0.1 when in fact they are over tor. Am I correct?
Bitnodes is not 100% reliable.
Your hidden service is definitely up: I can connect to it without problems. There are no errors in the log you posted either.
I also noticed a weird thing: I got one inbound connection from localhost... how is this possible? I don't run any other nodes.
A Tor hidden service works as a reverse proxy (https://en.wikipedia.org/wiki/Reverse_proxy): other users connect to your Tor server, which forwards the connection to your Bitcoin node, which sees the connection as coming from the IP address of your Tor server (localhost if both Tor and Bitcoin are running on the same machine). This is exactly what you should expect to see if your hidden service is working normally. Over time, you should start to see many more such connections.
EDIT:
update: Actually I think incoming connections will always say 127.0.0.1 since I specified bind=127.0.0.1 when in fact they are over tor. Am I correct?
No, bind simply blocks all incoming connections from any other IP address (ie, clearnet connections). Even if you omit the bind option to accept clearnet connections, you will still see Tor connections coming from localhost.