PIVX Core  5.6.99
P2P Digital Currency
chainparamsbase.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2021 The Bitcoin developers
2 // Copyright (c) 2017-2021 The PIVX Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef PIVX_CHAINPARAMSBASE_H
7 #define PIVX_CHAINPARAMSBASE_H
8 
9 #include <memory>
10 #include <string>
11 #include <vector>
12 
18 {
19 public:
21 
22  static const std::string MAIN;
23  static const std::string TESTNET;
24  static const std::string REGTEST;
26 
27  const std::string& DataDir() const { return strDataDir; }
28  int RPCPort() const { return nRPCPort; }
29 
30  CBaseChainParams() = delete;
31  CBaseChainParams(const std::string& data_dir, int rpc_port) : nRPCPort(rpc_port), strDataDir(data_dir) {}
32 
33 private:
34  int nRPCPort;
35  std::string strDataDir;
36 };
37 
43 std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const std::string& chain);
44 
49 void AppendParamsHelpMessages(std::string& strUsage, bool debugHelp=true);
50 
56 
58 void SelectBaseParams(const std::string& chain);
59 
60 #endif // PIVX_CHAINPARAMSBASE_H
const CBaseChainParams & BaseParams()
Return the currently selected parameters.
void AppendParamsHelpMessages(std::string &strUsage, bool debugHelp=true)
Append the help messages for the chainparams options to the parameter string.
void SelectBaseParams(const std::string &chain)
Sets the params returned by Params() to those for the given network.
std::unique_ptr< CBaseChainParams > CreateBaseChainParams(const std::string &chain)
Creates and returns a std::unique_ptr<CBaseChainParams> of the chosen chain.
CBaseChainParams defines the base parameters (shared between pivx-cli and pivxd) of a given instance ...
CBaseChainParams()=delete
static const std::string REGTEST
const std::string & DataDir() const
int RPCPort() const
static const std::string TESTNET
CBaseChainParams(const std::string &data_dir, int rpc_port)
static const std::string MAIN
Chain name strings.
std::string strDataDir