1 // Copyright (c) 2014 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 #ifndef BITCOIN_CHAINPARAMSBASE_H
6 #define BITCOIN_CHAINPARAMSBASE_H
12 * CBaseChainParams defines the base parameters (shared between bitcoin-cli and bitcoind)
13 * of a given instance of the Bitcoin system.
15 class CBaseChainParams
18 /** BIP70 chain name strings (main, test or regtest) */
19 static const std::string MAIN
;
20 static const std::string TESTNET
;
21 static const std::string REGTEST
;
23 const std::string
& DataDir() const { return strDataDir
; }
24 int RPCPort() const { return nRPCPort
; }
30 std::string strDataDir
;
34 * Append the help messages for the chainparams options to the
37 void AppendParamsHelpMessages(std::string
& strUsage
, bool debugHelp
=true);
40 * Return the currently selected parameters. This won't change after app
41 * startup, except for unit tests.
43 const CBaseChainParams
& BaseParams();
45 /** Sets the params returned by Params() to those for the given network. */
46 void SelectBaseParams(const std::string
& chain
);
49 * Looks for -regtest, -testnet and returns the appropriate BIP70 chain name.
50 * @return CBaseChainParams::MAX_NETWORK_TYPES if an invalid combination is given. CBaseChainParams::MAIN by default.
52 std::string
ChainNameFromCommandLine();
55 * Return true if SelectBaseParamsFromCommandLine() has been called to select
58 bool AreBaseParamsConfigured();
60 #endif // BITCOIN_CHAINPARAMSBASE_H