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
26 const std::string& DataDir() const { return strDataDir; }
27 int RPCPort() const { return nRPCPort; }
33 std::string strDataDir;
37 * Return the currently selected parameters. This won't change after app
38 * startup, except for unit tests.
40 const CBaseChainParams& BaseParams();
42 /** Sets the params returned by Params() to those for the given network. */
43 void SelectBaseParams(CBaseChainParams::Network network);
46 * Looks for -regtest or -testnet and returns the appropriate Network ID.
47 * Returns MAX_NETWORK_TYPES if an invalid combination is given.
49 CBaseChainParams::Network NetworkIdFromCommandLine();
52 * Calls NetworkIdFromCommandLine() and then calls SelectParams as appropriate.
53 * Returns false if an invalid combination is given.
55 bool SelectBaseParamsFromCommandLine();
58 * Return true if SelectBaseParamsFromCommandLine() has been called to select
61 bool AreBaseParamsConfigured();
63 #endif // BITCOIN_CHAINPARAMSBASE_H