67 lines
2.0 KiB
C++
67 lines
2.0 KiB
C++
/*
|
|
* 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/>.
|
|
*/
|
|
|
|
#ifndef FLOWEE_CHAINPARAMSBASE_H
|
|
#define FLOWEE_CHAINPARAMSBASE_H
|
|
|
|
#include <string>
|
|
|
|
/**
|
|
* 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;
|
|
static const std::string FLEXTRANSTESTNET;
|
|
static const std::string REGTEST;
|
|
|
|
const std::string& DataDir() const { return strDataDir; }
|
|
int RPCPort() const { return nRPCPort; }
|
|
uint16_t ApiServerPort() const { return nApiServerPort; }
|
|
|
|
protected:
|
|
CBaseChainParams() {}
|
|
|
|
int nRPCPort;
|
|
uint16_t nApiServerPort;
|
|
std::string strDataDir;
|
|
};
|
|
|
|
/**
|
|
* 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();
|
|
|
|
#endif
|