1 // Copyright (c) 2014 The Bitcoin 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
27 const std::string& DataDir() const { return strDataDir; }
28 int RPCPort() const { return nRPCPort; }
34 std::string strDataDir;
39 * Return the currently selected parameters. This won't change after app startup
40 * outside of the unit tests.
42 const CBaseChainParams& BaseParams();
44 /** Sets the params returned by Params() to those for the given network. */
45 void SelectBaseParams(CBaseChainParams::Network network);
48 * Looks for -regtest or -testnet and returns the appropriate Network ID.
49 * Returns MAX_NETWORK_TYPES if an invalid combination is given.
51 CBaseChainParams::Network NetworkIdFromCommandLine();
54 * Calls NetworkIdFromCommandLine() and then calls SelectParams as appropriate.
55 * Returns false if an invalid combination is given.
57 bool SelectBaseParamsFromCommandLine();
60 * Return true if SelectBaseParamsFromCommandLine() has been called to select
63 bool AreBaseParamsConfigured();
65 #endif // BITCOIN_CHAINPARAMSBASE_H