Parses and stores command‐line and configuration file arguments.
Synopsis
Declared in <common/args.h>
class ArgsManager;
Types
Name |
Description |
A parsed command together with its arguments. |
Enums
Name |
Description |
Flags controlling how config and command line arguments are validated and interpreted. |
Member Functions
Name |
Description |
|
Construct an argument manager with no arguments registered. |
|
Destroy the argument manager. |
Add argument |
|
Add command |
|
Add many hidden arguments |
|
Check that any command‐specific options the user specified are valid for the given command. |
|
Check CLI command args |
|
Clear available arguments |
|
Clear cached directory paths |
|
Forces an arg setting. Called by SoftSetArg() if the arg hasn't already been set. Also called directly in testing. |
|
|
|
Return Flags for known arg. Return default flags for unknown arg. |
|
Return a vector of strings of the given argument |
|
Get blocks directory path |
|
|
|
Returns the appropriate chain type from the program arguments. |
|
Returns the appropriate chain type string from the program arguments. |
|
Get the command and command args (returns std::nullopt if no command provided) |
|
Return config file path (read‐only) |
|
Get data directory path |
|
Get data directory path with appended network identifier |
|
Get the help string |
|
|
|
Return path argument or default value |
|
Get current setting from config file or read/write settings file, ignoring nonpersistent command line or forced settings values. |
|
Get setting value. |
|
Get list of setting values. |
|
Get settings file path, or return false if read‐write settings were disabled with ‐nosettings. |
|
Log warnings for unrecognized section names in the config file. |
|
Log warnings for options in m_section_only_args when they are specified in the default section but not overridden on the command line or in a network‐specific section in the config file. |
|
Return true if the argument was originally passed as a negated option, i.e. ‐nofoo. |
|
Return true if the given argument has been manually set |
|
Access settings with lock held. |
|
Log the config file options and the command line arguments, useful for troubleshooting. |
|
Parse command‐line parameters into settings. |
|
Read and interpret the configuration files. |
|
Read settings file. Push errors to vector, or log them if null. |
|
Select the network in use |
|
Set the path used for the configuration file. |
|
Set default flags to return for an unknown arg. |
|
Set an argument if it doesn't already have a value |
|
Set a boolean argument if it doesn't already have a value |
|
Write settings file or backup settings file. Push errors to vector, or log them if null. |
Protected Member Functions
Name |
Description |
Read and interpret configuration settings from a stream. |
|
Read and interpret configuration settings from a string. |
Non-Member Functions
Name |
Description |
Most paths passed as configuration arguments are treated as relative to the datadir if they are not absolute. |
|
Initialize bitcoin core: Basic context setup. |
|
Initialization: parameter interaction. |
|
Overlay the options set in |
|
Path of the block policy fee estimator data file. |
|
Return true if ‐datadir option points to a valid directory or is not specified. |
|
Creates and returns a std::unique_ptr<CChainParams> of the chosen chain. |
|
Writes the peer address database (peers.dat) to disk. |
|
Get the argument manager from an opaque RPC context, asserting it is present. |
|
Get the argument manager from a node context, asserting it is present. |
|
Checks if a particular test option is present in ‐test command‐line arg options |
|
Return whether the user asked for help on the command line. |
|
Initialize the logging infrastructure |
|
Parameter interaction: change current parameters depending on various rules |
|
Move a legacy fee_estimates.dat file to the current block policy fee estimator path, if needed. |
|
Path of the mempool policy estimator data file. |
|
Set the arguments for chainparams |
|
Add help options to the args manager |
|
Register all arguments with the ArgsManager |
|
Read config files, and create datadir and settings.json if they don't exist. |
|
Registers the logging‐related command‐line options with the argument manager. |
|
Enables or disables the debug logging categories selected by the arguments. |
|
Sets the global logging severity level selected by the arguments. |
|
Applies the general logging options (log file, timestamps, thread names, and similar flags) parsed from the arguments to the global logger. |
|
Opens the debug log file and begins writing buffered log messages. |
|
Apply block‐storage options taken from the argument manager. |
|
Apply peer‐manager options taken from the argument manager. |
|
Apply chainstate‐manager options taken from the argument manager. |
|
Split the configured total database cache across the indexes and kernel caches. |
|
Log a warning when the configured database cache is larger than available RAM allows. |
|
Return the on‐disk path used to load and save the persisted mempool. |
|
Read coins‐view database options from the argument manager. |
|
Read database options from the argument manager. |
|
Read the mining options set in |
|
Apply notification‐related options from the argument manager. |
|
Determine whether the mempool should be persisted across restarts. |
|
Creates a new wallet database from a previously dumped file. |
|
Dumps the records of a wallet database to a human‐readable file. |
|
Fills database options from command‐line arguments. |
|
|
Runs a wallet‐tool command such as create, info, or dump. |
Created with MrDocs