mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Elements: Start Alpha
This commit is contained in:
parent
28c3d990e6
commit
568827dce1
9 changed files with 87 additions and 100 deletions
|
|
@ -10,13 +10,13 @@
|
|||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
const std::string CBaseChainParams::MAIN = "main";
|
||||
const std::string CBaseChainParams::REGTEST = "regtest";
|
||||
const std::string CBaseChainParams::MAIN = CHAINPARAMS_OLD_MAIN;
|
||||
const std::string CBaseChainParams::REGTEST = CHAINPARAMS_REGTEST;
|
||||
|
||||
void AppendParamsHelpMessages(std::string& strUsage, bool debugHelp)
|
||||
{
|
||||
strUsage += HelpMessageGroup(_("Chain selection options:"));
|
||||
strUsage += HelpMessageOpt("-chain=<chain>", _("Use the chain <chain> (default: main). Allowed values: main, testnet, regtest"));
|
||||
strUsage += HelpMessageOpt("-chain=<chain>", strprintf(_("Use the chain <chain> (default: %s). Allowed values: main, testnet, regtest"), CHAINPARAMS_ELEMENTS));
|
||||
if (debugHelp) {
|
||||
strUsage += HelpMessageOpt("-regtest", "Enter regression test mode, which uses a special chain in which blocks can be solved instantly. "
|
||||
"This is intended for regression testing tools and app development.");
|
||||
|
|
@ -24,7 +24,7 @@ void AppendParamsHelpMessages(std::string& strUsage, bool debugHelp)
|
|||
}
|
||||
|
||||
/**
|
||||
* Main network
|
||||
* Old Main network
|
||||
*/
|
||||
class CBaseMainParams : public CBaseChainParams
|
||||
{
|
||||
|
|
@ -32,6 +32,20 @@ public:
|
|||
CBaseMainParams()
|
||||
{
|
||||
nRPCPort = 8332;
|
||||
strDataDir = CHAINPARAMS_OLD_MAIN;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Main network for elements
|
||||
*/
|
||||
class CBaseElementsParams : public CBaseChainParams
|
||||
{
|
||||
public:
|
||||
CBaseElementsParams()
|
||||
{
|
||||
nRPCPort = 4241;
|
||||
strDataDir = CHAINPARAMS_ELEMENTS;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -44,7 +58,7 @@ public:
|
|||
CBaseRegTestParams()
|
||||
{
|
||||
nRPCPort = 18332;
|
||||
strDataDir = "regtest";
|
||||
strDataDir = CHAINPARAMS_REGTEST;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -60,6 +74,8 @@ CBaseChainParams* CBaseChainParams::Factory(const std::string& chain)
|
|||
{
|
||||
if (chain == CBaseChainParams::MAIN)
|
||||
return new CBaseMainParams();
|
||||
else if (chain == CHAINPARAMS_ELEMENTS)
|
||||
return new CBaseElementsParams();
|
||||
else if (chain == CBaseChainParams::REGTEST)
|
||||
return new CBaseRegTestParams();
|
||||
else
|
||||
|
|
@ -74,10 +90,10 @@ void SelectBaseParams(const std::string& chain)
|
|||
std::string ChainNameFromCommandLine()
|
||||
{
|
||||
if (GetBoolArg("-testnet", false))
|
||||
throw std::runtime_error(strprintf("%s: Invalid option -testnet: elements/%s is a testchain too.", __func__, CBaseChainParams::MAIN));
|
||||
throw std::runtime_error(strprintf("%s: Invalid option -testnet: elements/%s is a testchain too.", __func__, CHAINPARAMS_ELEMENTS));
|
||||
if (GetBoolArg("-regtest", false))
|
||||
return CBaseChainParams::REGTEST;
|
||||
return GetArg("-chain", CBaseChainParams::MAIN);
|
||||
return GetArg("-chain", CHAINPARAMS_ELEMENTS);
|
||||
}
|
||||
|
||||
bool AreBaseParamsConfigured()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue