pull down to refresh

Eventually I'd like to run it over VPN with normal networking, but I couldn't figure out how to get the port forwarding to work, so I left that for later.)
This is exactly what I did with my own Wireguard VPN for my btc node in the past. This guide might help you.
My question is: how long does it take to get to a decent peer count over Tor? When I started, I kept getting all kinds of error messages like this:
What is a "decent peer count" for you? And do you mean inbound or outbound connections? I used to accept incoming connections and track them. I believe I had on average 60 inbounds connections in total and I think most of them were IPv4. By default, outbound connections are limited to 8 iirc.
and yet this constant flow of "host unreachable" errors.
I think this is not a problem with your node.
This is exactly what I did with my own Wireguard VPN for my btc node in the past. This guide might help you.
Thank you! I've been banging my head against Wireguard, so this is perfect. I'll check the guide out, that would be amazing if it could help.
What is a "decent peer count" for you?
I figured like 50 peers or so, both inbound/outbound? When I was running ipv4 I could get as many as I'd allow, thus the confusion.
reply
Thank you! I've been banging my head against Wireguard, so this is perfect. I'll check the guide out, that would be amazing if it could help.
Depending on your experience with Wireguard and iptables, you might want to start from the first guide. It dives into the details of the networking involved because I struggled for a long time to fully understand how it works under the hood. This guide was essentially my attempt to explain it to myself once and for all, lol. It also includes pictures like this:
reply
I've read through the guides you linked, and I think they will be very good for building a more sophisticated understanding of iptables and wireguard. I read through the port forwarding guide in particular to figure out if I could do what I want to do, and it's not obvious to me, so I'll just ask you and maybe you'll know.
I have a paid plan with Proton VPN, and their VPN does port forwarding with some natpmp jiggering. But how it works is that Proton will pick a port number and assign it to you. Great, you can forward that! Except bitcoin nodes want port 8333, so I need to get peer nodes to know about whatever port that Proton assigned to me, and have them use that to communicate with me.
Do you know if there's a way to do this? It's not logically impossible (e.g., connect to standard peers, discover lists of peers from them, reach out to candidates saying "hey dude I'm using port 45678" and Bob's your uncle) but I don't know how the peer discovery protocol actually works, so once again I can't tell if I'm screwing something up and that's why I can't get it to work, or if it's literally impossible and cannot be made to work with an arbitrary port number.
reply
218 sats \ 2 replies \ @ek 1 Jan
but I don't know how the peer discovery protocol actually works
Afaik, peers are gossiped around using the addr message, see protocol documentation. This means they'll tell others nodes which nodes they are aware of.
Except bitcoin nodes want port 8333, so I need to get peer nodes to know about whatever port that Proton assigned to me, and have them use that to communicate with me.
I think you are looking for the config option -externalip=<ip>:<port>. It changes the advertised IP address and port. But it might be that nodes prefer connecting to port 8333, at least that I read about that a long time ago. Not sure if still the case.
So in theory, you should be able to set that to the IP address that you have when you're connected to the VPN and curl curl -4 ip.me and to the port Proton assigned to you.
If you use -externalip=<ip>:<port>, -listen=1 and your port forwarding works, you should get incoming connections at some point.
Btw, I created a post in the bitcointalk forum when I did what you're trying to do, maybe the config I posted there helps. But that I am using -discover=1 together with -externalip looks wrong to me now 🤔
edit: found the PR that changed the strong preference to connect to port 8333: https://github.com/bitcoin/bitcoin/pull/23542. so non-default ports should be okay now.
and here's a config generator that might be useful, too: https://jlopp.github.io/bitcoin-core-config-generator
reply
218 sats \ 1 reply \ @ek 1 Jan
So in theory, you should be able to set that to the IP address that you have when you're connected to the VPN and curl curl -4 ip.me and to the port Proton assigned to you.
Edit timer ran out before I could fix this sentence. Sentence in proper English:
So in theory, you should be able to set that to the IP address that you have when you're connected to the VPN (you can use curl -4 ip.me for that) and to the port Proton assigned to you.
and here:
you should get incoming connections at some point.
I meant specifically inbound IPv4 connections since I assume that's all we're talking about. You have no problems with inbound connections on Tor, right?

I just found in jlopp's config generator under networking that there is -natpmp. I have no experience with NAT-PMP but sounds like it could be useful for your case.
So maybe a network configuration like this could work (replace IP address with the one from Proton)?
# [network] # Accept incoming connections from peers. listen=1 # Specify your own public IP address. externalip=185.159.159.140 # Use NAT-PMP to map the listening port. natpmp=1
reply
These are so helpful, @ek, thank you! I'll let you know how it goes.
reply