本文整理汇总了C++中SecretKey::getBase58Public方法的典型用法代码示例。如果您正苦于以下问题:C++ SecretKey::getBase58Public方法的具体用法?C++ SecretKey::getBase58Public怎么用?C++ SecretKey::getBase58Public使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SecretKey
的用法示例。
在下文中一共展示了SecretKey::getBase58Public方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cfgFile
int
main(int argc, char* const* argv)
{
using namespace stellar;
sodium_init();
Logging::init();
std::string cfgFile("stellar-core.cfg");
std::string command;
el::Level logLevel = el::Level::Fatal;
std::vector<char*> rest;
bool newNetwork = false;
bool newDB = false;
std::vector<std::string> newHistories;
std::vector<std::string> metrics;
int opt;
while ((opt = getopt_long_only(argc, argv, "", stellar_core_options,
nullptr)) != -1)
{
switch (opt)
{
case OPT_TEST:
{
rest.push_back(*argv);
rest.insert(++rest.begin(), argv + optind, argv + argc);
return test(static_cast<int>(rest.size()), &rest[0], logLevel, metrics);
}
case OPT_CONF:
cfgFile = std::string(optarg);
break;
case OPT_CMD:
command = optarg;
rest.insert(rest.begin(), argv + optind, argv + argc);
break;
case OPT_VERSION:
std::cout << STELLAR_CORE_VERSION;
return 0;
case OPT_FORCESCP:
newNetwork = true;
break;
case OPT_METRIC:
metrics.push_back(std::string(optarg));
break;
case OPT_NEWDB:
newDB = true;
break;
case OPT_NEWHIST:
newHistories.push_back(std::string(optarg));
break;
case OPT_LOGLEVEL:
logLevel = Logging::getLLfromString(std::string(optarg));
break;
case OPT_GENSEED:
{
SecretKey key = SecretKey::random();
std::cout << "Secret seed: " << key.getBase58Seed() << std::endl;
std::cout << "Public: " << key.getBase58Public() << std::endl;
return 0;
}
default:
usage(0);
return 0;
}
}
Config cfg;
try
{
if (fs::exists(cfgFile))
{
cfg.load(cfgFile);
Logging::setLoggingToFile(cfg.LOG_FILE_PATH);
}
else
{
LOG(WARNING) << "No config file " << cfgFile << " found";
cfgFile = ":default-settings:";
}
Logging::setLogLevel(logLevel, nullptr);
cfg.REBUILD_DB = newDB;
cfg.START_NEW_NETWORK = newNetwork;
cfg.REPORT_METRICS = metrics;
if (command.size())
{
sendCommand(command, rest, cfg.HTTP_PORT);
return 0;
}
else if (newNetwork || newDB)
{
if (newDB)
initializeDatabase(cfg);
if (newNetwork)
setForceSCPFlag(cfg);
return 0;
}
//.........这里部分代码省略.........