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/>.
|
|
|
|
|
*/
|
2014-06-19 15:10:04 +02:00
|
|
|
|
2018-01-16 10:47:52 +00:00
|
|
|
#ifndef FLOWEE_CHAINPARAMSBASE_H
|
|
|
|
|
#define FLOWEE_CHAINPARAMSBASE_H
|
2014-06-19 15:10:04 +02:00
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* CBaseChainParams defines the base parameters (shared between bitcoin-cli and bitcoind)
|
|
|
|
|
* of a given instance of the Bitcoin system.
|
|
|
|
|
*/
|
|
|
|
|
class CBaseChainParams
|
|
|
|
|
{
|
|
|
|
|
public:
|
2015-06-30 21:39:49 +02:00
|
|
|
/** 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;
|
2016-10-27 16:12:47 +02:00
|
|
|
static const std::string FLEXTRANSTESTNET;
|
2015-06-30 21:39:49 +02:00
|
|
|
static const std::string REGTEST;
|
2014-06-19 15:10:04 +02:00
|
|
|
|
|
|
|
|
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; }
|
2014-09-19 19:21:46 +02:00
|
|
|
|
2014-06-19 15:10:04 +02:00
|
|
|
protected:
|
|
|
|
|
CBaseChainParams() {}
|
|
|
|
|
|
|
|
|
|
int nRPCPort;
|
2019-12-12 17:48:48 +01:00
|
|
|
uint16_t nApiServerPort;
|
2014-06-19 15:10:04 +02:00
|
|
|
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.
|
2014-06-19 15:10:04 +02:00
|
|
|
*/
|
2014-09-19 19:21:46 +02:00
|
|
|
const CBaseChainParams& BaseParams();
|
2014-06-19 15:10:04 +02:00
|
|
|
|
2015-06-27 19:21:41 +00:00
|
|
|
CBaseChainParams& BaseParams(const std::string& chain);
|
|
|
|
|
|
2014-06-19 15:10:04 +02:00
|
|
|
/** Sets the params returned by Params() to those for the given network. */
|
2015-06-30 21:39:49 +02:00
|
|
|
void SelectBaseParams(const std::string& chain);
|
2014-06-19 15:10:04 +02:00
|
|
|
|
2014-07-15 10:22:27 +02:00
|
|
|
/**
|
|
|
|
|
* Return true if SelectBaseParamsFromCommandLine() has been called to select
|
|
|
|
|
* a network.
|
|
|
|
|
*/
|
|
|
|
|
bool AreBaseParamsConfigured();
|
|
|
|
|
|
2018-01-16 10:47:52 +00:00
|
|
|
#endif
|