Bitcoin Core 28.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
chainparamsbase.h
Go to the documentation of this file.
1// Copyright (c) 2014-2020 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 <util/chaintype.h>
9
10#include <cstdint>
11#include <memory>
12#include <string>
13
14class ArgsManager;
15
21{
22public:
23 const std::string& DataDir() const { return strDataDir; }
24 uint16_t RPCPort() const { return m_rpc_port; }
26
27 CBaseChainParams() = delete;
28 CBaseChainParams(const std::string& data_dir, uint16_t rpc_port, uint16_t onion_service_target_port)
29 : m_rpc_port(rpc_port), m_onion_service_target_port(onion_service_target_port), strDataDir(data_dir) {}
30
31private:
32 const uint16_t m_rpc_port;
34 std::string strDataDir;
35};
36
40std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const ChainType chain);
41
46
52
54void SelectBaseParams(const ChainType chain);
55
57#define LIST_CHAIN_NAMES "main, test, testnet4, signet, regtest"
58
59#endif // BITCOIN_CHAINPARAMSBASE_H
const CBaseChainParams & BaseParams()
Return the currently selected parameters.
std::unique_ptr< CBaseChainParams > CreateBaseChainParams(const ChainType chain)
Creates and returns a std::unique_ptr<CBaseChainParams> of the chosen chain.
void SetupChainParamsBaseOptions(ArgsManager &argsman)
Set the arguments for chainparams.
void SelectBaseParams(const ChainType chain)
Sets the params returned by Params() to those for the given chain.
ChainType
Definition chaintype.h:11
CBaseChainParams defines the base parameters (shared between bitcoin-cli and bitcoind) of a given ins...
CBaseChainParams(const std::string &data_dir, uint16_t rpc_port, uint16_t onion_service_target_port)
uint16_t RPCPort() const
CBaseChainParams()=delete
const uint16_t m_onion_service_target_port
const uint16_t m_rpc_port
uint16_t OnionServiceTargetPort() const
const std::string & DataDir() const
std::string strDataDir