]> Git Repo - VerusCoin.git/blame - src/chainparamsbase.h
test
[VerusCoin.git] / src / chainparamsbase.h
CommitLineData
f914f1a7 1// Copyright (c) 2014 The Bitcoin Core developers
f2e03ffa 2// Distributed under the MIT software license, see the accompanying
84ce18ca
WL
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
84738627
PJ
5#ifndef BITCOIN_CHAINPARAMSBASE_H
6#define BITCOIN_CHAINPARAMSBASE_H
84ce18ca 7
84ce18ca 8#include <string>
611116d4 9#include <vector>
84ce18ca
WL
10
11/**
12 * CBaseChainParams defines the base parameters (shared between bitcoin-cli and bitcoind)
13 * of a given instance of the Bitcoin system.
14 */
15class CBaseChainParams
16{
17public:
18 enum Network {
19 MAIN,
20 TESTNET,
21 REGTEST,
22
23 MAX_NETWORK_TYPES
24 };
25
26 const std::string& DataDir() const { return strDataDir; }
27 int RPCPort() const { return nRPCPort; }
20e01b1a 28
84ce18ca
WL
29protected:
30 CBaseChainParams() {}
31
9a4127e7 32 int nRPCPort = 0;
84ce18ca 33 std::string strDataDir;
84ce18ca
WL
34};
35
36/**
7e6d23b1
CD
37 * Return the currently selected parameters. This won't change after app
38 * startup, except for unit tests.
84ce18ca 39 */
20e01b1a 40const CBaseChainParams& BaseParams();
84ce18ca
WL
41
42/** Sets the params returned by Params() to those for the given network. */
43void SelectBaseParams(CBaseChainParams::Network network);
44
45/**
b796cb08 46 * Looks for -regtest or -testnet and returns the appropriate Network ID.
47 * Returns MAX_NETWORK_TYPES if an invalid combination is given.
48 */
49CBaseChainParams::Network NetworkIdFromCommandLine();
50
51/**
52 * Calls NetworkIdFromCommandLine() and then calls SelectParams as appropriate.
84ce18ca
WL
53 * Returns false if an invalid combination is given.
54 */
55bool SelectBaseParamsFromCommandLine();
56
96ff9d64
WL
57/**
58 * Return true if SelectBaseParamsFromCommandLine() has been called to select
59 * a network.
60 */
61bool AreBaseParamsConfigured();
62
84738627 63#endif // BITCOIN_CHAINPARAMSBASE_H
This page took 0.120195 seconds and 4 git commands to generate.