diff options
Diffstat (limited to 'src/main_gui.cpp')
| -rw-r--r-- | src/main_gui.cpp | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp index b036ac9..bef8503 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | // Bitflash entry point -- starts node threads then runs GUI (or headless). | 1 | // Bitflash entry point -- starts node threads then runs GUI (or headless). |
| 2 | 2 | ||
| 3 | #include "headers_core.h" | 3 | #include "headers_core.h" |
| 4 | #include "proxy.h" | ||
| 4 | #include "selftest.h" | 5 | #include "selftest.h" |
| 5 | #include "walletcmd.h" | 6 | #include "walletcmd.h" |
| 6 | #include <thread> // hardware_concurrency, to sanity-check /genproclimit | 7 | #include <thread> // hardware_concurrency, to sanity-check /genproclimit |
| @@ -110,7 +111,8 @@ static void PrintUsage() | |||
| 110 | printf(" /debug\n"); | 111 | printf(" /debug\n"); |
| 111 | printf(" /gen\n"); | 112 | printf(" /gen\n"); |
| 112 | printf(" /nogui or /daemon\n"); | 113 | printf(" /nogui or /daemon\n"); |
| 113 | printf(" /selftest=wallet-keypool, wallet-hd, wallet-format, wallet-crypto, or wallet-encrypt\n"); | 114 | printf(" /selftest=wallet-keypool, wallet-hd, wallet-format, wallet-crypto, wallet-encrypt,\n"); |
| 115 | printf(" net-message, consensus-limits, pool-stratum, parse-money, or socks5-proxy\n"); | ||
| 114 | printf("\n"); | 116 | printf("\n"); |
| 115 | printf("Mining mode:\n"); | 117 | printf("Mining mode:\n"); |
| 116 | printf(" /operator\n"); | 118 | printf(" /operator\n"); |
| @@ -135,6 +137,8 @@ static void PrintUsage() | |||
| 135 | printf("\n"); | 137 | printf("\n"); |
| 136 | printf("Network:\n"); | 138 | printf("Network:\n"); |
| 137 | printf(" /port=N (P2P listen port, default 8433)\n"); | 139 | printf(" /port=N (P2P listen port, default 8433)\n"); |
| 140 | printf(" /socks=HOST:PORT (SOCKS5 proxy for outbound Nostr and .btf relay dials)\n"); | ||
| 141 | printf(" /tor[=HOST:PORT] (Tor mode; default SOCKS5 proxy is 127.0.0.1:9050)\n"); | ||
| 138 | printf(" /btfseed=ADDRESS:ENCHEX (extra bootstrap peer, repeatable)\n"); | 142 | printf(" /btfseed=ADDRESS:ENCHEX (extra bootstrap peer, repeatable)\n"); |
| 139 | printf("\n"); | 143 | printf("\n"); |
| 140 | printf("Wallet:\n"); | 144 | printf("Wallet:\n"); |
| @@ -282,6 +286,36 @@ static void ParseStartupArguments(int argc, char* argv[]) | |||
| 282 | if (!announceRelay.empty()) | 286 | if (!announceRelay.empty()) |
| 283 | strBtfAnnounceRelay = announceRelay; | 287 | strBtfAnnounceRelay = announceRelay; |
| 284 | 288 | ||
| 289 | bool fTorMode = arg(argc, argv, "/tor") || arg(argc, argv, "-tor"); | ||
| 290 | if (fTorMode) | ||
| 291 | { | ||
| 292 | string socksProxy = argval2(argc, argv, "/socks", "-socks"); | ||
| 293 | if (!socksProxy.empty()) | ||
| 294 | fprintf(stderr, "Warning: /tor takes precedence over /socks=%s\n", | ||
| 295 | socksProxy.c_str()); | ||
| 296 | |||
| 297 | string torProxy = argval2(argc, argv, "/tor", "-tor"); | ||
| 298 | string err; | ||
| 299 | if (!BtfEnableTorProxy(torProxy, err)) | ||
| 300 | fprintf(stderr, "Ignoring /tor=%s: %s\n", torProxy.c_str(), err.c_str()); | ||
| 301 | else | ||
| 302 | fprintf(stderr, "Tor mode enabled through SOCKS5 proxy %s\n", | ||
| 303 | BtfSocks5ProxyName().c_str()); | ||
| 304 | } | ||
| 305 | else | ||
| 306 | { | ||
| 307 | string socksProxy = argval2(argc, argv, "/socks", "-socks"); | ||
| 308 | if (!socksProxy.empty()) | ||
| 309 | { | ||
| 310 | string err; | ||
| 311 | if (!BtfSetSocks5Proxy(socksProxy, err)) | ||
| 312 | fprintf(stderr, "Ignoring /socks=%s: %s\n", socksProxy.c_str(), err.c_str()); | ||
| 313 | else | ||
| 314 | fprintf(stderr, "SOCKS5 proxy enabled for outbound discovery/relay dials: %s\n", | ||
| 315 | BtfSocks5ProxyName().c_str()); | ||
| 316 | } | ||
| 317 | } | ||
| 318 | |||
| 285 | // /btfseed=ADDRESS:ENCHEX -- extra bootstrap peers, repeatable. Useful for | 319 | // /btfseed=ADDRESS:ENCHEX -- extra bootstrap peers, repeatable. Useful for |
| 286 | // testing the seed path and for private networks that ship no compiled list. | 320 | // testing the seed path and for private networks that ship no compiled list. |
| 287 | for (int i = 1; i < argc; i++) | 321 | for (int i = 1; i < argc; i++) |