Files
thehub/libs/utils/chainparamsbase.h
T

70 lines
2.0 KiB
C++
Raw Permalink Normal View History

2017-11-09 19:34:51 +01:00
/*
* This file is part of the Flowee project
* Copyright (C) 2014-2015 The Bitcoin Core developers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2018-01-16 10:47:52 +00:00
#ifndef FLOWEE_CHAINPARAMSBASE_H
#define FLOWEE_CHAINPARAMSBASE_H
#include <string>
2023-05-06 23:28:36 +02:00
#include <cstdint>
/**
* CBaseChainParams defines the base parameters (shared between bitcoin-cli and bitcoind)
* of a given instance of the Bitcoin system.
*/
class CBaseChainParams
{
public:
/** BIP70 chain name strings (main, test or regtest) */
static const std::string MAIN;
static const std::string TESTNET;
2020-09-26 14:30:05 -04:00
static const std::string TESTNET4;
2020-09-26 14:32:12 -04:00
static const std::string SCALENET;
2026-05-05 16:43:20 +02:00
static const std::string CHIPNET;
static const std::string REGTEST;
const std::string& DataDir() const { return strDataDir; }
int RPCPort() const { return nRPCPort; }
2019-12-12 17:48:48 +01:00
uint16_t ApiServerPort() const { return nApiServerPort; }
protected:
CBaseChainParams() {}
int nRPCPort;
2019-12-12 17:48:48 +01:00
uint16_t nApiServerPort;
std::string strDataDir;
};
/**
2015-04-28 14:48:28 +00:00
* Return the currently selected parameters. This won't change after app
* startup, except for unit tests.
*/
const CBaseChainParams& BaseParams();
CBaseChainParams& BaseParams(const std::string& chain);
/** Sets the params returned by Params() to those for the given network. */
void SelectBaseParams(const std::string& chain);
/**
* Return true if SelectBaseParamsFromCommandLine() has been called to select
* a network.
*/
bool AreBaseParamsConfigured();
2018-01-16 10:47:52 +00:00
#endif