Crate bitcoin_argsman

source ·

Modules

Structs

Enums

Constants

Functions

  • | Most paths passed as configuration | arguments are treated as relative to | the datadir if they are not absolute. | | ———– | @param path | | The path to be conditionally prefixed | with datadir. | ––––– | @param net_specific | | Use network specific datadir variant | | ———– | @return | | The normalized path. |
  • | Return the currently selected parameters. | This won’t change after app startup, | except for unit tests. |
  • | Return true if -datadir option points | to a valid directory or is not specified. |
  • | Check settings value validity according | to flags. | | TODO: Add more meaningful error checks | here in the future | | See “here’s how the flags are meant to | behave” in https://github.com/bitcoin/bitcoin/pull/16097#issuecomment-514627823 |
  • | Creates and returns | a std::unique_ptr of the | chosen chain. | | ———– | @return | | a CBaseChainParams* of the chosen chain. | @throws a std::runtime_error if the | chain is not supported. |
  • | Format a paragraph of text to a fixed | width, adding spaces for indentation | to any added line. |
  • | Format a string to be used as group of | options in help messages | | ———– | @param message | | Group name (e.g. “RPC server options:”) | | ———– | @return | | the formatted string |
  • | Format a string to be used as option description | in help messages | | ———– | @param option | | Option message (e.g. “-rpcuser=”) | ––––– | @param message | | Option description (e.g. “Username | for JSON-RPC connections”) | | ———– | @return | | the formatted string |
  • | Interpret a string argument as a boolean. | | The definition of LocaleIndependentAtoi() | requires that non-numeric string values | like “foo”, return 0. This means that | if a user unintentionally supplies | a non-integer argument here, the return | value is always false. This means that | | -foo=false does what the user probably | expects, but -foo=true is well defined | but does not do what they probably expected. | | The return value of LocaleIndependentAtoi(…) | is zero when given input not representable | as an int. | | For a more extensive discussion of this | topic (and a wide range of opinions on | the Right Way to change this code), see | PR12713. |
  • | Interpret -nofoo as if the user supplied | -foo=0. | | This method also tracks when the -no | form was supplied, and if so, checks | whether there was a double-negative | (-nofoo=0 -> -foo=1). | | If there was not a double negative, it | removes the “no” from the key and returns | false. | | If there was a double negative, it removes | “no” from the key, and returns true. | | If there was no “no”, it returns the string | value untouched. | | Where an option was negated can be later | checked using the | | IsArgNegated() method. One use case | for this is to have a way to disable options | that are not normally boolean (e.g. | using -nodebuglogfile to request that | debug log output is not sent to any file | at all). |
  • | Sets the params returned by Params() | to those for the given network. |