Support "standalone" mode (-a or --standalone) in which we do not connect

to the network and do not close ledgers. This mode makes it much easier to
test transactions as they are only applied once to the open ledger.
This commit is contained in:
JoelKatz
2012-08-14 15:35:30 -07:00
parent 4b2ae556bd
commit e473ce8424
8 changed files with 39 additions and 6 deletions

View File

@@ -84,6 +84,7 @@ int main(int argc, char* argv[])
int iResult = 0;
po::variables_map vm; // Map of options.
bool bTest = false;
theConfig.init();
//
// Set up option parsing.
@@ -93,6 +94,7 @@ int main(int argc, char* argv[])
("help,h", "Display this message.")
("conf", po::value<std::string>(), "Specify the configuration file.")
("rpc", "Perform rpc command (default).")
("standalone,a", "Run with no peers.")
("test,t", "Perform unit tests.")
("parameters", po::value< vector<string> >(), "Specify comma separated parameters.")
("verbose,v", "Increase log level")
@@ -142,6 +144,11 @@ int main(int argc, char* argv[])
Log::setMinSeverity(lsTRACE);
}
if (vm.count("standalone"))
{
theConfig.RUN_STANDALONE = true;
}
if (!iResult)
{
theConfig.setup(vm.count("conf") ? vm["conf"].as<std::string>() : "");