Bitcoin Core  0.20.99
P2P Digital Currency
chainparamsbase.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2019 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 
11 class ArgsManager;
12 
18 {
19 public:
21 
22  static const std::string MAIN;
23  static const std::string TESTNET;
24  static const std::string SIGNET;
25  static const std::string REGTEST;
27 
28  const std::string& DataDir() const { return strDataDir; }
29  uint16_t RPCPort() const { return m_rpc_port; }
31 
32  CBaseChainParams() = delete;
33  CBaseChainParams(const std::string& data_dir, uint16_t rpc_port, uint16_t onion_service_target_port)
34  : m_rpc_port(rpc_port), m_onion_service_target_port(onion_service_target_port), strDataDir(data_dir) {}
35 
36 private:
37  const uint16_t m_rpc_port;
39  std::string strDataDir;
40 };
41 
47 std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const std::string& chain);
48 
53 
59 
61 void SelectBaseParams(const std::string& chain);
62 
63 #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.
const uint16_t m_rpc_port
uint16_t OnionServiceTargetPort() const
CBaseChainParams(const std::string &data_dir, uint16_t rpc_port, uint16_t onion_service_target_port)
CBaseChainParams()=delete
const std::string & DataDir() const
static const std::string MAIN
Chain name strings.
uint16_t RPCPort() const
const uint16_t m_onion_service_target_port
const CBaseChainParams & BaseParams()
Return the currently selected parameters.
CBaseChainParams defines the base parameters (shared between bitcoin-cli and bitcoind) of a given ins...
static const std::string TESTNET
static const std::string SIGNET
void SetupChainParamsBaseOptions(ArgsManager &argsman)
Set the arguments for chainparams.