Bitcoin ABC  0.24.7
P2P Digital Currency
chainparamsbase.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2015 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 
19 public:
21  static const std::string MAIN;
22  static const std::string TESTNET;
23  static const std::string REGTEST;
24 
25  const std::string &DataDir() const { return strDataDir; }
26  uint16_t RPCPort() const { return m_rpc_port; }
27  uint16_t OnionServiceTargetPort() const {
29  }
30 
31  CBaseChainParams() = delete;
32  CBaseChainParams(const std::string &data_dir, uint16_t rpc_port,
33  uint16_t onion_service_target_port)
34  : m_rpc_port(rpc_port),
35  m_onion_service_target_port(onion_service_target_port),
36  strDataDir(data_dir) {}
37 
38 private:
39  const uint16_t m_rpc_port;
41  std::string strDataDir;
42 };
43 
49 std::unique_ptr<CBaseChainParams>
50 CreateBaseChainParams(const std::string &chain);
51 
56 
62 
64 void SelectBaseParams(const std::string &chain);
65 
66 #endif // BITCOIN_CHAINPARAMSBASE_H
CBaseChainParams::m_rpc_port
const uint16_t m_rpc_port
Definition: chainparamsbase.h:39
CBaseChainParams::TESTNET
static const std::string TESTNET
Definition: chainparamsbase.h:22
CBaseChainParams::CBaseChainParams
CBaseChainParams(const std::string &data_dir, uint16_t rpc_port, uint16_t onion_service_target_port)
Definition: chainparamsbase.h:32
CBaseChainParams::strDataDir
std::string strDataDir
Definition: chainparamsbase.h:41
CBaseChainParams
CBaseChainParams defines the base parameters (shared between bitcoin-cli and bitcoind) of a given ins...
Definition: chainparamsbase.h:18
CBaseChainParams::DataDir
const std::string & DataDir() const
Definition: chainparamsbase.h:25
SetupChainParamsBaseOptions
void SetupChainParamsBaseOptions(ArgsManager &argsman)
Set the arguments for chainparams.
Definition: chainparamsbase.cpp:17
CBaseChainParams::OnionServiceTargetPort
uint16_t OnionServiceTargetPort() const
Definition: chainparamsbase.h:27
CBaseChainParams::REGTEST
static const std::string REGTEST
Definition: chainparamsbase.h:23
SelectBaseParams
void SelectBaseParams(const std::string &chain)
Sets the params returned by Params() to those for the given network.
Definition: chainparamsbase.cpp:63
CBaseChainParams::RPCPort
uint16_t RPCPort() const
Definition: chainparamsbase.h:26
CBaseChainParams::MAIN
static const std::string MAIN
BIP70 chain name strings (main, test or regtest)
Definition: chainparamsbase.h:21
CBaseChainParams::m_onion_service_target_port
const uint16_t m_onion_service_target_port
Definition: chainparamsbase.h:40
BaseParams
const CBaseChainParams & BaseParams()
Return the currently selected parameters.
Definition: chainparamsbase.cpp:36
ArgsManager
Definition: system.h:152
CBaseChainParams::CBaseChainParams
CBaseChainParams()=delete
CreateBaseChainParams
std::unique_ptr< CBaseChainParams > CreateBaseChainParams(const std::string &chain)
Creates and returns a std::unique_ptr<CBaseChainParams> of the chosen chain.
Definition: chainparamsbase.cpp:46