Bitcoin ABC 0.30.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
11class ArgsManager;
12
19public:
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 uint16_t ChronikPort() const { return m_chronik_port; }
31 uint16_t ChronikElectrumPort() const { return m_chronik_electrum_port; }
32
33 CBaseChainParams() = delete;
34 CBaseChainParams(const std::string &data_dir, uint16_t rpc_port,
35 uint16_t onion_service_target_port, uint16_t chronik_port,
36 uint16_t chronik_electrum_port)
37 : m_rpc_port(rpc_port),
38 m_onion_service_target_port(onion_service_target_port),
39 m_chronik_port(chronik_port),
40 m_chronik_electrum_port(chronik_electrum_port), strDataDir(data_dir) {
41 }
42
43private:
44 const uint16_t m_rpc_port;
46 const uint16_t m_chronik_port;
48 std::string strDataDir;
49};
50
56std::unique_ptr<CBaseChainParams>
57CreateBaseChainParams(const std::string &chain);
58
63
69
71void SelectBaseParams(const std::string &chain);
72
73#endif // BITCOIN_CHAINPARAMSBASE_H
std::unique_ptr< CBaseChainParams > CreateBaseChainParams(const std::string &chain)
Creates and returns a std::unique_ptr<CBaseChainParams> of the chosen chain.
const CBaseChainParams & BaseParams()
Return the currently selected parameters.
void SetupChainParamsBaseOptions(ArgsManager &argsman)
Set the arguments for chainparams.
void SelectBaseParams(const std::string &chain)
Sets the params returned by Params() to those for the given network.
CBaseChainParams defines the base parameters (shared between bitcoin-cli and bitcoind) of a given ins...
uint16_t RPCPort() const
CBaseChainParams()=delete
const uint16_t m_chronik_electrum_port
const uint16_t m_onion_service_target_port
static const std::string REGTEST
const uint16_t m_rpc_port
uint16_t OnionServiceTargetPort() const
const std::string & DataDir() const
uint16_t ChronikElectrumPort() const
static const std::string TESTNET
uint16_t ChronikPort() const
const uint16_t m_chronik_port
CBaseChainParams(const std::string &data_dir, uint16_t rpc_port, uint16_t onion_service_target_port, uint16_t chronik_port, uint16_t chronik_electrum_port)
static const std::string MAIN
BIP70 chain name strings (main, test or regtest)
std::string strDataDir