Bitcoin ABC 0.30.5
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
32 CBaseChainParams() = delete;
33 CBaseChainParams(const std::string &data_dir, uint16_t rpc_port,
34 uint16_t onion_service_target_port, uint16_t chronik_port)
35 : m_rpc_port(rpc_port),
36 m_onion_service_target_port(onion_service_target_port),
37 m_chronik_port(chronik_port), strDataDir(data_dir) {}
38
39private:
40 const uint16_t m_rpc_port;
42 const uint16_t m_chronik_port;
43 std::string strDataDir;
44};
45
51std::unique_ptr<CBaseChainParams>
52CreateBaseChainParams(const std::string &chain);
53
58
64
66void SelectBaseParams(const std::string &chain);
67
68#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_onion_service_target_port
static const std::string REGTEST
const uint16_t m_rpc_port
uint16_t OnionServiceTargetPort() const
const std::string & DataDir() const
static const std::string TESTNET
uint16_t ChronikPort() const
CBaseChainParams(const std::string &data_dir, uint16_t rpc_port, uint16_t onion_service_target_port, uint16_t chronik_port)
const uint16_t m_chronik_port
static const std::string MAIN
BIP70 chain name strings (main, test or regtest)
std::string strDataDir