[doc][trivial] Remove source forge from Debian watch.
[bitcoinplatinum.git] / src / chainparamsbase.h
blob095c4cbdcbfa841305e657b657a90ac637276df4
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
8 #include <string>
9 #include <vector>
11 /**
12 * CBaseChainParams defines the base parameters (shared between bitcoin-cli and bitcoind)
13 * of a given instance of the Bitcoin system.
15 class CBaseChainParams
17 public:
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; }
26 protected:
27 CBaseChainParams() {}
29 int nRPCPort;
30 std::string strDataDir;
33 /**
34 * Append the help messages for the chainparams options to the
35 * parameter string.
37 void AppendParamsHelpMessages(std::string& strUsage, bool debugHelp=true);
39 /**
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);
48 /**
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();
54 /**
55 * Return true if SelectBaseParamsFromCommandLine() has been called to select
56 * a network.
58 bool AreBaseParamsConfigured();
60 #endif // BITCOIN_CHAINPARAMSBASE_H