Bitcoin Core  0.18.99
P2P Digital Currency
chainparamsbase.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2018 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.
4 
5 #ifndef BITCOIN_CHAINPARAMSBASE_H
6 #define BITCOIN_CHAINPARAMSBASE_H
7 
8 #include <memory>
9 #include <string>
10 
16 {
17 public:
19  static const std::string MAIN;
20  static const std::string TESTNET;
21  static const std::string REGTEST;
22 
23  const std::string& DataDir() const { return strDataDir; }
24  int RPCPort() const { return nRPCPort; }
25 
26  CBaseChainParams() = delete;
27  CBaseChainParams(const std::string& data_dir, int rpc_port) : nRPCPort(rpc_port), strDataDir(data_dir) {}
28 
29 private:
30  int nRPCPort;
31  std::string strDataDir;
32 };
33 
39 std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const std::string& chain);
40 
45 
51 
53 void SelectBaseParams(const std::string& chain);
54 
55 #endif // BITCOIN_CHAINPARAMSBASE_H
void SelectBaseParams(const std::string &chain)
Sets the params returned by Params() to those for the given network.
static const std::string REGTEST
std::string strDataDir
std::unique_ptr< CBaseChainParams > CreateBaseChainParams(const std::string &chain)
Creates and returns a std::unique_ptr<CBaseChainParams> of the chosen chain.
CBaseChainParams(const std::string &data_dir, int rpc_port)
CBaseChainParams()=delete
const std::string & DataDir() const
static const std::string MAIN
BIP70 chain name strings (main, test or regtest)
const CBaseChainParams & BaseParams()
Return the currently selected parameters.
int RPCPort() const
CBaseChainParams defines the base parameters (shared between bitcoin-cli and bitcoind) of a given ins...
void SetupChainParamsBaseOptions()
Set the arguments for chainparams.
static const std::string TESTNET