Docs: More precise explanation of parameter onlynet #13418

pull ghost wants to merge 1 commits into bitcoin:master from changing 1 files +1 −1
  1. ghost commented at 9:06 PM on June 7, 2018: none

    See issue #13378

  2. practicalswift commented at 9:41 PM on June 7, 2018: contributor

    Concept ACK

  3. ken2812221 commented at 10:15 PM on June 7, 2018: contributor

    utACK 7b5c0e0

  4. fanquake added the label Docs on Jun 7, 2018
  5. in src/init.cpp:408 in 7b5c0e02ea outdated
     404 | @@ -405,7 +405,7 @@ void SetupServerArgs()
     405 |      gArgs.AddArg("-maxtimeadjustment", strprintf("Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)", DEFAULT_MAX_TIME_ADJUSTMENT), false, OptionsCategory::CONNECTION);
     406 |      gArgs.AddArg("-maxuploadtarget=<n>", strprintf("Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)", DEFAULT_MAX_UPLOAD_TARGET), false, OptionsCategory::CONNECTION);
     407 |      gArgs.AddArg("-onion=<ip:port>", "Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)", false, OptionsCategory::CONNECTION);
     408 | -    gArgs.AddArg("-onlynet=<net>", "Only connect to nodes in network <net> (ipv4, ipv6 or onion)", false, OptionsCategory::CONNECTION);
     409 | +    gArgs.AddArg("-onlynet=<net>", "Actively connect to remote nodes exclusively in network <net> (ipv4, ipv6 or onion). Passive, incoming connections are not affected by this parameter.", false, OptionsCategory::CONNECTION);
    


    rodasmith commented at 1:43 AM on June 8, 2018:

    It may be helpful if the text includes "... only... net..." to match the arg name onlynet. So how about this tweak?

    Actively connect to remote nodes <del>exclusively in</del><ins>only through</ins> network....


    unknown commented at 4:34 AM on June 8, 2018:

    I think You could have a point here. How about "only in network..." like it was before?

    Actively connect to remote nodes exclusivelyonly in network....

    Allthough "exclusively" sounds more precise to me. Maybe English native speaker(I am not) could comment.


    rodasmith commented at 5:34 AM on June 17, 2018:

    To me (a native English speaker), "connect... only through" is quite natural and unambiguously describes the network route, as opposed to the unintended alternative interpretation that "exclusively in" conveys where the user may expect the remote node to be isolated in a single network.


    unknown commented at 7:17 AM on June 17, 2018:

    Thanks for Your explanation. I will try to clone my github fork repo to local computer to rebase and squash the current and (Your suggested) followup commit, as described in CONTRIBUTING.md

  6. unknown renamed this:
    More precise explanation of parameter onlynet
    Docs: More precise explanation of parameter onlynet
    on Jun 17, 2018
  7. ghost commented at 8:30 AM on June 17, 2018: none

    Commited change suggested by rodasmith, rebased and squashed.

  8. MarcoFalke commented at 5:13 PM on June 18, 2018: member

    ACK 7de76d0336da8b7c01f7e3ec771c4b7ceec531d9

  9. practicalswift commented at 5:30 PM on June 18, 2018: contributor

    utACK 7de76d0336da8b7c01f7e3ec771c4b7ceec531d9

  10. in src/init.cpp:408 in b7db3ed812 outdated
     404 | @@ -405,7 +405,7 @@ void SetupServerArgs()
     405 |      gArgs.AddArg("-maxtimeadjustment", strprintf("Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)", DEFAULT_MAX_TIME_ADJUSTMENT), false, OptionsCategory::CONNECTION);
     406 |      gArgs.AddArg("-maxuploadtarget=<n>", strprintf("Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)", DEFAULT_MAX_UPLOAD_TARGET), false, OptionsCategory::CONNECTION);
     407 |      gArgs.AddArg("-onion=<ip:port>", "Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: -proxy)", false, OptionsCategory::CONNECTION);
     408 | -    gArgs.AddArg("-onlynet=<net>", "Only connect to nodes in network <net> (ipv4, ipv6 or onion)", false, OptionsCategory::CONNECTION);
     409 | +    gArgs.AddArg("-onlynet=<net>", "Actively connect to remote nodes only through network <net> (ipv4, ipv6, onion or tor), where onion and tor are synonymous. Passive, incoming connections are not affected by this option. This option can be specified multiple times.", false, OptionsCategory::CONNECTION);
    


    laanwj commented at 4:29 PM on June 24, 2018:

    Please only mention onion here, tor is deprecated (and only supported for backwards compatbility).


    unknown commented at 4:54 PM on June 24, 2018:

    OK, removed mentioning of "tor" and created a seperate PR #13532 for documenting the deprecation

  11. ghost commented at 4:35 PM on June 24, 2018: none

    The option onlynet can be specified multiple times, as seen here in the code of init.cpp:

    if (gArgs.IsArgSet("-onlynet")) {
            std::set<enum Network> nets;
            for (const std::string& snet : gArgs.GetArgs("-onlynet")) {
                enum Network net = ParseNetwork(snet);
                if (net == NET_UNROUTABLE)
                    return InitError(strprintf(_("Unknown network specified in -onlynet: '%s'"), snet));
                nets.insert(net);
            }
            for (int n = 0; n < NET_MAX; n++) {
                enum Network net = (enum Network)n;
                if (!nets.count(net))
                    SetLimited(net);
            }
    }
    

    Tested that with the following in bitcoin.conf:

    onlynet=ipv4
    onlynet=ipv6
    

    With that options, the node connects outgoing via IPv4, which seemed it was not doing with a single onlynet=ipv6

  12. sipa commented at 8:40 PM on June 24, 2018: member

    The mention of active and passive here is redundant, and sounds confusing to me (it sounds like they're referring to an additional property of connections beyond incoming/outgoing, but I believe you just mean them to be synonyms with those).

  13. sipa commented at 5:21 PM on June 25, 2018: member

    Sounds good to me. Or even "Only make outgoing connections through the specified network(s) (ipv4, ipv6, or onion). Incoming connections are not affected by this option."

  14. ghost commented at 5:29 PM on June 25, 2018: none

    Only make outgoing connections through the specified network(s) (ipv4, ipv6, or onion).

    The "(s)" would not be precise, since one can specify only exactly one network with this option, but one can put this option multiple times (with different values) in the config file. That the network is specified, is obviously, IMHO. If it would not be specified, the option would not make sense. I think, the mention of <net> should not be dropped, as it refers to the syntax definition.

  15. ghost commented at 7:11 PM on June 26, 2018: none

    Adjusted the documentation text.

  16. practicalswift commented at 7:11 PM on June 26, 2018: contributor

    utACK ec318b3270be89214ad368140340d8ff5fa8b9f0 modulo squash into one commit

    The new text is much better!

  17. Docs: More precise explanation of parameter "onlynet" 2454a8558a
  18. ghost commented at 7:32 PM on June 26, 2018: none

    Typo fix (comma) and squashed.

  19. practicalswift commented at 7:36 PM on June 26, 2018: contributor

    ACK 2454a8558a85b3d06552fab0f7f11f69932ac055

  20. jb55 approved
  21. jb55 commented at 7:48 PM on June 26, 2018: member

    ACK 2454a8558a85b3d06552fab0f7f11f69932ac055

  22. practicalswift approved
  23. sipa commented at 11:38 PM on June 26, 2018: member

    utACK 2454a8558a85b3d06552fab0f7f11f69932ac055

  24. sipa deleted a comment on Jun 26, 2018
  25. promag commented at 11:50 PM on June 26, 2018: member

    utACK 2454a85.

  26. sipa merged this on Jun 27, 2018
  27. sipa closed this on Jun 27, 2018

  28. sipa referenced this in commit 01f909828d on Jun 27, 2018
  29. unknown deleted the branch on Jun 27, 2018
  30. laanwj referenced this in commit 7209fec190 on Jun 27, 2018
  31. PastaPastaPasta referenced this in commit 33787241d5 on Apr 16, 2020
  32. PastaPastaPasta referenced this in commit 89815fa2c8 on Apr 16, 2020
  33. PastaPastaPasta referenced this in commit bb02ff1774 on Apr 19, 2020
  34. PastaPastaPasta referenced this in commit 1b6227ad3d on Apr 20, 2020
  35. PastaPastaPasta referenced this in commit 45aef679d0 on May 10, 2020
  36. PastaPastaPasta referenced this in commit 674ad86c32 on May 12, 2020
  37. PastaPastaPasta referenced this in commit 0f7f679c14 on Jun 9, 2020
  38. PastaPastaPasta referenced this in commit d0c2101736 on Jun 9, 2020
  39. PastaPastaPasta referenced this in commit c018c32753 on Jun 10, 2020
  40. PastaPastaPasta referenced this in commit 889e0bf276 on Jun 11, 2020
  41. deadalnix referenced this in commit 85999eb1fe on Jun 22, 2020
  42. PastaPastaPasta referenced this in commit 65a0077ff0 on Jul 7, 2020
  43. PastaPastaPasta referenced this in commit 7d461a1a0d on Jul 7, 2020
  44. PastaPastaPasta referenced this in commit 12a0696ecd on Jul 8, 2020
  45. barton2526 referenced this in commit fb230cd813 on Jun 24, 2021
  46. jamescowens referenced this in commit 81f45e7330 on Jun 24, 2021
  47. gades referenced this in commit 6087f72d15 on Jun 25, 2021
  48. gades referenced this in commit 80613b5030 on Jan 29, 2022
  49. gades referenced this in commit 8151c6fc98 on Feb 10, 2022
  50. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me