Optimal settings for airgap mode

10 replies 193 views
DarkSeedSenior Member
Posts: 209 · Reputation: 1423
#1Nov 20, 2024, 07:47 AM
Trying to fire up bitcoin-qt without any network action, what are the best options to throw in? I've added all the ones I could find (-connect=0 -listen=0 -dnsseed=0 -listenonion=0 -maxconnections=0 -upnp=0 -proxy=0). But when I start bitcoin-qt and check with getnetworkinfo in the console, it shows something else. Also, it shows that various types of connections for ipv4 and ipv6 are marked as true in reachable. How is that possible when I put all those command lines? I thought launching bitcoin-qt with those commands would override anything in bitcoin.conf, but I kept that file empty, so I'm stuck here. The network activity icon isn't greyed out when I open it and I can still click to "Disable network activity". How can I launch it without network activity at all? I really don’t want it trying to connect all the time if I'm not using the internet.
6 Reply Quote Share
coin_sigmaLegendary
Posts: 1275 · Reputation: 5553
#2Nov 21, 2024, 04:53 AM
For non-syncing from your config above, connect, listen, and maxconnection should be enough to make your core not sync online. But since this is an air gap, why not completely disable the wifi and disconnect it forever from the internet? You don't need to configure it unless you still want the device to be connected online. An air gap device should be completely disconnected from any network. If you are planning to connect it in the future, then. That's not an air gap device.
4 Reply Quote Share
ryan_nodeSenior Member
Posts: 204 · Reputation: 859
#3Nov 23, 2024, 10:32 AM
-networkactive=0, but -connect=0 should be sufficient to not have any p2p network activity.
1 Reply Quote Share
DarkSeedSenior Member
Posts: 209 · Reputation: 1423
#4Nov 23, 2024, 01:28 PM
Yes, everything is turned off, no wifi card or ethernet, I just want to disable the network activity so the node stops trying to download blocks. Yeah, this did it, now the icon shows it's not enabled and getnetworkinfo says false on "networkactive". What I was hopping is that it could stop trying to look for peers, but on the lower left it still says "Connecting to peers...". Does this stay in this permanent state of trying to ping for peers? I feel like there may be resources being wasted with the software trying to do something all the time, looking for an internet connection. Maybe there should be an -airgap mode or something, designed for people that use an airgap setup with 2 computers, like a way to automatically tell the software to stop anything under the radar that may be trying to still do something but it can't due lack of internet connection, such as for instance this message of "Connecting to peers..." that I assume it means it's trying to connect to peers. Maybe this airgap mode could actually refuse to start the software if it detects an internet connection, in case you do something stupid like accidentally connecting an ethernet cable into the wrong laptop, something dumb like that you may accidentally do, you never know, so that's just another layer of protection at the software level.
3 Reply Quote Share
ryan_nodeSenior Member
Posts: 204 · Reputation: 859
#5Nov 23, 2024, 05:31 PM
No, that's just the default text of the initial state. Since it never leaves that initial state, it does not change, but it's not actually attempting any connections. That's literally what -networkactive does.
5 Reply Quote Share
alt21Senior Member
Posts: 398 · Reputation: 1732
#6Nov 23, 2024, 11:26 PM
From your conversation, since I am also interested, can I assume that -networkactive=0 can be the only parameter that I need to set in order to get an airgapped Bitcoin Core instance? There are many parameteres suggested, or discussed, but I don't want to add redundant parameters in my config (if I am not 100% sure what they do).
4 Reply Quote Share
DarkSeedSenior Member
Posts: 209 · Reputation: 1423
#7Nov 24, 2024, 04:40 AM
Im guessing that one does it. I added the usual ones (connect=0, listen=0, maxconnections=0... etc) just for good measure but probably redundant.
2 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#8Nov 26, 2024, 02:28 PM
Not only unnecessary, some of those configs also have interactions with one another. Like if either -connect or -maxconnections are set to "0" like in his config, -listen and -dnsseed will also be set to "0". Test setting only -connect=0, then open your logs and look for "parameter interaction" to check which of those options are unnecessary. Another is: upnp=0 is not available in Core v29.0+ because it's dropped in that version; in Bitcoin Knots/Core, it's also unnecessary since it's already set to "0" by default. I thought you're "future-proofing" your bitcoin.conf file with all those disabled network-related config in case something change in the future.
1 Reply Quote Share
alt21Senior Member
Posts: 398 · Reputation: 1732
#9Nov 26, 2024, 07:47 PM
So reading @nc50lc's post I realize that some attributes have significant correlation, meaning that changing the one will also change the other. And I can't help but wonder, perhaps being too naive, but can't I simply run Core on an airgapped computer and have the default config, without even spending a second changing it?
1 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#10Nov 29, 2024, 03:51 AM
Yes, the default should be enough as long as the machine is actually setup Air-Gap because it wont be able to establish a connection to anything. I think takuma sato's main goal was in this reply where he's looking for a way to remove the "connecting to peers" message while Core is offline:
0 Reply Quote Share
alt21Senior Member
Posts: 398 · Reputation: 1732
#11Nov 29, 2024, 05:35 AM
Got it, I actually have a fully offline computer that I use to generate wallets (not that I generate many, but when I do I need it to be offline). This computer has never been connected to the internet and it has no WiFi adapter, nor Bluetooth adapter. I guess, without any software modification in Bitcoin Core, my goal to be completely offline is accomplished. As far as the "info" message for peer connections is concerned, yeah it can be annoying, but not anything that bothers me too much so that I need it gone desperately. In fact, many software wallets have this kind of info messages; Sparrow has a "connecting to server" message and I think Electrum has one as well. It's normal because they are primarily meant to be used online and connected with nodes.
3 Reply Quote Share

Related topics