Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
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; }
31
32 CBaseChainParams() = delete;
38
39private:
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
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85