Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

chainparamsbase.cpp File Reference
#include <chainparamsbase.h>
#include <tinyformat.h>
#include <util.h>
#include <assert.h>
#include <memory>
+ Include dependency graph for chainparamsbase.cpp:

Go to the source code of this file.

Classes

class  CBaseMainParams
 Main network. More...
 
class  CBaseTestNetParams
 Testnet (v3) More...
 
class  CBaseDevNetParams
 Devnet. More...
 
class  CBaseRegTestParams
 

Functions

void AppendParamsHelpMessages (std::string &strUsage, bool debugHelp)
 Append the help messages for the chainparams options to the parameter string. More...
 
const CBaseChainParamsBaseParams ()
 Return the currently selected parameters. More...
 
std::unique_ptr< CBaseChainParamsCreateBaseChainParams (const std::string &chain)
 Creates and returns a std::unique_ptr<CBaseChainParams> of the chosen chain. More...
 
void SelectBaseParams (const std::string &chain)
 Sets the params returned by Params() to those for the given network. More...
 

Variables

static std::unique_ptr< CBaseChainParamsglobalChainBaseParams
 

Function Documentation

◆ AppendParamsHelpMessages()

void AppendParamsHelpMessages ( std::string &  strUsage,
bool  debugHelp 
)

Append the help messages for the chainparams options to the parameter string.

Definition at line 19 of file chainparamsbase.cpp.

References _(), HelpMessageGroup(), and HelpMessageOpt().

Referenced by AppInitRawTx(), HelpMessage(), and HelpMessageCli().

◆ BaseParams()

const CBaseChainParams& BaseParams ( )

Return the currently selected parameters.

This won't change after app startup, except for unit tests.

Definition at line 83 of file chainparamsbase.cpp.

References globalChainBaseParams.

Referenced by CallRPC(), GetDataDir(), HelpExampleRpc(), and HTTPBindAddresses().

◆ CreateBaseChainParams()

std::unique_ptr<CBaseChainParams> CreateBaseChainParams ( const std::string &  chain)

Creates and returns a std::unique_ptr<CBaseChainParams> of the chosen chain.

Returns
a CBaseChainParams* of the chosen chain.
Exceptions
astd::runtime_error if the chain is not supported.

Definition at line 89 of file chainparamsbase.cpp.

References CBaseChainParams::DEVNET, gArgs, ArgsManager::GetDevNetName(), CBaseChainParams::MAIN, CBaseChainParams::REGTEST, strprintf, and CBaseChainParams::TESTNET.

Referenced by HelpMessage(), HelpMessageCli(), and SelectBaseParams().

◆ SelectBaseParams()

void SelectBaseParams ( const std::string &  chain)

Sets the params returned by Params() to those for the given network.

Definition at line 103 of file chainparamsbase.cpp.

References CreateBaseChainParams(), gArgs, globalChainBaseParams, and ArgsManager::SelectConfigNetwork().

Referenced by AppInitRPC(), and SelectParams().

Variable Documentation

◆ globalChainBaseParams

std::unique_ptr<CBaseChainParams> globalChainBaseParams
static

Definition at line 81 of file chainparamsbase.cpp.

Referenced by BaseParams(), and SelectBaseParams().

Released under the MIT license